summaryrefslogtreecommitdiffstats
path: root/sys/i386/acpica
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-08-05 06:29:12 +0000
committernjl <njl@FreeBSD.org>2004-08-05 06:29:12 +0000
commit708c9dab9fb4dbff2b9b609703d7160fcfc38d25 (patch)
tree2c7a19f31979ff1225b73116a910058d2a45879c /sys/i386/acpica
parentcd532d497e6014f748d96fb760671ebe7845db63 (diff)
downloadFreeBSD-src-708c9dab9fb4dbff2b9b609703d7160fcfc38d25.zip
FreeBSD-src-708c9dab9fb4dbff2b9b609703d7160fcfc38d25.tar.gz
Remove the attempt to cache the previous page mapped at our identity
location (for the wake code). It should not be needed since we don't map other pages at the same location and if there was an old mapping, it would be restored by a fault. The old code had serious problems, namely that it was restoring the new page it had just removed (not opage) and it could only guess at the right protection (since there's no pmap_extract_protect function). Thanks to Alan Cox for explaining much of this to me. Also, remove a commented-out initializecpu() call since it is not needed. Restoring the cpu context is better than attempting to init from scratch. Reviewed by: alc (earlier version)
Diffstat (limited to 'sys/i386/acpica')
-rw-r--r--sys/i386/acpica/acpi_wakeup.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/sys/i386/acpica/acpi_wakeup.c b/sys/i386/acpica/acpi_wakeup.c
index 10be052..4a2e64f 100644
--- a/sys/i386/acpica/acpi_wakeup.c
+++ b/sys/i386/acpica/acpi_wakeup.c
@@ -175,15 +175,14 @@ int
acpi_sleep_machdep(struct acpi_softc *sc, int state)
{
ACPI_STATUS status;
- vm_paddr_t oldphys;
struct pmap *pm;
vm_page_t page;
- static vm_page_t opage = NULL;
- int ret = 0;
+ int ret;
uint32_t cr3;
u_long ef;
struct proc *p;
+ ret = 0;
if (sc->acpi_wakeaddr == 0)
return (0);
@@ -203,9 +202,6 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
load_cr3(vtophys(pm->pm_pdir));
#endif
- oldphys = pmap_extract(pm, sc->acpi_wakephys);
- if (oldphys)
- opage = PHYS_TO_VM_PAGE(oldphys);
page = PHYS_TO_VM_PAGE(sc->acpi_wakephys);
pmap_enter(pm, sc->acpi_wakephys, page,
VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE, 1);
@@ -261,9 +257,6 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
for (;;) ;
} else {
/* Execute Wakeup */
-#if 0
- initializecpu();
-#endif
intr_resume();
if (bootverbose) {
@@ -274,13 +267,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
out:
pmap_remove(pm, sc->acpi_wakephys, sc->acpi_wakephys + PAGE_SIZE);
- if (opage) {
- pmap_enter(pm, sc->acpi_wakephys, page,
- VM_PROT_READ | VM_PROT_WRITE, 0);
- }
-
load_cr3(cr3);
-
write_eflags(ef);
return (ret);
OpenPOWER on IntegriCloud