Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/acpica/acpi_wakeup.c
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | |||||
#ifdef __i386__ | #ifdef __i386__ | ||||
/* | /* | ||||
* Remove the identity mapping of low memory for all CPUs and sync | * Remove the identity mapping of low memory for all CPUs and sync | ||||
* the TLB for the BSP. The APs are now spinning in | * the TLB for the BSP. The APs are now spinning in | ||||
* cpususpend_handler() and we will release them soon. Then each | * cpususpend_handler() and we will release them soon. Then each | ||||
* will invalidate its TLB. | * will invalidate its TLB. | ||||
*/ | */ | ||||
kernel_pmap->pm_pdir[0] = 0; | PTD[KPTDI] = 0; | ||||
invltlb_glob(); | invltlb_glob(); | ||||
#endif | #endif | ||||
/* restore the warmstart vector */ | /* restore the warmstart vector */ | ||||
*(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; | *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; | ||||
outb(CMOS_REG, BIOS_RESET); | outb(CMOS_REG, BIOS_RESET); | ||||
outb(CMOS_DATA, mpbiosreason); | outb(CMOS_DATA, mpbiosreason); | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | #ifdef __i386__ | ||||
* Map some low memory with virt == phys for ACPI wakecode | * Map some low memory with virt == phys for ACPI wakecode | ||||
* to use to jump to high memory after enabling paging. This | * to use to jump to high memory after enabling paging. This | ||||
* is the same as for similar jump in locore, except the | * is the same as for similar jump in locore, except the | ||||
* jump is a single instruction, and we know its address | * jump is a single instruction, and we know its address | ||||
* more precisely so only need a single PTD, and we have to | * more precisely so only need a single PTD, and we have to | ||||
* be careful to use the kernel map (PTD[0] is for curthread | * be careful to use the kernel map (PTD[0] is for curthread | ||||
* which may be a user thread in deprecated APIs). | * which may be a user thread in deprecated APIs). | ||||
*/ | */ | ||||
kernel_pmap->pm_pdir[0] = PTD[KPTDI]; | PTD[KPTDI] = PTD[LOWPTDI]; | ||||
#endif | #endif | ||||
/* Call ACPICA to enter the desired sleep state */ | /* Call ACPICA to enter the desired sleep state */ | ||||
if (state == ACPI_STATE_S4 && sc->acpi_s4bios) | if (state == ACPI_STATE_S4 && sc->acpi_s4bios) | ||||
status = AcpiEnterSleepStateS4bios(); | status = AcpiEnterSleepStateS4bios(); | ||||
else | else | ||||
status = AcpiEnterSleepState(state); | status = AcpiEnterSleepState(state); | ||||
if (ACPI_FAILURE(status)) { | if (ACPI_FAILURE(status)) { | ||||
▲ Show 20 Lines • Show All 186 Lines • Show Last 20 Lines |