aboutsummaryrefslogtreecommitdiff
path: root/sys/i386
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2015-05-09 12:28:48 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2015-05-09 12:28:48 +0000
commitb57a73f8e758fddf66180287569506e099f55607 (patch)
tree4fbee808b24332d8ef01cb71eaaf6ca38551cfb9 /sys/i386
parent62699f34242f8d40190553acb1c556d0b9844e96 (diff)
downloadsrc-b57a73f8e758fddf66180287569506e099f55607.tar.gz
src-b57a73f8e758fddf66180287569506e099f55607.zip
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
Notes
Notes: svn path=/head/; revision=282678
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/acpica/acpi_machdep.c7
-rw-r--r--sys/i386/include/md_var.h1
2 files changed, 1 insertions, 7 deletions
diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c
index 049354b0c213..4c79691dbeee 100644
--- a/sys/i386/acpica/acpi_machdep.c
+++ b/sys/i386/acpica/acpi_machdep.c
@@ -106,13 +106,6 @@ acpi_machdep_quirks(int *quirks)
return (0);
}
-void
-acpi_cpu_c1()
-{
-
- __asm __volatile("sti; hlt");
-}
-
/*
* Support for mapping ACPI tables during early boot. This abuses the
* crashdump map because the kernel cannot allocate KVA in
diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h
index bffdd5751d66..b5bd35ef524d 100644
--- a/sys/i386/include/md_var.h
+++ b/sys/i386/include/md_var.h
@@ -97,6 +97,7 @@ struct dumperinfo;
void *alloc_fpusave(int flags);
void bcopyb(const void *from, void *to, size_t len);
void busdma_swi(void);
+bool cpu_mwait_usable(void);
void cpu_probe_amdc1e(void);
void cpu_setregs(void);
void cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs));