summaryrefslogtreecommitdiffstats
path: root/sys/amd64/acpica
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2009-04-02 00:23:56 +0000
committerjkim <jkim@FreeBSD.org>2009-04-02 00:23:56 +0000
commit22270c1fb939b1c07fdff1f7e8f1f33d25e86df4 (patch)
tree5564516b9d2952f10d39e54744ea45800d0c3a5b /sys/amd64/acpica
parent84cd3385a22ae2ee3c14d0df12f4b640673401e0 (diff)
downloadFreeBSD-src-22270c1fb939b1c07fdff1f7e8f1f33d25e86df4.zip
FreeBSD-src-22270c1fb939b1c07fdff1f7e8f1f33d25e86df4.tar.gz
Chase GDT layout changes and unbreak suspend/resume on amd64.
Diffstat (limited to 'sys/amd64/acpica')
-rw-r--r--sys/amd64/acpica/acpi_switch.S10
-rw-r--r--sys/amd64/acpica/acpi_wakecode.S8
-rw-r--r--sys/amd64/acpica/acpi_wakeup.c18
3 files changed, 18 insertions, 18 deletions
diff --git a/sys/amd64/acpica/acpi_switch.S b/sys/amd64/acpica/acpi_switch.S
index 0b26292..2274c85 100644
--- a/sys/amd64/acpica/acpi_switch.S
+++ b/sys/amd64/acpica/acpi_switch.S
@@ -128,9 +128,19 @@ ENTRY(acpi_restorecpu)
/* Restore descriptor tables. */
lidt WAKEUP_XPCB(IDT)
lldt WAKEUP_XPCB(LDT)
+
+#define SDT_SYSTSS 9
+#define SDT_SYSBSY 11
+
+ /* Reset task busy bit and reload TR. */
+ movq PCPU(TSS), %rax
+ andb $(~SDT_SYSBSY | SDT_SYSTSS), 5(%rax)
movw WAKEUP_XPCB(TR), %ax
ltr %ax
+#undef SDT_SYSTSS
+#undef SDT_SYSBSY
+
/* Restore other callee saved registers. */
movq WAKEUP_PCB(R15), %r15
movq WAKEUP_PCB(R14), %r14
diff --git a/sys/amd64/acpica/acpi_wakecode.S b/sys/amd64/acpica/acpi_wakecode.S
index 4165ec6..4e82f53 100644
--- a/sys/amd64/acpica/acpi_wakecode.S
+++ b/sys/amd64/acpica/acpi_wakecode.S
@@ -223,6 +223,12 @@ reset_video:
bootgdt:
.long 0x00000000
.long 0x00000000
+ .long 0x00000000
+ .long 0x00000000
+ .long 0x00000000
+ .long 0x00000000
+ .long 0x00000000
+ .long 0x00000000
bootcode64:
.long 0x0000ffff
@@ -261,6 +267,8 @@ wakeup_xpcb:
wakeup_gdt:
.word 0
.quad 0
+
+ ALIGN_DATA
wakeup_efer:
.quad 0
wakeup_pat:
diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c
index 02432f0..2f9d8a0 100644
--- a/sys/amd64/acpica/acpi_wakeup.c
+++ b/sys/amd64/acpica/acpi_wakeup.c
@@ -78,7 +78,6 @@ static struct xpcb *stopxpcbs;
int acpi_restorecpu(struct xpcb *, vm_offset_t);
int acpi_savecpu(struct xpcb *);
-static void acpi_reset_tss(int cpu);
static void acpi_alloc_wakeup_handler(void);
static void acpi_stop_beep(void *);
@@ -116,8 +115,6 @@ acpi_wakeup_ap(struct acpi_softc *sc, int cpu)
stopxpcbs[cpu].xpcb_gdt.rd_base);
WAKECODE_FIXUP(wakeup_cpu, int, cpu);
- acpi_reset_tss(cpu);
-
/* do an INIT IPI: assert RESET */
lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE |
APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, apic_id);
@@ -220,19 +217,6 @@ acpi_wakeup_cpus(struct acpi_softc *sc, cpumask_t wakeup_cpus)
}
#endif
-static void
-acpi_reset_tss(int cpu)
-{
- uint32_t *tss;
-
- /*
- * We have to clear "task busy" bit in TSS to restore
- * task register later. Otherwise, ltr causes GPF.
- */
- tss = (uint32_t *)&gdt[NGDT * cpu + GPROC0_SEL] + 1;
- *tss &= ~((SDT_SYSBSY ^ SDT_SYSTSS) << 8);
-}
-
int
acpi_sleep_machdep(struct acpi_softc *sc, int state)
{
@@ -289,8 +273,6 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
stopxpcbs[0].xpcb_gdt.rd_base);
WAKECODE_FIXUP(wakeup_cpu, int, 0);
- acpi_reset_tss(0);
-
/* Call ACPICA to enter the desired sleep state */
if (state == ACPI_STATE_S4 && sc->acpi_s4bios)
status = AcpiEnterSleepStateS4bios();
OpenPOWER on IntegriCloud