summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMasao Uebayashi <uebayasi@cvs.openbsd.org>2014-07-11 22:28:07 +0000
committerMasao Uebayashi <uebayasi@cvs.openbsd.org>2014-07-11 22:28:07 +0000
commite135a1a144961c66ddc491f160b768094f3ee23e (patch)
tree4c0a2ba3599d4c9340c8038e060791bad9ed4e06 /sys
parent59e0a38e2425017e3db4dd76b453574687eecbb8 (diff)
boot(9): Undo curproc-overriding hacks
Some (not all) boot(9) implementations have ancient hacks which overrides if (curproc == NULL). This was probably made in a hope to forcibly proceed various clean-shutdown related code, including VFS shutdown. Let's clarify that clean-shutdown needs process context; it is impossible to cleanly shutdown VFS from within e.g. a panic in SPL_HIGH. OK kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/machdep.c6
-rw-r--r--sys/arch/i386/i386/machdep.c7
-rw-r--r--sys/arch/loongson/loongson/machdep.c6
-rw-r--r--sys/arch/octeon/octeon/machdep.c6
-rw-r--r--sys/arch/sgi/sgi/machdep.c6
-rw-r--r--sys/arch/solbourne/solbourne/machdep.c7
-rw-r--r--sys/arch/sparc/sparc/machdep.c7
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c6
8 files changed, 9 insertions, 42 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 3d755d5758e..d42dd320596 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.184 2014/07/10 21:46:02 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.185 2014/07/11 22:28:05 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -157,6 +157,7 @@ char machine[] = MACHINE;
void (*cpu_idle_leave_fcn)(void) = NULL;
void (*cpu_idle_cycle_fcn)(void) = NULL;
void (*cpu_idle_enter_fcn)(void) = NULL;
+void (*cpu_busy_cycle_fcn)(void) = NULL;
/* the following is used externally for concurrent handlers */
int setperf_prio = 0;
@@ -759,9 +760,6 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
waittime = 0;
-
- if (curproc == NULL)
- curproc = &proc0;
vfs_shutdown();
if ((howto & RB_TIMEBAD) == 0) {
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index 032caa718f4..06b6e589698 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.545 2014/07/10 21:46:03 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.546 2014/07/11 22:28:05 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -2570,11 +2570,6 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
- extern struct proc proc0;
-
- if (curproc == NULL)
- curproc = &proc0;
-
waittime = 0;
vfs_shutdown();
diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c
index cd5198084e9..da4394954e8 100644
--- a/sys/arch/loongson/loongson/machdep.c
+++ b/sys/arch/loongson/loongson/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.53 2014/07/10 21:46:03 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.54 2014/07/11 22:28:05 uebayasi Exp $ */
/*
* Copyright (c) 2009, 2010, 2014 Miodrag Vallat.
@@ -915,10 +915,6 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
- extern struct proc proc0;
- /* fill curproc with live object */
- if (curproc == NULL)
- curproc = &proc0;
waittime = 0;
vfs_shutdown();
diff --git a/sys/arch/octeon/octeon/machdep.c b/sys/arch/octeon/octeon/machdep.c
index 982a314e9a7..0d3d2f724b6 100644
--- a/sys/arch/octeon/octeon/machdep.c
+++ b/sys/arch/octeon/octeon/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.53 2014/07/10 21:46:03 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.54 2014/07/11 22:28:05 uebayasi Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
@@ -679,10 +679,6 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
- extern struct proc proc0;
- /* fill curproc with live object */
- if (curproc == NULL)
- curproc = &proc0;
waittime = 0;
vfs_shutdown();
diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c
index 7eee5220b4a..574ce8a3a0e 100644
--- a/sys/arch/sgi/sgi/machdep.c
+++ b/sys/arch/sgi/sgi/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.144 2014/07/10 21:46:03 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.145 2014/07/11 22:28:05 uebayasi Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -842,10 +842,6 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
- extern struct proc proc0;
- /* fill curproc with live object */
- if (curproc == NULL)
- curproc = &proc0;
waittime = 0;
vfs_shutdown();
diff --git a/sys/arch/solbourne/solbourne/machdep.c b/sys/arch/solbourne/solbourne/machdep.c
index 0c2a93a3bdd..1527085847a 100644
--- a/sys/arch/solbourne/solbourne/machdep.c
+++ b/sys/arch/solbourne/solbourne/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.37 2014/07/10 21:46:03 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.38 2014/07/11 22:28:05 uebayasi Exp $ */
/* OpenBSD: machdep.c,v 1.105 2005/04/11 15:13:01 deraadt Exp */
/*
@@ -529,11 +529,6 @@ boot(int howto)
fb_unblank();
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
- extern struct proc proc0;
-
- /* make sure there's a process to charge for I/O in sync() */
- if (curproc == NULL)
- curproc = &proc0;
waittime = 0;
vfs_shutdown();
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c
index 53fd055d671..25df437a34b 100644
--- a/sys/arch/sparc/sparc/machdep.c
+++ b/sys/arch/sparc/sparc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.159 2014/07/11 09:36:26 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.160 2014/07/11 22:28:06 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */
/*
@@ -538,11 +538,6 @@ boot(int howto)
fb_unblank();
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
- extern struct proc proc0;
-
- /* make sure there's a process to charge for I/O in sync() */
- if (curproc == NULL)
- curproc = &proc0;
waittime = 0;
vfs_shutdown();
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index c78acf20e6e..e6a9c12142d 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.162 2014/07/11 09:36:26 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.163 2014/07/11 22:28:06 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -620,12 +620,8 @@ boot(int howto)
fb_unblank();
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
- extern struct proc proc0;
extern int sparc_clock_time_is_ok;
- /* make sure there's a process to charge for I/O in sync() */
- if (curproc == NULL)
- curproc = &proc0;
waittime = 0;
vfs_shutdown();