diff options
| author | rin <rin@NetBSD.org> | 2021-03-30 01:33:50 +0000 |
|---|---|---|
| committer | rin <rin@NetBSD.org> | 2021-03-30 01:33:50 +0000 |
| commit | ef377d64293f64273bad03665e26b9d298df17fe (patch) | |
| tree | db84dda24161fc48f94d280dbe4fa2cfb2397c4c /sys/arch/evbppc/obs405 | |
| parent | 4a922844f4ccb003b1314bff78d6d8127b09090a (diff) | |
Centralize cpu_reboot().
Diffstat (limited to 'sys/arch/evbppc/obs405')
| -rw-r--r-- | sys/arch/evbppc/obs405/obs200_machdep.c | 90 | ||||
| -rw-r--r-- | sys/arch/evbppc/obs405/obs266_machdep.c | 90 | ||||
| -rw-r--r-- | sys/arch/evbppc/obs405/obs600_machdep.c | 90 |
3 files changed, 6 insertions, 264 deletions
diff --git a/sys/arch/evbppc/obs405/obs200_machdep.c b/sys/arch/evbppc/obs405/obs200_machdep.c index 82d49806eef..793549d9647 100644 --- a/sys/arch/evbppc/obs405/obs200_machdep.c +++ b/sys/arch/evbppc/obs405/obs200_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: obs200_machdep.c,v 1.21 2021/03/30 01:16:45 rin Exp $ */ +/* $NetBSD: obs200_machdep.c,v 1.22 2021/03/30 01:33:50 rin Exp $ */ /* Original: machdep.c,v 1.3 2005/01/17 17:24:09 shige Exp */ /* @@ -68,7 +68,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: obs200_machdep.c,v 1.21 2021/03/30 01:16:45 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: obs200_machdep.c,v 1.22 2021/03/30 01:33:50 rin Exp $"); #include "opt_compat_netbsd.h" #include "opt_ddb.h" @@ -122,11 +122,6 @@ __KERNEL_RCSID(0, "$NetBSD: obs200_machdep.c,v 1.21 2021/03/30 01:16:45 rin Exp #define TLB_PG_SIZE (16*1024*1024) -/* - * Global variables used here and there - */ -extern paddr_t msgbuf_paddr; - void initppc(vaddr_t, vaddr_t, char *, void *); void @@ -212,87 +207,6 @@ cpu_startup(void) fake_mapiodev = 0; } -/* - * Halt or reboot the machine after syncing/dumping according to howto. - */ -void -cpu_reboot(int howto, char *what) -{ - static int syncing; - static char str[256]; - char *ap = str, *ap1 = ap; - - boothowto = howto; - if (!cold && !(howto & RB_NOSYNC) && !syncing) { - syncing = 1; - vfs_shutdown(); /* sync */ - resettodr(); /* set wall clock */ - } - - splhigh(); - - if (!cold && (howto & RB_DUMP)) - ibm4xx_dumpsys(); - - doshutdownhooks(); - - pmf_system_shutdown(boothowto); - - if ((howto & RB_POWERDOWN) == RB_POWERDOWN) { - /* Power off here if we know how...*/ - } - - if (howto & RB_HALT) { - printf("halted\n\n"); - -#if 0 - goto reboot; /* XXX for now... */ -#endif - -#ifdef DDB - printf("dropping to debugger\n"); - while(1) - Debugger(); -#endif - } - - printf("rebooting\n\n"); - if (what && *what) { - if (strlen(what) > sizeof str - 5) - printf("boot string too large, ignored\n"); - else { - strcpy(str, what); - ap1 = ap = str + strlen(str); - *ap++ = ' '; - } - } - *ap++ = '-'; - if (howto & RB_SINGLE) - *ap++ = 's'; - if (howto & RB_KDB) - *ap++ = 'd'; - *ap++ = 0; - if (ap[-2] == '-') - *ap1 = 0; - - /* flush cache for msgbuf */ - __syncicache((void *)msgbuf_paddr, round_page(MSGBUFSIZE)); - -#if 0 - reboot: -#endif - ppc4xx_reset(); - - printf("ppc4xx_reset() failed!\n"); -#ifdef DDB - while(1) - Debugger(); -#else - while (1) - /* nothing */; -#endif -} - int ibm4xx_pci_bus_maxdevs(void *v, int busno) { diff --git a/sys/arch/evbppc/obs405/obs266_machdep.c b/sys/arch/evbppc/obs405/obs266_machdep.c index 1aed1045b1b..91e1f6283d5 100644 --- a/sys/arch/evbppc/obs405/obs266_machdep.c +++ b/sys/arch/evbppc/obs405/obs266_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: obs266_machdep.c,v 1.22 2021/03/30 01:16:45 rin Exp $ */ +/* $NetBSD: obs266_machdep.c,v 1.23 2021/03/30 01:33:50 rin Exp $ */ /* Original: md_machdep.c,v 1.3 2005/01/24 18:47:37 shige Exp $ */ /* @@ -68,7 +68,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: obs266_machdep.c,v 1.22 2021/03/30 01:16:45 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: obs266_machdep.c,v 1.23 2021/03/30 01:33:50 rin Exp $"); #include "opt_compat_netbsd.h" #include "opt_ddb.h" @@ -122,11 +122,6 @@ __KERNEL_RCSID(0, "$NetBSD: obs266_machdep.c,v 1.22 2021/03/30 01:16:45 rin Exp #define TLB_PG_SIZE (16*1024*1024) -/* - * Global variables used here and there - */ -extern paddr_t msgbuf_paddr; - void initppc(vaddr_t, vaddr_t, char *, void *); void @@ -203,87 +198,6 @@ cpu_startup(void) fake_mapiodev = 0; } -/* - * Halt or reboot the machine after syncing/dumping according to howto. - */ -void -cpu_reboot(int howto, char *what) -{ - static int syncing; - static char str[256]; - char *ap = str, *ap1 = ap; - - boothowto = howto; - if (!cold && !(howto & RB_NOSYNC) && !syncing) { - syncing = 1; - vfs_shutdown(); /* sync */ - resettodr(); /* set wall clock */ - } - - splhigh(); - - if (!cold && (howto & RB_DUMP)) - ibm4xx_dumpsys(); - - doshutdownhooks(); - - pmf_system_shutdown(boothowto); - - if ((howto & RB_POWERDOWN) == RB_POWERDOWN) { - /* Power off here if we know how...*/ - } - - if (howto & RB_HALT) { - printf("halted\n\n"); - -#if 0 - goto reboot; /* XXX for now... */ -#endif - -#ifdef DDB - printf("dropping to debugger\n"); - while(1) - Debugger(); -#endif - } - - printf("rebooting\n\n"); - if (what && *what) { - if (strlen(what) > sizeof str - 5) - printf("boot string too large, ignored\n"); - else { - strcpy(str, what); - ap1 = ap = str + strlen(str); - *ap++ = ' '; - } - } - *ap++ = '-'; - if (howto & RB_SINGLE) - *ap++ = 's'; - if (howto & RB_KDB) - *ap++ = 'd'; - *ap++ = 0; - if (ap[-2] == '-') - *ap1 = 0; - - /* flush cache for msgbuf */ - __syncicache((void *)msgbuf_paddr, round_page(MSGBUFSIZE)); - -#if 0 - reboot: -#endif - ppc4xx_reset(); - - printf("ppc4xx_reset() failed!\n"); -#ifdef DDB - while(1) - Debugger(); -#else - while (1) - /* nothing */; -#endif -} - int ibm4xx_pci_bus_maxdevs(void *v, int busno) { diff --git a/sys/arch/evbppc/obs405/obs600_machdep.c b/sys/arch/evbppc/obs405/obs600_machdep.c index 4aa5a01ece1..469030a1e60 100644 --- a/sys/arch/evbppc/obs405/obs600_machdep.c +++ b/sys/arch/evbppc/obs405/obs600_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: obs600_machdep.c,v 1.13 2021/03/30 01:16:45 rin Exp $ */ +/* $NetBSD: obs600_machdep.c,v 1.14 2021/03/30 01:33:50 rin Exp $ */ /* Original: md_machdep.c,v 1.3 2005/01/24 18:47:37 shige Exp $ */ /* @@ -68,7 +68,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: obs600_machdep.c,v 1.13 2021/03/30 01:16:45 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: obs600_machdep.c,v 1.14 2021/03/30 01:33:50 rin Exp $"); #include "opt_compat_netbsd.h" #include "opt_ddb.h" @@ -130,11 +130,6 @@ __KERNEL_RCSID(0, "$NetBSD: obs600_machdep.c,v 1.13 2021/03/30 01:16:45 rin Exp #define TLB_PG_SIZE (16 * 1024 * 1024) -/* - * Global variables used here and there - */ -extern paddr_t msgbuf_paddr; - void initppc(vaddr_t, vaddr_t, int, char *[], char *); static int read_eeprom(int, char *); @@ -264,87 +259,6 @@ cpu_startup(void) } /* - * Halt or reboot the machine after syncing/dumping according to howto. - */ -void -cpu_reboot(int howto, char *what) -{ - static int syncing; - static char str[256]; - char *ap = str, *ap1 = ap; - - boothowto = howto; - if (!cold && !(howto & RB_NOSYNC) && !syncing) { - syncing = 1; - vfs_shutdown(); /* sync */ - resettodr(); /* set wall clock */ - } - - splhigh(); - - if (!cold && (howto & RB_DUMP)) - ibm4xx_dumpsys(); - - doshutdownhooks(); - - pmf_system_shutdown(boothowto); - - if ((howto & RB_POWERDOWN) == RB_POWERDOWN) { - /* Power off here if we know how...*/ - } - - if (howto & RB_HALT) { - printf("halted\n\n"); - -#if 0 - goto reboot; /* XXX for now... */ -#endif - -#ifdef DDB - printf("dropping to debugger\n"); - while(1) - Debugger(); -#endif - } - - printf("rebooting\n\n"); - if (what && *what) { - if (strlen(what) > sizeof str - 5) - printf("boot string too large, ignored\n"); - else { - strcpy(str, what); - ap1 = ap = str + strlen(str); - *ap++ = ' '; - } - } - *ap++ = '-'; - if (howto & RB_SINGLE) - *ap++ = 's'; - if (howto & RB_KDB) - *ap++ = 'd'; - *ap++ = 0; - if (ap[-2] == '-') - *ap1 = 0; - - /* flush cache for msgbuf */ - __syncicache((void *)msgbuf_paddr, round_page(MSGBUFSIZE)); - -#if 0 - reboot: -#endif - ppc4xx_reset(); - - printf("ppc4xx_reset() failed!\n"); -#ifdef DDB - while(1) - Debugger(); -#else - while (1) - /* nothing */; -#endif -} - -/* * Read EEPROM via I2C. We don't use bus_space(9) here. This is MD-part and, * don't support bus_space_unmap() to a space on reserved space? X-< * |
