Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/acpica/acpi_wakeup.c
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
acpi_wakeup_cpus(struct acpi_softc *sc) | acpi_wakeup_cpus(struct acpi_softc *sc) | ||||
{ | { | ||||
uint32_t mpbioswarmvec; | uint32_t mpbioswarmvec; | ||||
int cpu; | int cpu; | ||||
u_char mpbiosreason; | u_char mpbiosreason; | ||||
if (!efi_boot) { | if (firmware_type != FW_UEFI) { | ||||
/* save the current value of the warm-start vector */ | /* save the current value of the warm-start vector */ | ||||
mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); | mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); | ||||
outb(CMOS_REG, BIOS_RESET); | outb(CMOS_REG, BIOS_RESET); | ||||
mpbiosreason = inb(CMOS_DATA); | mpbiosreason = inb(CMOS_DATA); | ||||
/* setup a vector to our boot code */ | /* setup a vector to our boot code */ | ||||
*((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; | *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; | ||||
*((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4; | *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4; | ||||
outb(CMOS_REG, BIOS_RESET); | outb(CMOS_REG, BIOS_RESET); | ||||
outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ | outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ | ||||
} | } | ||||
/* Wake up each AP. */ | /* Wake up each AP. */ | ||||
for (cpu = 1; cpu < mp_ncpus; cpu++) { | for (cpu = 1; cpu < mp_ncpus; cpu++) { | ||||
if (!CPU_ISSET(cpu, &suspcpus)) | if (!CPU_ISSET(cpu, &suspcpus)) | ||||
continue; | continue; | ||||
if (acpi_wakeup_ap(sc, cpu) == 0) { | if (acpi_wakeup_ap(sc, cpu) == 0) { | ||||
/* restore the warmstart vector */ | /* restore the warmstart vector */ | ||||
*(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; | *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; | ||||
panic("acpi_wakeup: failed to resume AP #%d (PHY #%d)", | panic("acpi_wakeup: failed to resume AP #%d (PHY #%d)", | ||||
cpu, cpu_apic_ids[cpu]); | cpu, cpu_apic_ids[cpu]); | ||||
} | } | ||||
} | } | ||||
if (!efi_boot) { | if (firmware_type != FW_UEFI) { | ||||
/* 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); | ||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 266 Lines • Show Last 20 Lines |