diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2007-11-25 09:11:13 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2007-11-25 09:11:13 +0000 |
commit | a265844618d4c900f0881d2d404cdf16aa6c0a34 (patch) | |
tree | b69a123aa3915acdc4a863a309bea17b069c309b /sys/arch | |
parent | 7bf61c63bf10e4618037196968a64cba393bb44e (diff) |
When available and ACPI is enabled use the ACPI reset method
to reboot. This is required for some quirky sis machines
and likely others to reboot.
Tested by many. 'commit early commit often' deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/acpi_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/acpi_machdep.c | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c index f061a7296d7..ab7d11fa168 100644 --- a/sys/arch/amd64/amd64/acpi_machdep.c +++ b/sys/arch/amd64/amd64/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.9 2007/11/16 02:45:56 deraadt Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.10 2007/11/25 09:11:12 jsg Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -152,6 +152,8 @@ havebase: void acpi_attach_machdep(struct acpi_softc *sc) { + extern void (*cpuresetfn)(void); sc->sc_interrupt = isa_intr_establish(NULL, sc->sc_fadt->sci_int, IST_LEVEL, IPL_TTY, acpi_interrupt, sc, sc->sc_dev.dv_xname); + cpuresetfn = acpi_reset; } diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 3c8e1028a75..2acbc3a9671 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.65 2007/11/03 22:23:35 mikeb Exp $ */ +/* $OpenBSD: machdep.c,v 1.66 2007/11/25 09:11:12 jsg Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -255,6 +255,7 @@ int cpu_dumpsize(void); u_long cpu_dump_mempagecnt(void); void dumpsys(void); void init_x86_64(paddr_t); +void (*cpuresetfn)(void); #ifdef KGDB #ifndef KGDB_DEVNAME @@ -1607,6 +1608,9 @@ cpu_reset(void) disable_intr(); + if (cpuresetfn) + (*cpuresetfn)(); + /* * The keyboard controller has 4 random output pins, one of which is * connected to the RESET pin on the CPU in many PCs. We tell the diff --git a/sys/arch/i386/i386/acpi_machdep.c b/sys/arch/i386/i386/acpi_machdep.c index ab8d9fc1083..058141b1bd3 100644 --- a/sys/arch/i386/i386/acpi_machdep.c +++ b/sys/arch/i386/i386/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.8 2007/11/16 02:45:56 deraadt Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.9 2007/11/25 09:11:12 jsg Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -170,6 +170,8 @@ havebase: void acpi_attach_machdep(struct acpi_softc *sc) { + extern void (*cpuresetfn)(void); sc->sc_interrupt = isa_intr_establish(NULL, sc->sc_fadt->sci_int, IST_LEVEL, IPL_TTY, acpi_interrupt, sc, sc->sc_dev.dv_xname); + cpuresetfn = acpi_reset; } |