From b02bbab0a6e3de8be91e0f0bae84596bdcf83eca Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Fri, 17 Sep 2004 00:21:08 +0000 Subject: [PATCH] timeout/untimeout ==> callout_* --- sys/i386/apm/apm.c | 13 +++++++------ sys/i386/isa/clock.c | 8 +++++--- sys/platform/pc32/apm/apm.c | 13 +++++++------ sys/platform/pc32/isa/clock.c | 8 +++++--- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c index 40ce449d5c..750fc59abc 100644 --- a/sys/i386/apm/apm.c +++ b/sys/i386/apm/apm.c @@ -16,7 +16,7 @@ * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * * $FreeBSD: src/sys/i386/apm/apm.c,v 1.114.2.5 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/i386/apm/Attic/apm.c,v 1.9 2004/07/04 23:28:31 dillon Exp $ + * $DragonFly: src/sys/i386/apm/Attic/apm.c,v 1.10 2004/09/17 00:21:08 joerg Exp $ */ #include @@ -73,8 +73,7 @@ static struct apmhook *hook[NAPM_HOOK]; /* XXX */ /* Map version number to integer (keeps ordering of version numbers) */ #define INTVERSION(major, minor) ((major)*100 + (minor)) -static struct callout_handle apm_timeout_ch = - CALLOUT_HANDLE_INITIALIZER(&apm_timeout_ch); +static struct callout apm_timeout_ch; static timeout_t apm_timeout; static d_open_t apmopen; @@ -751,9 +750,10 @@ apm_timeout(void *dummy) if (!sc->bios_busy) apm_processevent(); - if (sc->active == 1) + if (sc->active == 1) { /* Run slightly more oftan than 1 Hz */ - apm_timeout_ch = timeout(apm_timeout, NULL, hz - 1 ); + callout_reset(&apm_timeout_ch, hz - 1, apm_timeout, NULL); + } } /* enable APM BIOS */ @@ -765,6 +765,7 @@ apm_event_enable(void) APM_DPRINT("called apm_event_enable()\n"); if (sc->initialized) { sc->active = 1; + callout_init(&apm_timeout_ch); apm_timeout(sc); } } @@ -777,7 +778,7 @@ apm_event_disable(void) APM_DPRINT("called apm_event_disable()\n"); if (sc->initialized) { - untimeout(apm_timeout, NULL, apm_timeout_ch); + callout_stop(&apm_timeout_ch); sc->active = 0; } } diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index ed7145050f..bb0e6c5ef2 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -35,7 +35,7 @@ * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/clock.c,v 1.149.2.6 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/i386/isa/Attic/clock.c,v 1.16 2004/08/02 23:20:30 dillon Exp $ + * $DragonFly: src/sys/i386/isa/Attic/clock.c,v 1.17 2004/09/17 00:18:13 joerg Exp $ */ /* @@ -147,6 +147,8 @@ static u_char rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF; static u_char rtc_statusb = RTCSB_24HR | RTCSB_PINTR; static u_int tsc_present; +static struct callout sysbeepstop_ch; + /* * timer0 clock interrupt. Timer0 is in one-shot mode and has stopped * counting as of this interrupt. We use timer1 in free-running mode (not @@ -441,7 +443,7 @@ sysbeep(int pitch, int period) /* enable counter2 output to speaker */ outb(IO_PPI, inb(IO_PPI) | 3); beeping = period; - timeout(sysbeepstop, (void *)NULL, period); + callout_reset(&sysbeepstop_ch, period, sysbeepstop, NULL); } return (0); } @@ -1009,7 +1011,7 @@ cpu_initclocks() "routing 8254 via 8259 and IOAPIC #0 intpin 0\n"); } #endif - + callout_init(&sysbeepstop_ch); } #ifdef APIC_IO diff --git a/sys/platform/pc32/apm/apm.c b/sys/platform/pc32/apm/apm.c index f024d7b381..ae75b61189 100644 --- a/sys/platform/pc32/apm/apm.c +++ b/sys/platform/pc32/apm/apm.c @@ -16,7 +16,7 @@ * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * * $FreeBSD: src/sys/i386/apm/apm.c,v 1.114.2.5 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/platform/pc32/apm/apm.c,v 1.9 2004/07/04 23:28:31 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/apm/apm.c,v 1.10 2004/09/17 00:21:08 joerg Exp $ */ #include @@ -73,8 +73,7 @@ static struct apmhook *hook[NAPM_HOOK]; /* XXX */ /* Map version number to integer (keeps ordering of version numbers) */ #define INTVERSION(major, minor) ((major)*100 + (minor)) -static struct callout_handle apm_timeout_ch = - CALLOUT_HANDLE_INITIALIZER(&apm_timeout_ch); +static struct callout apm_timeout_ch; static timeout_t apm_timeout; static d_open_t apmopen; @@ -751,9 +750,10 @@ apm_timeout(void *dummy) if (!sc->bios_busy) apm_processevent(); - if (sc->active == 1) + if (sc->active == 1) { /* Run slightly more oftan than 1 Hz */ - apm_timeout_ch = timeout(apm_timeout, NULL, hz - 1 ); + callout_reset(&apm_timeout_ch, hz - 1, apm_timeout, NULL); + } } /* enable APM BIOS */ @@ -765,6 +765,7 @@ apm_event_enable(void) APM_DPRINT("called apm_event_enable()\n"); if (sc->initialized) { sc->active = 1; + callout_init(&apm_timeout_ch); apm_timeout(sc); } } @@ -777,7 +778,7 @@ apm_event_disable(void) APM_DPRINT("called apm_event_disable()\n"); if (sc->initialized) { - untimeout(apm_timeout, NULL, apm_timeout_ch); + callout_stop(&apm_timeout_ch); sc->active = 0; } } diff --git a/sys/platform/pc32/isa/clock.c b/sys/platform/pc32/isa/clock.c index 7a4bef3892..91b071986f 100644 --- a/sys/platform/pc32/isa/clock.c +++ b/sys/platform/pc32/isa/clock.c @@ -35,7 +35,7 @@ * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/clock.c,v 1.149.2.6 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/platform/pc32/isa/clock.c,v 1.16 2004/08/02 23:20:30 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/isa/clock.c,v 1.17 2004/09/17 00:18:13 joerg Exp $ */ /* @@ -147,6 +147,8 @@ static u_char rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF; static u_char rtc_statusb = RTCSB_24HR | RTCSB_PINTR; static u_int tsc_present; +static struct callout sysbeepstop_ch; + /* * timer0 clock interrupt. Timer0 is in one-shot mode and has stopped * counting as of this interrupt. We use timer1 in free-running mode (not @@ -441,7 +443,7 @@ sysbeep(int pitch, int period) /* enable counter2 output to speaker */ outb(IO_PPI, inb(IO_PPI) | 3); beeping = period; - timeout(sysbeepstop, (void *)NULL, period); + callout_reset(&sysbeepstop_ch, period, sysbeepstop, NULL); } return (0); } @@ -1009,7 +1011,7 @@ cpu_initclocks() "routing 8254 via 8259 and IOAPIC #0 intpin 0\n"); } #endif - + callout_init(&sysbeepstop_ch); } #ifdef APIC_IO -- 2.32.0