aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/acpica/acpi_machdep.c
Commit message (Collapse)AuthorAgeFilesLines
* amd64: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365067
* Use pmap_mapbios() to map ACPI tables on amd64 and i386.Mark Johnston2020-08-201-92/+19
| | | | | | | | | | | | | | | | | | | The ACPI table-mapping code used pmap_kenter_temporary() to create mappings, which in turn uses the fixed-size crashdump map. Moreover, the code was not verifying that the table fits in this map, so when mapping large tables we could clobber adjacent mappings. This use of pmap_kenter_temporary() appears to predate support in pmap_mapbios() for creating early mappings, but that restriction no longer applies. PR: 248746 Reviewed by: kib, mav Tested by: gallatin, Curtis Villamizar <curtis@ipv6.occnc.com> MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26125 Notes: svn path=/head/; revision=364411
* Remove some noisy ACPI tables messages from verbose dmesg.Alexander Motin2020-08-191-9/+1
| | | | | | | | | | | | Those messages were printed hundreds of times during boot, often multiple times for each table. We already print information about the tables in more organized form once to not duplicate it when random ACPI drivers are attaching. MFC after: 1 week Notes: svn path=/head/; revision=364399
* Merge ACPICA 20190329.Jung-uk Kim2019-03-291-2/+2
| | | | Notes: svn path=/head/; revision=345713
* Partially revert r197863 to reduce diff against i386.Jung-uk Kim2018-02-241-9/+3
| | | | | | | | | | | | | | | | When I wrote the patch, I wanted to remove SYSINIT() usage from amd64 code. There is no reason to keep the divergence any more because iwasaki merged most amd64 suspend/resume code to i386 with r235622. Note this also fixed an enge case reported by royger. [1] Suggested by: jhb Reviewed by: royger Tested by: royger [1] MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14400 [1] Notes: svn path=/head/; revision=329889
* sys/amd64: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326257
* If x86 CPU implementation of the MWAIT instruction reasonablyKonstantin Belousov2015-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 Notes: svn path=/head/; revision=282678
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-3/+2
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-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 Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-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 Notes: svn path=/head/; revision=267961
* Consistently use round_page(x) rather than roundup(x, PAGE_SIZE). There isJung-uk Kim2013-02-151-2/+2
| | | | | | | no functional change. Notes: svn path=/head/; revision=246855
* Centralize declaration of the debug.acpi sysctl node.John Baldwin2012-05-171-2/+0
| | | | Notes: svn path=/head/; revision=235556
* sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.Matthew D Fleming2011-01-121-1/+1
| | | | | | | Commit the kernel changes. Notes: svn path=/head/; revision=217326
* Make APM emulation look more closer to its origin. Use device_get_softc(9)Jung-uk Kim2010-11-101-3/+2
| | | | | | | instead of hardcoding acpi(4) unit number as we have device_t for it. Notes: svn path=/head/; revision=215097
* Refactor acpi_machdep.c for amd64 and i386, move APM emulation into a newJung-uk Kim2010-11-101-449/+4
| | | | | | | file acpi_apm.c, and place it on sys/x86/acpica. Notes: svn path=/head/; revision=215072
* Use the same policy for rejecting / not-reject ACPI tables with incorrectJohn Baldwin2010-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 Notes: svn path=/head/; revision=205332
* Clean up amd64 suspend/resume code.Jung-uk Kim2009-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. Notes: svn path=/head/; revision=197863
* Copy apm(4) emulation from sys/i386/acpica/acpi_machdep.c andJung-uk Kim2009-09-271-8/+448
| | | | | | | install apm(8) and apm_bios.h on amd64. Notes: svn path=/head/; revision=197536
* Extract the code to find and map the MADT ACPI table during early kernelJohn Baldwin2009-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. Notes: svn path=/head/; revision=197439
* Import ACPICA 20090521.Jung-uk Kim2009-06-051-1/+2
| | | | Notes: svn path=/head/; revision=193530
* - Clean up suspend/resume code for amd64.Jung-uk Kim2009-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 Notes: svn path=/head/; revision=190341
* Initial suspend/resume support for amd64.Jung-uk Kim2009-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. Notes: svn path=/head/; revision=189903
* Rework how the nexus(4) device works on x86 to better handle the idea ofJohn Baldwin2008-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@ Notes: svn path=/head/; revision=177157
* Canonize the include of acpi.h.David E. O'Brien2005-09-111-1/+1
| | | | Notes: svn path=/head/; revision=150003
* Move the code for halting the CPU (acpi_cpu_c1) into machdep files.Nate Lawson2004-10-111-0/+6
| | | | | | | | | This removes the last MD portion of acpi_cpu.c. MFC after: 2 weeks Notes: svn path=/head/; revision=136366
* Sync with i386 - get the softc via the devclass rather than caching the devPeter Wemm2004-08-161-2/+1
| | | | Notes: svn path=/head/; revision=133905
* Add machdep quirks functions. On i386, this disables acpi on systems withNate Lawson2004-06-301-0/+6
| | | | | | | BIOS dates earlier than Jan 1, 1999. Add prototypes and quirks flags. Notes: svn path=/head/; revision=131312
* Don't check for NULL, device_get_softc() always succeeds.Nate Lawson2004-04-211-2/+1
| | | | Notes: svn path=/head/; revision=128508
* MFi386 by jhb: add acpi_SetDefaultIntrModel();Peter Wemm2003-09-221-0/+12
| | | | Notes: svn path=/head/; revision=120347
* Minor style cleanups.Nate Lawson2003-08-281-2/+1
| | | | Notes: svn path=/head/; revision=119531
* Use __FBSDID().David E. O'Brien2003-07-251-2/+3
| | | | | | | Brought to you by: a boring talk at OLS Notes: svn path=/head/; revision=118030
* Commit MD parts of a loosely functional AMD64 port. This is based onPeter Wemm2003-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. Notes: svn path=/head/; revision=114349
* Use repo-copied files in sys/i386/bios.Matthew N. Dodd2003-03-241-1/+1
| | | | Notes: svn path=/head/; revision=112551
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-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) Notes: svn path=/head/; revision=111815
* *sigh*. It seems that in the ACPICA code, Intel defines its own APIC_IOJohn Baldwin2002-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) Notes: svn path=/head/; revision=107144
* Include <sys/select.h> on -stable instead of <sys/selinfo.h> to get theJohn Baldwin2002-10-161-0/+4
| | | | | | | | | definition of struct selinfo. Sponsored by: The Weather Channel Notes: svn path=/head/; revision=105276
* Use d_thread_t for cdevsw functions instead of struct thread * so that itJohn Baldwin2002-10-091-4/+4
| | | | | | | is easier to share this code with 4-stable. Notes: svn path=/head/; revision=104727
* Trash the PnPBIOStable pointer later on when we know that the acpi probeJohn Baldwin2002-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. Notes: svn path=/head/; revision=104223
* If we are using APIC_IO tell ACPI so it can route interrupts properly.John Baldwin2002-09-061-0/+3
| | | | | | | | This still doesn't work quite right because of other APIC_IO hacks in the i386 PCI code. Notes: svn path=/head/; revision=103023
* Add APM compatibility feature to ACPI.Mitsuru 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 Notes: svn path=/head/; revision=85556