Add MKWATCHDOG option

This commit is contained in:
Arun Thomas 2011-07-29 20:36:42 +02:00
parent 89f0baab63
commit 1a8cf59d04
11 changed files with 30 additions and 23 deletions

View file

@ -7,7 +7,7 @@ PROG= kernel
SRCS= mpx.S
SRCS+= start.c table.c main.c proc.c \
system.c clock.c utility.c debug.c interrupt.c \
watchdog.c cpulocals.c
cpulocals.c
.ifdef CONFIG_SMP
SRCS += smp.c
@ -44,6 +44,11 @@ MAN=
.include "system/Makefile.inc"
.include "arch/${ARCH}/Makefile.inc"
.if ${USE_WATCHDOG} != "no"
SRCS+= watchdog.c arch_watchdog.c
CPPFLAGS+= -DUSE_WATCHDOG
.endif
# These come last, so the profiling buffer is at the end of the data segment
SRCS+= profile.c do_sprofile.c

View file

@ -29,7 +29,6 @@ SRCS+= arch_do_vmctl.c \
arch_system.c \
apic.c \
apic_asm.S \
arch_watchdog.c \
pre_init.c \
acpi.c

View file

@ -24,7 +24,7 @@
#include "acpi.h"
#ifdef CONFIG_WATCHDOG
#ifdef USE_WATCHDOG
#include "kernel/watchdog.h"
#endif

View file

@ -22,7 +22,7 @@
#ifdef CONFIG_APIC
#include "apic.h"
#ifdef CONFIG_WATCHDOG
#ifdef USE_WATCHDOG
#include "kernel/watchdog.h"
#endif
#endif
@ -1046,7 +1046,7 @@ PUBLIC int arch_enable_paging(struct proc * caller, const message * m_ptr)
#endif
#endif
#ifdef CONFIG_WATCHDOG
#ifdef USE_WATCHDOG
/*
* We make sure that we don't enable the watchdog until paging is turned
* on as we might get an NMI while switching and we might still use wrong

View file

@ -507,7 +507,7 @@ LABEL(single_step_exception)
EXCEPTION_NO_ERR_CODE(DEBUG_VECTOR)
LABEL(nmi)
#ifndef CONFIG_WATCHDOG
#ifndef USE_WATCHDOG
EXCEPTION_NO_ERR_CODE(NMI_VECTOR)
#else
/*

View file

@ -36,7 +36,7 @@
#include "clock.h"
#ifdef CONFIG_WATCHDOG
#ifdef USE_WATCHDOG
#include "watchdog.h"
#endif
@ -74,7 +74,7 @@ PUBLIC int timer_int_handler(void)
struct proc * p, * billp;
/* FIXME watchdog for slave cpus! */
#ifdef CONFIG_WATCHDOG
#ifdef USE_WATCHDOG
/*
* we need to know whether local timer ticks are happening or whether
* the kernel is locked up. We don't care about overflows as we only

View file

@ -7,11 +7,6 @@
#endif
/* boot verbose */
#define CONFIG_BOOT_VERBOSE
/*
* compile in the nmi watchdog by default. It is not enabled until watchdog=1
* (non-zero) is set in monitor
*/
#define CONFIG_WATCHDOG
#ifndef CONFIG_MAX_CPUS
#define CONFIG_MAX_CPUS 1

View file

@ -25,7 +25,7 @@
#ifdef CONFIG_SMP
#include "smp.h"
#endif
#ifdef CONFIG_WATCHDOG
#ifdef USE_WATCHDOG
#include "watchdog.h"
#endif
#include "spinlock.h"

View file

@ -7,7 +7,7 @@
#include <string.h>
#include "proto.h"
#ifdef CONFIG_WATCHDOG
#ifdef USE_WATCHDOG
#include "watchdog.h"
#endif
@ -106,7 +106,7 @@ PUBLIC void cstart(
config_apic_timer_x = 1;
#endif
#ifdef CONFIG_WATCHDOG
#ifdef USE_WATCHDOG
value = env_get("watchdog");
if (value)
watchdog_enabled = atoi(value);

View file

@ -756,6 +756,9 @@ _MKVARS.yes= \
MKSHARE MKSKEY MKSTATICLIB \
MKX11FONTS \
MKYP
#MINIX-specific vars
_MKVARS.yes+= \
MKWATCHDOG
.for var in ${_MKVARS.yes}
${var}?= yes
.endfor
@ -813,6 +816,11 @@ MKMAN:= no
MKNLS:= no
.endif
# MINIX
.if ${MKEMBED} == "yes"
MKWATCHDOG:= no
.endif
#
# install(1) parameters.
#
@ -871,7 +879,8 @@ ${var}?= no
# USE_* options which default to "yes" unless their corresponding MK*
# variable is set to "no".
#
.for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP
.for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP \
USE_WATCHDOG
.if (${${var:S/USE_/MK/}} == "no")
${var}:= no
.else

View file

@ -236,12 +236,6 @@ AR?= aal
.elif !empty(CC:M*gcc) || !empty(CC:M*clang) || !empty(CC:M*pcc)
COMPILER_TYPE=gnu
AR?= ar
.if defined(MKEMBED) && ${MKEMBED} == "yes"
DBG= -Os
CFLAGS+= -DNDEBUG=1
.endif
.endif
# Set NBSD_LIBC to either "yes" or "no".
@ -250,3 +244,8 @@ NBSD_LIBC= no
.else
NBSD_LIBC= yes
.endif
.if ${COMPILER_TYPE} == "gnu" && defined(MKEMBED) && ${MKEMBED} == "yes"
DBG= -Os
CFLAGS+= -DNDEBUG=1
.endif