From: Sascha Wildner Date: Thu, 3 May 2012 20:58:16 +0000 (+0200) Subject: kernel/wdog: Compile in kern_wdog.c by default. X-Git-Tag: v3.2.0~1024 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/cf03d6cd83d04f6699343a657716434014c9a830 kernel/wdog: Compile in kern_wdog.c by default. Actually it was always compiled in by default but the code depended on the WATCHDOG_ENABLED option which is not in the GENERIC kernels. Simply remove the WATCHDOG_ENABLE option. The code is small, it does nothing by default than initializing a lock, a /dev/wdog and a callout, and it also makes it easier for people who want to use ichwd(4) by simply kldloading it. --- diff --git a/UPDATING b/UPDATING index 0791a77827..6d3f5839bb 100644 --- a/UPDATING +++ b/UPDATING @@ -20,6 +20,12 @@ effect for a while. The hw.ioapic_enable tunable now serves its purpose. If you have 'options APIC_IO' in your kernel config, you'll have to remove it. +WATCHDOG_ENABLE OPTION REMOVED +------------------------------ + +The wdog framework is now compiled into our kernels by default, so the +option is no longer needed. + +-----------------------------------------------------------------------+ + UPGRADING DRAGONFLY FROM 2.10 to later versions + +-----------------------------------------------------------------------+ diff --git a/sys/conf/options b/sys/conf/options index 2564919b2b..341eef0858 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -656,9 +656,6 @@ DSCHED_FQ opt_dsched.h # Receive Side Scaling (now basecode) RSS_DEBUG opt_rss.h -# Enable watchdogs -WATCHDOG_ENABLE opt_cpu.h - # Panic settings WDOG_DISABLE_ON_PANIC opt_panic.h ERROR_LED_ON_PANIC opt_panic.h diff --git a/sys/config/LINT b/sys/config/LINT index 88acc9786e..79cba2a285 100644 --- a/sys/config/LINT +++ b/sys/config/LINT @@ -2597,7 +2597,6 @@ options DSCHED_BFQ options DSCHED_FQ # WATCHDOG -options WATCHDOG_ENABLE # Enable watchdog support framework options WDOG_DISABLE_ON_PANIC # Automatically disable watchdogs on panic # LED diff --git a/sys/config/LINT64 b/sys/config/LINT64 index 93f892fb4d..81b7abd925 100644 --- a/sys/config/LINT64 +++ b/sys/config/LINT64 @@ -2359,7 +2359,6 @@ options DSCHED_BFQ options DSCHED_FQ # WATCHDOG -options WATCHDOG_ENABLE # Enable watchdog support framework options WDOG_DISABLE_ON_PANIC # Automatically disable watchdogs on panic # LED diff --git a/sys/config/SOEKRIS b/sys/config/SOEKRIS index d48190c677..7617fc2a5b 100644 --- a/sys/config/SOEKRIS +++ b/sys/config/SOEKRIS @@ -11,7 +11,6 @@ cpu I586_CPU ident SOEKRIS maxusers 0 options CPU_GEODE -options WATCHDOG_ENABLE options WDOG_DISABLE_ON_PANIC options ERROR_LED_ON_PANIC device gpio diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 25dd2cbac0..fa69d1c5f2 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -818,7 +818,7 @@ panic(const char *fmt, ...) led_switch("error", 1); #endif -#if defined(WDOG_DISABLE_ON_PANIC) && defined(WATCHDOG_ENABLE) +#if defined(WDOG_DISABLE_ON_PANIC) wdog_disable(); #endif diff --git a/sys/kern/kern_wdog.c b/sys/kern/kern_wdog.c index f09f4d0221..129407f714 100644 --- a/sys/kern/kern_wdog.c +++ b/sys/kern/kern_wdog.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#include "opt_cpu.h" + #include #include #include @@ -48,7 +48,6 @@ #include #include -#ifdef WATCHDOG_ENABLE static LIST_HEAD(, watchdog) wdoglist = LIST_HEAD_INITIALIZER(&wdoglist); static struct spinlock wdogmtx; static struct callout wdog_callout; @@ -228,5 +227,3 @@ wdog_uninit(void) SYSINIT(wdog_register, SI_SUB_PRE_DRIVERS, SI_ORDER_ANY, wdog_init, NULL); SYSUNINIT(wdog_register, SI_SUB_PRE_DRIVERS, SI_ORDER_ANY, wdog_uninit, NULL); - -#endif /* WATCHDOG_ENABLE */ diff --git a/sys/platform/pc32/i386/cs5536.c b/sys/platform/pc32/i386/cs5536.c index f1fbf28972..c8e2cbc0cd 100644 --- a/sys/platform/pc32/i386/cs5536.c +++ b/sys/platform/pc32/i386/cs5536.c @@ -50,7 +50,6 @@ * */ -#include "opt_cpu.h" #include "use_gpio.h" #include @@ -333,7 +332,6 @@ cs5536_get_timecount(void) return (cs5536_timer.base + rdmsr(AMD5536_TMC)); } -#ifdef WATCHDOG_ENABLE static int cs5536_watchdog(void *unused, int period) { @@ -364,7 +362,6 @@ static struct watchdog cs5536_wdog = { .arg = NULL, .period_max = 0xffff, }; -#endif /* WATCHDOG_ENABLE */ static int cs5536_probe(device_t self) @@ -414,13 +411,11 @@ cs5536_attach(device_t self) cs5536_sc.sc_iot = I386_BUS_SPACE_IO; cs5536_sc.sc_ioh = rdmsr(MSR_LBAR_MFGPT); -#ifdef WATCHDOG_ENABLE /* enable watchdog and configure */ bus_space_write_2(cs5536_sc.sc_iot, cs5536_sc.sc_ioh, AMD5536_MFGPT0_SETUP, AMD5536_MFGPT_CNT_EN | AMD5536_MFGPT_CMP2EV | AMD5536_MFGPT_CMP2 | AMD5536_MFGPT_DIV_MASK); wdog_register(&cs5536_wdog); -#endif /* WATCHDOG_ENABLE */ #if NGPIO > 0 /* bus_space_map(sc->sc_gpio_iot, ga & 0xffff, 0xff, 0,... */ diff --git a/sys/platform/pc32/i386/geode.c b/sys/platform/pc32/i386/geode.c index 51e9859d54..1fefa5477e 100644 --- a/sys/platform/pc32/i386/geode.c +++ b/sys/platform/pc32/i386/geode.c @@ -47,7 +47,6 @@ * SUCH DAMAGE. * */ -#include "opt_cpu.h" #include #include @@ -132,8 +131,6 @@ geode_get_timecount(void) bus_space_read_4(geode_sc.sc_iot, geode_sc.sc_ioh, GCB_TSC)); } - -#ifdef WATCHDOG_ENABLE static int geode_watchdog(void *unused, int period) { @@ -151,7 +148,6 @@ static struct watchdog geode_wdog = { .arg = NULL, .period_max = 0x03ff, }; -#endif /* WATCHDOG_ENABLE */ static int geode_probe(device_t self) @@ -203,7 +199,6 @@ geode_attach(device_t self) cputimer_register(&geode_timer); cputimer_select(&geode_timer, 0); -#ifdef WATCHDOG_ENABLE /* enable watchdog and configure */ bus_space_write_2(geode_sc.sc_iot, geode_sc.sc_ioh, GCB_WDTO, 0); sts |= WDOVF_CLEAR; @@ -212,7 +207,6 @@ geode_attach(device_t self) cnfg |= WDTYPE1_RESET | WDPRES_DIV_512; bus_space_write_2(geode_sc.sc_iot, geode_sc.sc_ioh, GCB_WDCNFG, cnfg); wdog_register(&geode_wdog); -#endif /* WATCHDOG_ENABLE */ return 0; }