Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpkern cpu_reboot() is more of an emul.c ...
details: https://anonhg.NetBSD.org/src/rev/d8442a910df7
branches: trunk
changeset: 795722:d8442a910df7
user: pooka <pooka%NetBSD.org@localhost>
date: Fri Apr 25 19:56:01 2014 +0000
description:
cpu_reboot() is more of an emul.c thing than a rump.c thing
diffstat:
sys/rump/librump/rumpkern/emul.c | 48 ++++++++++++++++++++++++++++++++++++++-
sys/rump/librump/rumpkern/rump.c | 47 +-------------------------------------
2 files changed, 48 insertions(+), 47 deletions(-)
diffs (148 lines):
diff -r 1960da7c58c0 -r d8442a910df7 sys/rump/librump/rumpkern/emul.c
--- a/sys/rump/librump/rumpkern/emul.c Fri Apr 25 19:07:55 2014 +0000
+++ b/sys/rump/librump/rumpkern/emul.c Fri Apr 25 19:56:01 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emul.c,v 1.164 2014/03/11 00:59:38 pooka Exp $ */
+/* $NetBSD: emul.c,v 1.165 2014/04/25 19:56:01 pooka Exp $ */
/*
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.164 2014/03/11 00:59:38 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.165 2014/04/25 19:56:01 pooka Exp $");
#include <sys/param.h>
#include <sys/null.h>
@@ -63,6 +63,8 @@
#include "rump_private.h"
+void (*rump_vfs_fini)(void) = (void *)nullop;
+
/*
* physmem is largely unused (except for nmbcluster calculations),
* so pick a default value which suits ZFS. if an application wants
@@ -307,3 +309,45 @@
/* nada */
}
#endif
+
+void
+cpu_reboot(int howto, char *bootstr)
+{
+ int ruhow = 0;
+ void *finiarg;
+
+ printf("rump kernel halting...\n");
+
+ if (!RUMP_LOCALPROC_P(curproc))
+ finiarg = curproc->p_vmspace->vm_map.pmap;
+ else
+ finiarg = NULL;
+
+ /* dump means we really take the dive here */
+ if ((howto & RB_DUMP) || panicstr) {
+ ruhow = RUMPUSER_PANIC;
+ goto out;
+ }
+
+ /* try to sync */
+ if (!((howto & RB_NOSYNC) || panicstr)) {
+ rump_vfs_fini();
+ }
+
+ doshutdownhooks();
+
+ /* your wish is my command */
+ if (howto & RB_HALT) {
+ printf("rump kernel halted\n");
+ rumpuser_sp_fini(finiarg);
+ for (;;) {
+ rumpuser_clock_sleep(RUMPUSER_CLOCK_RELWALL, 10, 0);
+ }
+ }
+
+ /* this function is __dead, we must exit */
+ out:
+ printf("halted\n");
+ rumpuser_sp_fini(finiarg);
+ rumpuser_exit(ruhow);
+}
diff -r 1960da7c58c0 -r d8442a910df7 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c Fri Apr 25 19:07:55 2014 +0000
+++ b/sys/rump/librump/rumpkern/rump.c Fri Apr 25 19:56:01 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump.c,v 1.301 2014/04/25 18:25:38 pooka Exp $ */
+/* $NetBSD: rump.c,v 1.302 2014/04/25 19:56:01 pooka Exp $ */
/*
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.301 2014/04/25 18:25:38 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.302 2014/04/25 19:56:01 pooka Exp $");
#include <sys/systm.h>
#define ELFSIZE ARCH_ELFSIZE
@@ -125,7 +125,6 @@
static int rump_inited;
void (*rump_vfs_drainbufs)(int) = (void *)nullop;
-void (*rump_vfs_fini)(void) = (void *)nullop;
int (*rump_vfs_makeonedevnode)(dev_t, const char *,
devmajor_t, devminor_t) = (void *)nullop;
int (*rump_vfs_makedevnodes)(dev_t, const char *, char,
@@ -543,48 +542,6 @@
return rumpuser_sp_init(url, ostype, osrelease, MACHINE);
}
-void
-cpu_reboot(int howto, char *bootstr)
-{
- int ruhow = 0;
- void *finiarg;
-
- printf("rump kernel halting...\n");
-
- if (!RUMP_LOCALPROC_P(curproc))
- finiarg = curproc->p_vmspace->vm_map.pmap;
- else
- finiarg = NULL;
-
- /* dump means we really take the dive here */
- if ((howto & RB_DUMP) || panicstr) {
- ruhow = RUMPUSER_PANIC;
- goto out;
- }
-
- /* try to sync */
- if (!((howto & RB_NOSYNC) || panicstr)) {
- rump_vfs_fini();
- }
-
- doshutdownhooks();
-
- /* your wish is my command */
- if (howto & RB_HALT) {
- printf("rump kernel halted\n");
- rumpuser_sp_fini(finiarg);
- for (;;) {
- rumpuser_clock_sleep(RUMPUSER_CLOCK_RELWALL, 10, 0);
- }
- }
-
- /* this function is __dead, we must exit */
- out:
- printf("halted\n");
- rumpuser_sp_fini(finiarg);
- rumpuser_exit(ruhow);
-}
-
static int compcounter[RUMP_COMPONENT_MAX];
static int compinited[RUMP_COMPONENT_MAX];
Home |
Main Index |
Thread Index |
Old Index