summaryrefslogtreecommitdiffstats
path: root/sys/amd64/acpica/acpi_machdep.c
Commit message (Collapse)AuthorAgeFilesLines
* If x86 CPU implementation of the MWAIT instruction reasonablykib2015-05-091-7/+0
| | | | | | | | | | | | | | | | | | | | | | | 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
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-281-3/+2
|
* Revert r267961, r267973:gjb2014-06-271-2/+3
| | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-06-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies
* Consistently use round_page(x) rather than roundup(x, PAGE_SIZE). There isjkim2013-02-151-2/+2
| | | | no functional change.
* Centralize declaration of the debug.acpi sysctl node.jhb2012-05-171-2/+0
|
* sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.mdf2011-01-121-1/+1
| | | | Commit the kernel changes.
* Make APM emulation look more closer to its origin. Use device_get_softc(9)jkim2010-11-101-3/+2
| | | | instead of hardcoding acpi(4) unit number as we have device_t for it.
* Refactor acpi_machdep.c for amd64 and i386, move APM emulation into a newjkim2010-11-101-449/+4
| | | | file acpi_apm.c, and place it on sys/x86/acpica.
* Use the same policy for rejecting / not-reject ACPI tables with incorrectjhb2010-03-191-0/+2
| | | | | | | | | | checksums as the base acpi(4) driver. This fixes a problem where the MADT parser would reject the MADT table during early boot causing the MP Table to be, but then the acpi(4) driver would attach and use non-SMP interrupt routing. Tested by: Alastair Hogge agh of coolrhaug com MFC after: 1 week
* Clean up amd64 suspend/resume code.jkim2009-10-081-3/+10
| | | | | | | | - Allocate memory for wakeup code after ACPI bus is attached. The early memory allocation hack was inherited from i386 but amd64 does not need it. - Exclude real mode IVT and BDA explicitly. Improve comments about memory allocation and reason for the exclusions. It is a no-op in reality, though. - Remove an unnecessary CLD from wakeup code and re-align.
* Copy apm(4) emulation from sys/i386/acpica/acpi_machdep.c andjkim2009-09-271-8/+448
| | | | install apm(8) and apm_bios.h on amd64.
* Extract the code to find and map the MADT ACPI table during early kerneljhb2009-09-231-0/+244
| | | | | | | | | startup and genericize it so it can be reused to map other tables as well: - Add a routine to walk a list of ACPI subtables such as those used in the APIC and SRAT tables in the MI acpi(4) driver. - Move the routines for mapping and unmapping an ACPI table as well as mapping the RSDT or XSDT and searching for a table with a given signature out into acpica_machdep.c for both amd64 and i386.
* Import ACPICA 20090521.jkim2009-06-051-1/+2
|
* - Clean up suspend/resume code for amd64.jkim2009-03-231-3/+4
| | | | | | | | - Call acpi_resync_clock() to reset system time before hardclock is ready to tick. Note we assume the current timecounter hardware and RTC are already available for read operation. Tested by: mav
* Initial suspend/resume support for amd64.jkim2009-03-171-1/+26
| | | | | | This code is heavily inspired by Takanori Watanabe's experimental SMP patch for i386 and large portion was shamelessly cut and pasted from Peter Wemm's AP boot code.
* Rework how the nexus(4) device works on x86 to better handle the idea ofjhb2008-03-131-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | different "platforms" on x86 machines. The existing code already handles having two platforms: ACPI and legacy. However, the existing approach was rather hardcoded and difficult to extend. These changes take the approach that each x86 hardware platform should provide its own nexus(4) driver (it can inherit most of its behavior from the default legacy nexus(4) driver) which is responsible for probing for the platform and performing appropriate platform-specific setup during attach (such as adding a platform-specific bus device). This does mean changing the x86 platform busses to no longer use an identify routine for probing, but to move that logic into their matching nexus(4) driver instead. - Make the default nexus(4) driver in nexus.c on i386 and amd64 handle the legacy platform. It's probe routine now returns BUS_PROBE_GENERIC so it can be overriden. - Expose a nexus_init_resources() routine which initializes the various resource managers so that subclassed nexus(4) drivers can invoke it from their attach routine. - The legacy nexus(4) driver explicitly adds a legacy0 device in its attach routine. - The ACPI driver no longer contains an new-bus identify method. Instead it exposes a public function (acpi_identify()) which is a probe routine that the MD nexus(4) drivers can use to probe for ACPI. All of the probe logic in acpi_probe() is now moved into acpi_identify() and acpi_probe() is just a stub. - On i386 and amd64, an ACPI-specific nexus(4) driver checks for ACPI via acpi_identify() and claims the nexus0 device if the probe succeeds. It then explicitly adds an acpi0 device in its attach routine. - The legacy(4) driver no longer knows anything about the acpi0 device. - On ia64 if acpi_identify() fails you basically end up with no devices. This matches the previous behavior where the old acpi_identify() would fail to add an acpi0 device again leaving you with no devices. Discussed with: imp Silence on: arch@
* Canonize the include of acpi.h.obrien2005-09-111-1/+1
|
* Move the code for halting the CPU (acpi_cpu_c1) into machdep files.njl2004-10-111-0/+6
| | | | | | This removes the last MD portion of acpi_cpu.c. MFC after: 2 weeks
* Sync with i386 - get the softc via the devclass rather than caching the devpeter2004-08-161-2/+1
|
* Add machdep quirks functions. On i386, this disables acpi on systems withnjl2004-06-301-0/+6
| | | | BIOS dates earlier than Jan 1, 1999. Add prototypes and quirks flags.
* Don't check for NULL, device_get_softc() always succeeds.njl2004-04-211-2/+1
|
* MFi386 by jhb: add acpi_SetDefaultIntrModel();peter2003-09-221-0/+12
|
* Minor style cleanups.njl2003-08-281-2/+1
|
* Use __FBSDID().obrien2003-07-251-2/+3
| | | | Brought to you by: a boring talk at OLS
* Commit MD parts of a loosely functional AMD64 port. This is based onpeter2003-05-011-296/+1
| | | | | | | | | | | | | | | | | | | | | | a heavily stripped down FreeBSD/i386 (brutally stripped down actually) to attempt to get a stable base to start from. There is a lot missing still. Worth noting: - The kernel runs at 1GB in order to cheat with the pmap code. pmap uses a variation of the PAE code in order to avoid having to worry about 4 levels of page tables yet. - It boots in 64 bit "long mode" with a tiny trampoline embedded in the i386 loader. This simplifies locore.s greatly. - There are still quite a few fragments of i386-specific code that have not been translated yet, and some that I cheated and wrote dumb C versions of (bcopy etc). - It has both int 0x80 for syscalls (but using registers for argument passing, as is native on the amd64 ABI), and the 'syscall' instruction for syscalls. int 0x80 preserves all registers, 'syscall' does not. - I have tried to minimize looking at the NetBSD code, except in a couple of places (eg: to find which register they use to replace the trashed %rcx register in the syscall instruction). As a result, there is not a lot of similarity. I did look at NetBSD a few times while debugging to get some ideas about what I might have done wrong in my first attempt.
* Use repo-copied files in sys/i386/bios.mdodd2003-03-241-1/+1
|
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+7
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* *sigh*. It seems that in the ACPICA code, Intel defines its own APIC_IOjhb2002-11-211-1/+1
| | | | | | | | | | macro for use when parsing MADT tables, thus we always tried to set the interrupt model to APIC. This proved to be harmful on UP machines with IO APIC's (or for UP kernels on SMP machines) since the wrong interrupt routing information would be returned. Pointy hat to: jhb Approved by: re (rwatson)
* Include <sys/select.h> on -stable instead of <sys/selinfo.h> to get thejhb2002-10-161-0/+4
| | | | | | definition of struct selinfo. Sponsored by: The Weather Channel
* Use d_thread_t for cdevsw functions instead of struct thread * so that itjhb2002-10-091-4/+4
| | | | is easier to share this code with 4-stable.
* Trash the PnPBIOStable pointer later on when we know that the acpi probejhb2002-09-301-0/+6
| | | | | | and attach routines have succeeded so that if they fail we can still use the PnP BIOS to find ISA on-board devices. The fact that we do this here is gross but fixing it properly involves a lot more work.
* If we are using APIC_IO tell ACPI so it can route interrupts properly.jhb2002-09-061-0/+3
| | | | | This still doesn't work quite right because of other APIC_IO hacks in the i386 PCI code.
* Add APM compatibility feature to ACPI.iwasaki2001-10-261-0/+335
This emulates APM device node interface APIs (mainly ioctl) and provides APM services for the applications. The goal is to support most of APM applications without any changes. Implemented ioctls in this commit are: - APMIO_SUSPEND (mapped ACPI S3 as default but changable by sysctl) - APMIO_STANDBY (mapped ACPI S1 as default but changable by sysctl) - APMIO_GETINFO and APMIO_GETINFO_OLD - APMIO_GETPWSTATUS With above, many APM applications which get batteries, ac-line info. and transition the system into suspend/standby mode (such as wmapm, xbatt) should work with ACPI enabled kernel (if ACPI works well :-) Reviewed by: arch@, audit@ and some guys
OpenPOWER on IntegriCloud