diff options
author | Paul Irofti <pirofti@cvs.openbsd.org> | 2009-11-23 16:21:55 +0000 |
---|---|---|
committer | Paul Irofti <pirofti@cvs.openbsd.org> | 2009-11-23 16:21:55 +0000 |
commit | ecb04f492b9be2bc502a476317e1bb7eead1a01e (patch) | |
tree | 855d514d3722afb3b72f4f2afa3bac0beaff2416 | |
parent | f25c0075c80ece366422bade164e10046df5f931 (diff) |
Remove ACPI_SLEEP_ENABLED checks.
This enables by default the suspend/resume paths in the kernel.
Okay deraadt@.
-rw-r--r-- | sys/arch/amd64/amd64/acpi_machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 12 | ||||
-rw-r--r-- | sys/arch/i386/i386/acpi_machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 6 | ||||
-rw-r--r-- | sys/dev/acpi/acpi.c | 8 | ||||
-rw-r--r-- | sys/dev/acpi/acpibtn.c | 6 | ||||
-rw-r--r-- | sys/dev/acpi/acpivar.h | 4 |
7 files changed, 17 insertions, 31 deletions
diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c index cebccb1b3e3..3ec76aebf79 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.24 2009/11/22 22:00:25 pirofti Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.25 2009/11/23 16:21:54 pirofti Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -171,7 +171,6 @@ acpi_attach_machdep(struct acpi_softc *sc) IST_LEVEL, IPL_TTY, acpi_interrupt, sc, sc->sc_dev.dv_xname); cpuresetfn = acpi_reset; -#ifdef ACPI_SLEEP_ENABLED /* * Sanity check before setting up trampoline. * Ensure the trampoline size is < PAGE_SIZE @@ -182,7 +181,6 @@ acpi_attach_machdep(struct acpi_softc *sc) acpi_resume_end - acpi_real_mode_resume); acpi_pdirpa = tramp_pdirpa; -#endif /* ACPI_SLEEP_ENABLED */ } void @@ -198,7 +196,6 @@ acpi_cpu_flush(struct acpi_softc *sc, int state) int acpi_sleep_machdep(struct acpi_softc *sc, int state) { -#ifdef ACPI_SLEEP_ENABLED if (sc->sc_facs == NULL) { printf("%s: acpi_sleep_machdep: no FACS\n", DEVNAME(sc)); return (ENXIO); @@ -258,7 +255,6 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) #endif initrtclock(); inittodr(time_second); -#endif /* ACPI_SLEEP_ENABLED */ return (0); } diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index d747347d756..8da63781347 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.101 2009/08/11 19:17:16 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.102 2009/11/23 16:21:54 pirofti Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -1142,7 +1142,7 @@ cpu_init_extents(void) } #if defined(MULTIPROCESSOR) || \ - (NACPI > 0 && defined(ACPI_SLEEP_ENABLED) && !defined(SMALL_KERNEL)) + (NACPI > 0 && !defined(SMALL_KERNEL)) void map_tramps(void) { struct pmap *kmp = pmap_kernel(); @@ -1167,11 +1167,9 @@ map_tramps(void) { #endif /* MULTIPROCESSOR */ -#ifdef ACPI_SLEEP_ENABLED pmap_kenter_pa((vaddr_t)ACPI_TRAMPOLINE, /* virtual */ (paddr_t)ACPI_TRAMPOLINE, /* physical */ VM_PROT_ALL); /* protection */ -#endif /* ACPI_SLEEP_ENABLED */ } #endif @@ -1266,10 +1264,10 @@ init_x86_64(paddr_t first_avail) avail_start = MP_TRAMPOLINE + PAGE_SIZE; #endif -#ifdef ACPI_SLEEP_ENABLED +#ifndef SMALL_KERNEL if (avail_start < ACPI_TRAMPOLINE + PAGE_SIZE) avail_start = ACPI_TRAMPOLINE + PAGE_SIZE; -#endif /* ACPI_SLEEP_ENABLED */ +#endif /* !SMALL_KERNEL */ /* Let us know if we're supporting > 4GB ram load */ if (bigmem) @@ -1463,7 +1461,7 @@ init_x86_64(paddr_t first_avail) VM_PROT_READ|VM_PROT_WRITE); #if defined(MULTIPROCESSOR) || \ - (NACPI > 0 && defined(ACPI_SLEEP_ENABLED) && !defined(SMALL_KERNEL)) + (NACPI > 0 && !defined(SMALL_KERNEL)) map_tramps(); #endif diff --git a/sys/arch/i386/i386/acpi_machdep.c b/sys/arch/i386/i386/acpi_machdep.c index c50210dc896..1e782f359a4 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.23 2009/08/13 15:33:20 kettenis Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.24 2009/11/23 16:21:54 pirofti Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -191,7 +191,6 @@ acpi_attach_machdep(struct acpi_softc *sc) acpiapm_kqfilter = acpikqfilter; cpuresetfn = acpi_reset; -#ifdef ACPI_SLEEP_ENABLED /* * Sanity check before setting up trampoline. * Ensure the trampoline size is < PAGE_SIZE @@ -200,7 +199,6 @@ acpi_attach_machdep(struct acpi_softc *sc) bcopy(acpi_real_mode_resume, (caddr_t)ACPI_TRAMPOLINE, acpi_resume_end - acpi_real_mode_resume); -#endif /* ACPI_SLEEP_ENABLED */ } void @@ -216,7 +214,6 @@ acpi_cpu_flush(struct acpi_softc *sc, int state) int acpi_sleep_machdep(struct acpi_softc *sc, int state) { -#ifdef ACPI_SLEEP_ENABLED if (sc->sc_facs == NULL) { printf("%s: acpi_sleep_machdep: no FACS\n", DEVNAME(sc)); return (ENXIO); @@ -278,7 +275,6 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) #endif initrtclock(); inittodr(time_second); -#endif /* ACPI_SLEEP_ENABLED */ return (0); } diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 2b7d97121c1..c67b1513fb3 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.464 2009/11/18 18:16:46 jsg Exp $ */ +/* $OpenBSD: machdep.c,v 1.465 2009/11/23 16:21:54 pirofti Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -3097,7 +3097,7 @@ init386(paddr_t first_avail) #endif #if defined(MULTIPROCESSOR) || \ - (NACPI > 0 && defined(ACPI_SLEEP_ENABLED) && !defined(SMALL_KERNEL)) + (NACPI > 0 && !defined(SMALL_KERNEL)) /* install the lowmem ptp after boot args for 1:1 mappings */ pmap_prealloc_lowmem_ptp(PTP0_PA); #endif @@ -3108,7 +3108,7 @@ init386(paddr_t first_avail) VM_PROT_ALL); /* protection */ #endif -#if NACPI > 0 && defined(ACPI_SLEEP_ENABLED) && !defined(SMALL_KERNEL) +#if NACPI > 0 && !defined(SMALL_KERNEL) pmap_kenter_pa((vaddr_t)ACPI_TRAMPOLINE,/* virtual */ (paddr_t)ACPI_TRAMPOLINE, /* physical */ VM_PROT_ALL); /* protection */ diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index c0b16cc0522..89f12fef1c3 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.145 2009/11/23 15:18:05 deraadt Exp $ */ +/* $OpenBSD: acpi.c,v 1.146 2009/11/23 16:21:54 pirofti Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -954,7 +954,6 @@ acpiioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) ACPI_LOCK(sc); /* fake APM */ switch (cmd) { -#ifdef ACPI_SLEEP_ENABLED case APM_IOC_STANDBY_REQ: case APM_IOC_SUSPEND_REQ: case APM_IOC_SUSPEND: @@ -962,7 +961,6 @@ acpiioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) workq_add_task(NULL, 0, (workq_fn)acpi_sleep_state, acpi_softc, (void *)ACPI_STATE_S3); break; -#endif /* ACPI_SLEEP_ENABLED */ case APM_IOC_GETPOWER: /* A/C */ pi->ac_state = APM_AC_UNKNOWN; @@ -1841,10 +1839,10 @@ acpi_sleep_state(struct acpi_softc *sc, int state) else ret = acpi_enter_sleep_state(sc, state); -#ifdef ACPI_SLEEP_ENABLED +#ifndef SMALL_KERNEL if (state == ACPI_STATE_S3) acpi_resume(sc, state); -#endif /* ACPI_SLEEP_ENABLED */ +#endif /* !SMALL_KERNEL */ return (ret); } diff --git a/sys/dev/acpi/acpibtn.c b/sys/dev/acpi/acpibtn.c index 9c25a575026..485b875500a 100644 --- a/sys/dev/acpi/acpibtn.c +++ b/sys/dev/acpi/acpibtn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpibtn.c,v 1.21 2009/02/19 21:02:05 marco Exp $ */ +/* $OpenBSD: acpibtn.c,v 1.22 2009/11/23 16:21:54 pirofti Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * @@ -122,9 +122,9 @@ acpibtn_notify(struct aml_node *node, int notify_type, void *arg) switch (sc->sc_btn_type) { case ACPIBTN_LID: case ACPIBTN_SLEEP: -#ifdef ACPI_SLEEP_ENABLED +#ifndef SMALL_KERNEL acpi_sleep_state(sc->sc_acpi, ACPI_STATE_S3); -#endif /* ACPI_SLEEP_ENABLED */ +#endif /* SMALL_KERNEL */ break; case ACPIBTN_POWER: if (notify_type == 0x80) diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h index 3528e233cb5..83fe5991adc 100644 --- a/sys/dev/acpi/acpivar.h +++ b/sys/dev/acpi/acpivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpivar.h,v 1.53 2009/11/23 15:08:02 mlarkin Exp $ */ +/* $OpenBSD: acpivar.h,v 1.54 2009/11/23 16:21:54 pirofti Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -36,8 +36,6 @@ extern int acpi_debug; #define dnprintf(n,x...) #endif -/* #define ACPI_SLEEP_ENABLED */ - extern int acpi_hasprocfvs; #define LAPIC_MAP_SIZE 256 |