From owner-svn-src-head@FreeBSD.ORG Mon Oct 18 04:30:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D22B106566C; Mon, 18 Oct 2010 04:30:27 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70CC88FC17; Mon, 18 Oct 2010 04:30:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9I4URau073102; Mon, 18 Oct 2010 04:30:27 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9I4URLe073099; Mon, 18 Oct 2010 04:30:27 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201010180430.o9I4URLe073099@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 18 Oct 2010 04:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214004 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Oct 2010 04:30:27 -0000 Author: marcel Date: Mon Oct 18 04:30:27 2010 New Revision: 214004 URL: http://svn.freebsd.org/changeset/base/214004 Log: Rename boot() to kern_reboot() and make it visible outside of kern_shutdown.c. This makes it easier for emulators and other parts of the kernel to initiate a reboot. Modified: head/sys/kern/kern_shutdown.c head/sys/sys/systm.h Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Mon Oct 18 04:26:32 2010 (r214003) +++ head/sys/kern/kern_shutdown.c Mon Oct 18 04:30:27 2010 (r214004) @@ -133,7 +133,6 @@ static struct dumperinfo dumper; /* our static struct pcb dumppcb; /* Registers. */ static lwpid_t dumptid; /* Thread ID. */ -static void boot(int) __dead2; static void poweroff_wait(void *, int); static void shutdown_halt(void *junk, int howto); static void shutdown_panic(void *junk, int howto); @@ -173,7 +172,7 @@ reboot(struct thread *td, struct reboot_ error = priv_check(td, PRIV_REBOOT); if (error == 0) { mtx_lock(&Giant); - boot(uap->opt); + kern_reboot(uap->opt); mtx_unlock(&Giant); } return (error); @@ -197,7 +196,7 @@ shutdown_nice(int howto) PROC_UNLOCK(initproc); } else { /* No init(8) running, so simply reboot */ - boot(RB_NOSYNC); + kern_reboot(RB_NOSYNC); } return; } @@ -269,8 +268,8 @@ isbufbusy(struct buf *bp) /* * Shutdown the system cleanly to prepare for reboot, halt, or power off. */ -static void -boot(int howto) +void +kern_reboot(int howto) { static int first_buf_printf = 1; @@ -283,7 +282,7 @@ boot(int howto) thread_lock(curthread); sched_bind(curthread, 0); thread_unlock(curthread); - KASSERT(PCPU_GET(cpuid) == 0, ("boot: not running on cpu 0")); + KASSERT(PCPU_GET(cpuid) == 0, ("%s: not running on cpu 0", __func__)); #endif /* We're in the process of rebooting. */ rebooting = 1; @@ -589,7 +588,7 @@ panic(const char *fmt, ...) if (!sync_on_panic) bootopt |= RB_NOSYNC; critical_exit(); - boot(bootopt); + kern_reboot(bootopt); } /* Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Mon Oct 18 04:26:32 2010 (r214003) +++ head/sys/sys/systm.h Mon Oct 18 04:30:27 2010 (r214004) @@ -46,7 +46,7 @@ #include /* for people using printf mainly */ extern int cold; /* nonzero if we are doing a cold boot */ -extern int rebooting; /* boot() has been called. */ +extern int rebooting; /* kern_reboot() has been called. */ extern const char *panicstr; /* panic message */ extern char version[]; /* system version */ extern char copyright[]; /* system copyright */ @@ -291,6 +291,7 @@ void cpu_initclocks_ap(void); void usrinfoinit(void); /* Finalize the world */ +void kern_reboot(int) __dead2; void shutdown_nice(int); /* Timeouts */