Lines Matching +full:smp +full:- +full:offset
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
5 * Copyright (c) 2001-2012 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
7 * Copyright (c) 2008-2012 Jung-uk Kim <jkim@FreeBSD.org>
38 #include <sys/smp.h>
57 #ifdef SMP
58 #include <machine/smp.h>
70 CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024);
76 #ifdef SMP
85 #ifdef SMP
92 #define WAKECODE_FIXUP(offset, type, val) do { \ argument
94 addr = (type *)(sc->acpi_wakeaddr + (offset)); \
106 #ifdef SMP
111 int vector = (sc->acpi_wakephys >> 12) & 0xff; in acpi_wakeup_ap()
115 pcb = &susppcbs[cpu]->sp_pcb; in acpi_wakeup_ap()
117 WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); in acpi_wakeup_ap()
118 WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); in acpi_wakeup_ap()
148 /* save the current value of the warm-start vector */ in acpi_wakeup_cpus()
155 *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4; in acpi_wakeup_cpus()
157 outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ in acpi_wakeup_cpus()
190 if (sc->acpi_wakeaddr == 0ul) in acpi_sleep_machdep()
191 return (-1); /* couldn't alloc wake memory */ in acpi_sleep_machdep()
193 #ifdef SMP in acpi_sleep_machdep()
201 AcpiSetFirmwareWakingVector(sc->acpi_wakephys, 0); in acpi_sleep_machdep()
208 pcb = &susppcbs[0]->sp_pcb; in acpi_sleep_machdep()
210 fpususpend(susppcbs[0]->sp_fpususpend); in acpi_sleep_machdep()
211 #ifdef SMP in acpi_sleep_machdep()
213 device_printf(sc->acpi_dev, "Failed to suspend APs\n"); in acpi_sleep_machdep()
222 pc->pc_ibpb_set = 0; in acpi_sleep_machdep()
231 WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); in acpi_sleep_machdep()
232 WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); in acpi_sleep_machdep()
235 if (state == ACPI_STATE_S4 && sc->acpi_s4bios) in acpi_sleep_machdep()
240 device_printf(sc->acpi_dev, in acpi_sleep_machdep()
241 "AcpiEnterSleepState failed - %s\n", in acpi_sleep_machdep()
253 * Re-initialize console hardware as soon as possible. in acpi_sleep_machdep()
258 fpuresume(susppcbs[0]->sp_fpususpend); in acpi_sleep_machdep()
269 if (sleep_result == -1) in acpi_wakeup_machdep()
281 #ifdef SMP in acpi_wakeup_machdep()
287 #ifdef SMP in acpi_wakeup_machdep()
293 * Re-read cpu_stdext_feature3, which was zeroed-out in acpi_wakeup_machdep()
317 mem_range_softc.mr_op->reinit != NULL) in acpi_wakeup_machdep()
318 mem_range_softc.mr_op->reinit(&mem_range_softc); in acpi_wakeup_machdep()
337 * low 1 MB region, excluding real mode IVT (0-0x3ff), BDA in acpi_alloc_wakeup_handler()
338 * (0x400-0x4ff), EBDA (less than 128KB, below 0xa0000, must in acpi_alloc_wakeup_handler()
349 for (i = 0; i < ACPI_WAKEPT_PAGES - (la57 ? 0 : 1); i++) { in acpi_alloc_wakeup_handler()
362 susppcbs[i]->sp_fpususpend = alloc_fpusave(M_WAITOK); in acpi_alloc_wakeup_handler()
390 sc->acpi_wakeaddr = (vm_offset_t)wakeaddr; in acpi_install_wakeup_handler()
391 sc->acpi_wakephys = vtophys(wakeaddr); in acpi_install_wakeup_handler()
410 bcopy(wakecode, (void *)sc->acpi_wakeaddr, sizeof(wakecode)); in acpi_install_wakeup_handler()
414 sc->acpi_wakephys + bootgdt); in acpi_install_wakeup_handler()
416 sc->acpi_wakephys + wakeup_32); in acpi_install_wakeup_handler()
418 sc->acpi_wakephys + wakeup_64); in acpi_install_wakeup_handler()
426 bcopy(kernel_pmap->pm_pmltop, pt5, PAGE_SIZE); in acpi_install_wakeup_handler()
430 bcopy(kernel_pmap->pm_pmltop, pt4, PAGE_SIZE); in acpi_install_wakeup_handler()
463 device_printf(sc->acpi_dev, "wakeup code va %#jx pa %#jx\n", in acpi_install_wakeup_handler()
464 (uintmax_t)sc->acpi_wakeaddr, (uintmax_t)sc->acpi_wakephys); in acpi_install_wakeup_handler()