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>
41 #include <sys/smp.h>
61 #ifdef SMP
62 #include <machine/smp.h>
74 CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024);
80 #ifdef SMP
89 #ifdef SMP
96 #define WAKECODE_FIXUP(offset, type, val) do { \
98 addr = (type *)(sc->acpi_wakeaddr + (offset)); \
110 #ifdef SMP
115 int vector = (sc->acpi_wakephys >> 12) & 0xff;
119 pcb = &susppcbs[cpu]->sp_pcb;
121 WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit);
122 WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base);
151 /* save the current value of the warm-start vector */
158 *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4;
160 outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */
196 if (sc->acpi_wakeaddr == 0ul)
197 return (-1); /* couldn't alloc wake memory */
199 #ifdef SMP
207 AcpiSetFirmwareWakingVector(sc->acpi_wakephys, 0);
211 pcb = &susppcbs[0]->sp_pcb;
213 npxsuspend(susppcbs[0]->sp_fpususpend);
214 #ifdef SMP
216 device_printf(sc->acpi_dev, "Failed to suspend APs\n");
226 WAKECODE_FIXUP(wakeup_cr4, register_t, pcb->pcb_cr4);
228 WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit);
229 WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base);
243 if (state == ACPI_STATE_S4 && sc->acpi_s4bios)
248 device_printf(sc->acpi_dev,
249 "AcpiEnterSleepState failed - %s\n",
261 * Re-initialize console hardware as soon as possibe.
266 npxresume(susppcbs[0]->sp_fpususpend);
277 if (sleep_result == -1)
291 #ifdef SMP
297 #ifdef SMP
308 mem_range_softc.mr_op->reinit != NULL)
309 mem_range_softc.mr_op->reinit(&mem_range_softc);
324 * region, excluding real mode IVT (0-0x3ff), BDA (0x400-0x4ff), EBDA
327 * page-aligned.
345 susppcbs[i]->sp_fpususpend = alloc_fpusave(M_WAITOK);
369 sc->acpi_wakeaddr = (vm_offset_t)wakeaddr;
370 sc->acpi_wakephys = vtophys(wakeaddr);
372 bcopy(wakecode, (void *)sc->acpi_wakeaddr, sizeof(wakecode));
376 sc->acpi_wakephys + bootgdt);
378 sc->acpi_wakephys + wakeup_32);
385 device_printf(sc->acpi_dev, "wakeup code va %#jx pa %#jx\n",
386 (uintmax_t)sc->acpi_wakeaddr, (uintmax_t)sc->acpi_wakephys);