aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/acpica/Osd
Commit message (Collapse)AuthorAgeFilesLines
* acpi: Make taskqueue only run on BSPAymeric Wibo6 days1-1/+5
| | | | | | | | | | | | | | This is needed because when we add the suspend-to-idle loop, we only want to break the BSP out of idle to process the taskqueue while keeping all the others idled. Currently assuming BSP to be CPU0, which may not always be the case on non-x86. Reviewed by: kib Approved by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54406
* pci_cfgreg: Add a PCI domain argument to the low-level register APIJohn Baldwin2023-11-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | This commit changes the API of pci_cfgreg(read|write) to add a domain argument (referred to as a segment in ACPI parlance) (note that this is not the same as a NUMA domain, but something PCI-specific). This does not yet enable access to domains other than 0, but updates the API to support domains. Places that use hard-coded bus/slot/function addresses have been updated to hardcode a domain of 0. A few places that have the PCI domain (segment) available such as the acpi_pcib_acpi.c Host-PCI bridge driver pass the PCI domain. The hpt27xx(4) and hptnr(4) drivers fail to attach to a device not on domain 0 since they provide APIs to their binary blobs that only permit bus/slot/function addressing. The x86 non-ACPI PCI bus drivers all hardcode a domain of 0 as they do not support multiple domains. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42827
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-272-2/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-168-16/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t.John Baldwin2022-09-221-3/+3
| | | | | | | | This matches the return type of pmap_mapdev/bios. Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36548
* acpica: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365096
* Merge ACPICA 20190329.Jung-uk Kim2019-03-291-3/+3
| | | | Notes: svn path=/head/; revision=345713
* remove unneeded inclusion of sys/interrupt.h from several filesAndriy Gapon2018-07-041-1/+0
| | | | | | | | | | | It's likely that the header was needed in the past for swi(9). But now that code does not use swi(9) or any other interfaces defined in sys/interrupt.h. MFC after: 1 week Notes: svn path=/head/; revision=335934
* Redo r332918 with the ACPICA API and remove debug.acpi.suspend_deep_bounce.Jung-uk Kim2018-05-031-0/+6
| | | | | | | | | AcpiOsEnterSleep() was meant to implement this feature. Reviewed by: avg Notes: svn path=/head/; revision=333222
* Do not check whether AcpiOsGetTimer() is called during boot.Jung-uk Kim2017-10-101-3/+0
| | | | | | | | | | | | | From ACPICA 20170929, AcpiOsGetTimer() should be available early because While() loop timeout mechanism was reimplemented with it. Unfortunately, it means AcpiLoadTables() may cause panic when a While() loop is executed. After having lengthy discussions with ACPICA developers, I have concluded that dummy timecounter is good enough for the purpose and it is the least intrusive solution for now. Also, they reminded me the ACPI specification implies OS timer function should be available before loading tables. Notes: svn path=/head/; revision=324501
* Defer ACPI taskqueue creation to SI_SUB_KICK_SCHEDULER.Mark Johnston2017-07-051-1/+1
| | | | | | | | | | | | | | This addresses a deadlock during boot when EARLY_AP_STARTUP is configured: a taskqueue thread may call pause() with an ACPI mutex held, and thread0 may block on this mutex before configuring the eventtimer. In this case the taskqueue thread will sleep forever waiting for its callout to fire. PR: 220277 Submitted by: jhb MFC after: 3 days Notes: svn path=/head/; revision=320690
* Merge ACPICA 20161222.Jung-uk Kim2017-01-052-2/+8
| | | | Notes: svn path=/head/; revision=311462
* Merge ACPICA 20160930.Jung-uk Kim2016-10-041-0/+1
| | | | Notes: svn path=/head/; revision=306686
* Use polling spin loops for timeouts during early boot.John Baldwin2016-05-161-0/+34
| | | | | | | | | | | | | | | | | Some ACPI operations such as mutex acquires and event waits accept a timeout. The ACPI OSD layer implements these timeouts by using regular sleep timeouts. However, this doesn't work during early boot before event timers are setup. Instead, use polling combined with DELAY() to spin. This fixes booting on upcoming Intel systems with Kaby Lake processors. Tested by: "Jeffrey E Pieper" <jeffrey.e.pieper@intel.com> Reviewed by: jimharris MFC after: 1 week Notes: svn path=/head/; revision=299977
* Merge ACPICA 20160422.Jung-uk Kim2016-04-271-1/+2
| | | | Notes: svn path=/head/; revision=298714
* Merge ACPICA 20150818.Jung-uk Kim2015-08-261-1/+1
| | | | Notes: svn path=/head/; revision=287168
* Add basic support for ACPI. It splits out the nexus driver to two newAndrew Turner2015-06-111-0/+10
| | | | | | | | | | | | | | | | | | | | drivers, one for fdt, one for acpi. It then uses this to decide if it will use fdt or acpi. The GICv2 (interrupt controller) and Generic Timer drivers have been updated to handle both cases. As this is early code we still need FDT to find the kernel console, and some parts are still missing, including PCI support. Differential Revision: https://reviews.freebsd.org/D2463 Reviewed by: jhb, jkim, emaste Obtained from: ABT Systems Ltd Relnotes: Yes Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=284273
* Merge ACPICA 20140926.Jung-uk Kim2014-10-021-2/+2
| | | | Notes: svn path=/head/; revision=272444
* Add sysctl to track the resource consumption of ACPI interrupts.Will Andrews2014-10-011-0/+11
| | | | | | | | | | Submitted by: gibbs MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: 636827 on 2012/09/28 Notes: svn path=/head/; revision=272360
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-2/+0
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-0/+2
| | | | | | | | | | | | | 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-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove duplicate SYSCTL_DECL(_debug_acpi) which was breaking tinderboxSteven Hartland2014-04-241-2/+0
| | | | | | | | MFC after: 2 weeks X-MFC-With: r264849 Notes: svn path=/head/; revision=264883
* Exposed debug.acpi.max_tasks and debug.acpi.max_threads via sysctls so theirSteven Hartland2014-04-241-0/+6
| | | | | | | values can be viewed. Notes: svn path=/head/; revision=264849
* Tidy up global locks for ACPICA. There is no functional change.Jung-uk Kim2013-08-131-12/+10
| | | | Notes: svn path=/head/; revision=254300
* Merge ACPICA 20130517.Jung-uk Kim2013-05-201-3/+7
| | | | Notes: svn path=/head/; revision=250838
* - Prefer ACPI_COMPARE_NAME(a, b) macro over strncmp(a, b, ACPI_NAME_SIZE).Jung-uk Kim2013-05-201-9/+8
| | | | | | | | - Make sure the predefined name is a string type. - Return slightly more useful errors. Notes: svn path=/head/; revision=250834
* Fix white spaces.Jung-uk Kim2013-05-201-33/+31
| | | | Notes: svn path=/head/; revision=250833
* Fix two misusages of return_*() macros for ACPICA.Jung-uk Kim2013-01-281-1/+3
| | | | | | | Noticed by: avg Notes: svn path=/head/; revision=246042
* Fix white spaces for style consistency.Jung-uk Kim2013-01-281-3/+3
| | | | Notes: svn path=/head/; revision=246041
* Consistently use ACPI_SUCCESS() and ACPI_FAILURE() macros wherever possible.Jung-uk Kim2012-06-011-2/+2
| | | | Notes: svn path=/head/; revision=236424
* Merge ACPICA 20120518.Jung-uk Kim2012-05-241-0/+14
| | | | Notes: svn path=/head/; revision=235945
* Fix a long-standing bug for AcpiOsGetTimer(). time_t is 32-bit on i386 andJung-uk Kim2012-02-241-3/+3
| | | | | | | | | it needs proper casting before multiplication. MFC after: 3 days Notes: svn path=/head/; revision=232132
* Merge ACPICA 20120215.Jung-uk Kim2012-02-162-2/+16
| | | | Notes: svn path=/head/; revision=231844
* De-obfuscate acpi_acquire_global_lock(). It seems the function was directlyJung-uk Kim2012-02-101-8/+6
| | | | | | | translated from i386 assembly version. Notes: svn path=/head/; revision=231474
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten2011-11-074-4/+4
| | | | | | | This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
* Merge ACPICA 20110527.Jung-uk Kim2011-05-311-10/+13
| | | | Notes: svn path=/head/; revision=222544
* Use the preload_fetch_addr() and preload_fetch_size() convenienceMarcel Moolenaar2011-02-131-11/+13
| | | | | | | | | functions to obtain the address and size of the overriding DSDT. Sponsored by: Juniper Networks. Notes: svn path=/head/; revision=218660
* Fix a witness(4) warning introduced in r217238.Jung-uk Kim2011-01-111-13/+18
| | | | Notes: svn path=/head/; revision=217278
* Remove impossible error conditions.Jung-uk Kim2011-01-101-4/+2
| | | | Notes: svn path=/head/; revision=217241
* Add forgotten free(9) in the previous commit for an error case.Jung-uk Kim2011-01-101-0/+1
| | | | Notes: svn path=/head/; revision=217240
* Allow AcpiOsInstallInterruptHandler() and AcpiOsRemoveInterruptHandler() toJung-uk Kim2011-01-101-80/+149
| | | | | | | | | | | | install or remove non-SCI interrupt handlers per ACPI Component Architecture User Guide and Programmer Reference. ACPICA may install such interrupt handler when a GPE block device is found, for example. Add a wrapper for ACPI_OSD_HANDLER, convert its return values to ours, and make it a filter. Prefer KASSERT(9) over panic(9) as we have never seen those in reality. Clean up some style(9) nits and add my copyright. Notes: svn path=/head/; revision=217238
* Prefer KASSERT(9) over panic(9) as it was never seen in reality.Jung-uk Kim2011-01-101-2/+1
| | | | Notes: svn path=/head/; revision=217236
* Clean up unused headers.Jung-uk Kim2010-10-131-4/+0
| | | | Notes: svn path=/head/; revision=213787
* Remove acpi_bus_number() completely. It had to be removed in r212761.Jung-uk Kim2010-10-131-55/+0
| | | | | | | Pointed out by: jhb Notes: svn path=/head/; revision=213783
* Mark acpi_bus_number() as __unused. This allows clang to this fileRui Paulo2010-10-131-1/+1
| | | | | | | without any warnings. Notes: svn path=/head/; revision=213772
* Merge ACPICA 20100915.Jung-uk Kim2010-09-161-36/+0
| | | | Notes: svn path=/head/; revision=212761
* Merge ACPICA 20100806.Jung-uk Kim2010-08-062-7/+1
| | | | Notes: svn path=/head/; revision=210976
* Simplify AcpiOsReadPort() and AcpiOsWritePort() with iodev_read_*() andJung-uk Kim2010-07-161-22/+7
| | | | | | | | iodev_write_*(). This removes unnecessary uses of temporary macros as well. There is no functional change after this (verified with md5(1) on amd64). Notes: svn path=/head/; revision=210157
* Use pmap_mapdev()/pmap_unmapdev() to map device memory instead of usingJung-uk Kim2010-07-161-4/+4
| | | | | | | | | | AcpiOsMapMemory()/AcpiOsUnmapMemory() (-> pmap_mapbios()/pmap_unmapbios()) for AcpiOsReadMemory() and AcpiOsWriteMemory(). Although they do not sound too obvious, these functions are exclusively used to access memory mapped IO in ACPICA. Notes: svn path=/head/; revision=210155