summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-05-09 12:28:48 +0000
committerkib <kib@FreeBSD.org>2015-05-09 12:28:48 +0000
commit6006bf3a7dfd2f9b0bf0be6700967a1ab993b8a0 (patch)
tree4fbee808b24332d8ef01cb71eaaf6ca38551cfb9 /sys/amd64
parent4f7fc385cadf246ec334db975b16c0e1743e87da (diff)
downloadFreeBSD-src-6006bf3a7dfd2f9b0bf0be6700967a1ab993b8a0.zip
FreeBSD-src-6006bf3a7dfd2f9b0bf0be6700967a1ab993b8a0.tar.gz
If x86 CPU implementation of the MWAIT instruction reasonably
interacts with interrupts, query ACPI and use MWAIT for entrance into Cx sleep states. Support C1 "I/O then halt" mode. See Intel' document 302223-007 "Intelб╝ Processor Vendor-Specific ACPI Interface Specification" for description. Move the acpi_cpu_c1() function into x86/cpu_machdep.c and use it instead of inlining "sti; hlt" sequence in several places. In the acpi(4) man page, besides documenting the dev.cpu.N.cx_methods sysctl, correct the names for dev.cpu.N.{cx_usage,cx_lowest,cx_supported} sysctls. Both jkim and avg have some other patches implementing the mwait functionality; this work is unrelated. Linux does not rely on the ACPI to provide correct tables describing Cx modes. Instead, the driver has pre-defined knowledge of the CPU models, it was supplied by Intel. Tested by: pho (previous versions) Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/acpica/acpi_machdep.c7
-rw-r--r--sys/amd64/include/md_var.h1
2 files changed, 1 insertions, 7 deletions
diff --git a/sys/amd64/acpica/acpi_machdep.c b/sys/amd64/acpica/acpi_machdep.c
index 049b51bb4e..8f88a00 100644
--- a/sys/amd64/acpica/acpi_machdep.c
+++ b/sys/amd64/acpica/acpi_machdep.c
@@ -87,13 +87,6 @@ acpi_machdep_quirks(int *quirks)
return (0);
}
-void
-acpi_cpu_c1()
-{
-
- __asm __volatile("sti; hlt");
-}
-
/*
* Support for mapping ACPI tables during early boot. Currently this
* uses the crashdump map to map each table. However, the crashdump
diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h
index 9083421..0813e5f 100644
--- a/sys/amd64/include/md_var.h
+++ b/sys/amd64/include/md_var.h
@@ -91,6 +91,7 @@ struct dumperinfo;
void *alloc_fpusave(int flags);
void amd64_syscall(struct thread *td, int traced);
void busdma_swi(void);
+bool cpu_mwait_usable(void);
void cpu_probe_amdc1e(void);
void cpu_setregs(void);
void doreti_iret(void) __asm(__STRING(doreti_iret));
OpenPOWER on IntegriCloud