#
267654 |
|
19-Jun-2014 |
gjb |
Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
#
249132 |
|
05-Apr-2013 |
mav |
MFC r227293 (by ed): Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.
This means that their use is restricted to a single C file.
|
#
225736 |
|
22-Sep-2011 |
kensmith |
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
Approved by: re (implicit)
|
#
225177 |
|
25-Aug-2011 |
attilio |
Fix a deficiency in the selinfo interface: If a selinfo object is recorded (via selrecord()) and then it is quickly destroyed, with the waiters missing the opportunity to awake, at the next iteration they will find the selinfo object destroyed, causing a PF#.
That happens because the selinfo interface has no way to drain the waiters before to destroy the registered selinfo object. Also this race is quite rare to get in practice, because it would require a selrecord(), a poll request by another thread and a quick destruction of the selrecord()'ed selinfo object.
Fix this by adding the seldrain() routine which should be called before to destroy the selinfo objects (in order to avoid such case), and fix the present cases where it might have already been called. Sometimes, the context is safe enough to prevent this type of race, like it happens in device drivers which installs selinfo objects on poll callbacks. There, the destruction of the selinfo object happens at driver detach time, when all the filedescriptors should be already closed, thus there cannot be a race. For this case, mfi(4) device driver can be set as an example, as it implements a full correct logic for preventing this from happening.
Sponsored by: Sandvine Incorporated Reported by: rstone Tested by: pluknet Reviewed by: jhb, kib Approved by: re (bz) MFC after: 3 weeks
|
#
215097 |
|
10-Nov-2010 |
jkim |
Make APM emulation look more closer to its origin. Use device_get_softc(9) instead of hardcoding acpi(4) unit number as we have device_t for it.
|
#
215072 |
|
09-Nov-2010 |
jkim |
Refactor acpi_machdep.c for amd64 and i386, move APM emulation into a new file acpi_apm.c, and place it on sys/x86/acpica.
|
#
205332 |
|
19-Mar-2010 |
jhb |
Use the same policy for rejecting / not-reject ACPI tables with incorrect 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
|
#
197439 |
|
23-Sep-2009 |
jhb |
Extract the code to find and map the MADT ACPI table during early kernel 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.
|
#
197134 |
|
12-Sep-2009 |
rwatson |
Use C99 initialization for struct filterops.
Obtained from: Mac OS X Sponsored by: Apple Inc. MFC after: 3 weeks
|
#
196403 |
|
20-Aug-2009 |
jhb |
Temporarily revert the new-bus locking for 8.0 release. It will be reintroduced after HEAD is reopened for commits by re@.
Approved by: re (kib), attilio
|
#
196037 |
|
02-Aug-2009 |
attilio |
Make the newbus subsystem Giant free by adding the new newbus sxlock. The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races.
Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped.
For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens.
Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing.
Bump __FreeBSD_version in order to reflect the newbus lock introduction.
Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith)
|
#
193951 |
|
10-Jun-2009 |
kib |
Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use vnode interlock to protect the knote fields [1]. The locking assumes that shared vnode lock is held, thus we get exclusive access to knote either by exclusive vnode lock protection, or by shared vnode lock + vnode interlock.
Do not use kl_locked() method to assert either lock ownership or the fact that curthread does not own the lock. For shared locks, ownership is not recorded, e.g. VOP_ISLOCKED can return LK_SHARED for the shared lock not owned by curthread, causing false positives in kqueue subsystem assertions about knlist lock.
Remove kl_locked method from knlist lock vector, and add two separate assertion methods kl_assert_locked and kl_assert_unlocked, that are supposed to use proper asserts. Change knlist_init accordingly.
Add convenience function knlist_init_mtx to reduce number of arguments for typical knlist initialization.
Submitted by: jhb [1] Noted by: jhb [2] Reviewed by: jhb Tested by: rnoland
|
#
193530 |
|
05-Jun-2009 |
jkim |
Import ACPICA 20090521.
|
#
192442 |
|
20-May-2009 |
imp |
We don't need d_thread_t for cross-branch portability here anymore. Move do struct thread * instead.
|
#
183381 |
|
26-Sep-2008 |
ed |
Remove unit2minor() use from kernel code.
When I changed kern_conf.c three months ago I made device unit numbers equal to (unneeded) device minor numbers. We used to require bitshifting, because there were eight bits in the middle that were reserved for a device major number. Not very long after I turned dev2unit(), minor(), unit2minor() and minor2unit() into macro's. The unit2minor() and minor2unit() macro's were no-ops.
We'd better not remove these four macro's from the kernel, because there is a lot of (external) code that may still depend on them. For now it's harmless to remove all invocations of unit2minor() and minor2unit().
Reviewed by: kib
|
#
179726 |
|
11-Jun-2008 |
ed |
Don't enforce unique device minor number policy anymore.
Except for the case where we use the cloner library (clone_create() and friends), there is no reason to enforce a unique device minor number policy. There are various drivers in the source tree that allocate unr pools and such to provide minor numbers, without using them themselves.
Because we still need to support unique device minor numbers for the cloner library, introduce a new flag called D_NEEDMINOR. All cdevsw's that are used in combination with the cloner library should be marked with this flag to make the cloning work.
This means drivers can now freely use si_drv0 to store their own flags and state, making it effectively the same as si_drv1 and si_drv2. We still keep the minor() and dev2unit() routines around to make drivers happy.
The NTFS code also used the minor number in its hash table. We should not do this anymore. If the si_drv0 field would be changed, it would no longer end up in the same list.
Approved by: philip (mentor)
|
#
177157 |
|
13-Mar-2008 |
jhb |
Rework how the nexus(4) device works on x86 to better handle the idea of 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@
|
#
171297 |
|
07-Jul-2007 |
njl |
Now that we have a function that can be called from a cdevsw close() entry point, use it.
Approved by: re
|
#
170976 |
|
21-Jun-2007 |
njl |
Update the suspend/resume user API while maintaining backwards compat.
Improvements: * /etc/rc.suspend,rc.resume are always run, no matter the source of the suspend request (user or kernel, apm or acpi) * suspend now requires positive user acknowledgement. If a user program wants to cancel the suspend, they can. If one of the user programs hangs or doesn't respond within 10 seconds, the system suspends anyway. * /dev/apm is clonable, allowing multiple listeners for suspend events. In the future, xorg-server can use this to be informed about suspend even if there are other listeners (i.e. apmd).
Changes: * Two new ACPI ioctls: REQSLPSTATE and ACKSLPSTATE. Request begins the process of suspending by notifying all listeners. acpi is monitored by devd(8) and /dev/apm listener(s) are also counted. Users register their approval or disapproval via Ack. If anyone disapproves, suspend is vetoed. * Old user programs or kernel modules that used SETSLPSTATE continue to work. A message is printed once that this interface is deprecated. * acpiconf gains the -k flag to ack the suspend request. This flag is undocumented on purpose since it's only used by /etc/rc.suspend. It is not intended to be a permanent change and will be removed once a better power API is implemented. * S5 (power off) is no longer supported via acpiconf -s 5 or apm -z/-Z. This restores previous behavior of halt/shutdown -p being the interface. * Miscellaneous improvements to error reporting
Approved by: re
|
#
168191 |
|
31-Mar-2007 |
jhb |
Optimize sx locks to use simple atomic operations for the common cases of obtaining and releasing shared and exclusive locks. The algorithms for manipulating the lock cookie are very similar to that rwlocks. This patch also adds support for exclusive locks using the same algorithm as mutexes.
A new sx_init_flags() function has been added so that optional flags can be specified to alter a given locks behavior. The flags include SX_DUPOK, SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature to the similar flags for mutexes.
Adaptive spinning on select locks may be enabled by enabling the ADAPTIVE_SX kernel option. Only locks initialized with the SX_ADAPTIVESPIN flag via sx_init_flags() will adaptively spin.
The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock() are now performed inline in non-debug kernels. As a result, <sys/sx.h> now requires <sys/lock.h> to be included prior to <sys/sx.h>.
The new kernel option SX_NOINLINE can be used to disable the aforementioned inlining in non-debug kernels.
The size of struct sx has changed, so the kernel ABI is probably greatly disturbed.
MFC after: 1 month Submitted by: attilio Tested by: kris, pjd
|
#
167814 |
|
22-Mar-2007 |
jkim |
Catch up with ACPI-CA 20070320 import.
|
#
161223 |
|
11-Aug-2006 |
jhb |
First pass at allowing memory to be mapped using cache modes other than WB (write-back) on x86 via control bits in PTEs and PDEs (including making use of the PAT MSR). Changes include: - A new pmap_mapdev_attr() function for amd64 and i386 which takes an additional parameter (relative to pmap_mapdev()) specifying the cache mode for this mapping. Note that on amd64 only WB mappings are done with the direct map, all other modes result in a private mapping. - pmap_mapdev() on i386 and amd64 now defaults to using UC (uncached) mappings rather than WB. Previously we relied on the BIOS setting up MTRR's to enforce memio regions being treated as UC. This might make hw.cbb_start_memory unnecessary in some cases now for example. - A new pmap_mapbios()/pmap_unmapbios() API has been added to allow places that used pmap_mapdev() to map non-device memory (such as ACPI tables) to do so using WB as before. - A new pmap_change_attr() function for amd64 and i386 that changes the caching mode for a range of KVA.
Reviewed by: alc
|
#
159477 |
|
10-Jun-2006 |
njl |
Move the reset beep tunable/sysctl to debug.acpi.resume_beep. This makes more sense than under hw.acpi. Also, document this in the man page.
|
#
159409 |
|
08-Jun-2006 |
njl |
Minor tweaks to the resume code that might help people debug.
* Add hw.acpi.resume_beep tunable and sysctl, default to 0. Beeps the PC speaker soon after waking to diagnose whether the wakeup code is even getting run before other drivers possibly hang the system. To stop the beep, cause another beep (i.e. keyboard bell). Submitted by takawata@, I changed the frequency to be lower.
* Use 4096 instead of 4 byte alignment. Might be useful although doesn't seem to be necessary.
* Remove a useless assignment to acpi_reset_video. It was overwritten by the default sysctl value anyway.
|
#
150003 |
|
11-Sep-2005 |
obrien |
Canonize the include of acpi.h.
|
#
148352 |
|
23-Jul-2005 |
njl |
Rewrite the acpi_battery interface to allow for other battery types (i.e., smart battery) and fix various bugs found during the cleanup.
API changes: * kernel access: Access to individual batteries is now via devclass_find("battery"). Introduce new methods ACPI_BATT_GET_STATUS (for _BST-formatted data) and ACPI_BATT_GET_INFO (for _BIF-formatted data). The helper function acpi_battery_get_battinfo() now takes a device_t instead of a unit # argument. If dev is NULL, this signifies all batteries.
* ioctl access: The ACPIIO_BATT_GET_TYPE and ACPIIO_BATT_GET_BATTDESC ioctls have been removed. Since there is now no need for a mapping between "virtual" unit and physical unit, usermode programs can just specify the unit directly and skip the old translation steps. In fact, acpiconf(8) was actually already doing this and virtual unit was the same as physical unit in all cases since there was previously only one battery type (acpi_cmbat). Additionally, we now map the ACPIIO_BATT_GET_BIF and ACPIIO_BATT_GET_BST ioctls for all batteries, if they provide the associated methods.
* apm compatibility device/ioctls: no change * sysctl: no change
Since most third-party applications use the apm(4) compat interface, there should be very few affected applications (if any).
Reviewed by: bruno MFC after: 5 days
|
#
136785 |
|
22-Oct-2004 |
njl |
Remove a "needs Giant" flag from the /dev/apm compat device.
MFC after: 2 weeks
|
#
136367 |
|
11-Oct-2004 |
njl |
Match surrounding style, not style(msmith).
|
#
136366 |
|
11-Oct-2004 |
njl |
Move the code for halting the CPU (acpi_cpu_c1) into machdep files. This removes the last MD portion of acpi_cpu.c.
MFC after: 2 weeks
|
#
132619 |
|
24-Jul-2004 |
njl |
Get the acpi softc via the devclass, not by caching the device. Replace apm_softc with a single integer since the whole softc is not used.
|
#
131312 |
|
30-Jun-2004 |
njl |
Add machdep quirks functions. On i386, this disables acpi on systems with BIOS dates earlier than Jan 1, 1999. Add prototypes and quirks flags.
|
#
131218 |
|
28-Jun-2004 |
imp |
Use APM_UNKNOWN instead of 0xff. Use ~0U instead 0 for the number of batteries. This should be -1 to match other code, but since the api is unsigned ~0U is the same thing.
|
#
130585 |
|
16-Jun-2004 |
phk |
Do the dreaded s/dev_t/struct cdev */ Bump __FreeBSD_version accordingly.
|
#
130313 |
|
10-Jun-2004 |
jhb |
- Use the correct devclass name ("acpi" vs "ACPI") to detect if acpi0 is present and thus that the PnPBIOS probe should be skipped instead of having ACPI zero out the PnPBIOStable pointer. - Make the PnPBIOStable pointer static to i386/i386/bios.c now that that is the only place it is used.
|
#
128975 |
|
05-May-2004 |
njl |
Style cleanups, u_intXX -> uintXX.
|
#
128932 |
|
04-May-2004 |
jhb |
Have ACPI use BUS_CONFIG_INTR() to force the SCI to level trigger and active low polarity when using the PIC interrupt model. This should fix broken SCI interrupts on machines when not using the APIC where the BIOS doesn't program the ELCR to level trigger for the ACPI SCI.
Requested by: njl
|
#
128508 |
|
21-Apr-2004 |
njl |
Don't check for NULL, device_get_softc() always succeeds.
|
#
126080 |
|
21-Feb-2004 |
phk |
Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION.
Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
|
#
126076 |
|
21-Feb-2004 |
phk |
Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.
A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
|
#
121830 |
|
31-Oct-2003 |
njl |
Change the reset video option to be positive (hw.acpi.reset_video). Requested by: jhb
Initialize the real mode stack. This is needed at least for the return address from the lcall. Requested by: takawata
Fix style bugs in acpi_wakecode.S Requested by: bde
Remove the kernel option now that we have the tunable.
|
#
121743 |
|
30-Oct-2003 |
iwasaki |
Add sysctl MIB and loader tunable `hw.acpi.no_reset_video' as the same effect as ACPI_NO_RESET_VIDEO kernel option.
|
#
120156 |
|
17-Sep-2003 |
iwasaki |
Add final adjustment code of battery status based on the battery capacity rather than returning unknown status.
|
#
119944 |
|
10-Sep-2003 |
jhb |
Finish an earlier commit:
Add a acpi_SetDefaultIntrModel() method to allow drivers to set the interrupt model prior to the acpi0 device being probed and attached.
|
#
119530 |
|
28-Aug-2003 |
njl |
Style cleanups.
|
#
115681 |
|
02-Jun-2003 |
obrien |
Use __FBSDID().
|
#
114977 |
|
13-May-2003 |
jhb |
Add some extra #ifdef stubs so that this compiles on 4.8.
Approved by: re (rwatson/bmah)
|
#
112551 |
|
24-Mar-2003 |
mdodd |
Use repo-copied files in sys/i386/bios.
|
#
111815 |
|
03-Mar-2003 |
phk |
Gigacommit to improve device-driver source compatibility between 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)
|
#
107144 |
|
21-Nov-2002 |
jhb |
*sigh*. It seems that in the ACPICA code, Intel defines its own APIC_IO 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)
|
#
105276 |
|
16-Oct-2002 |
jhb |
Include <sys/select.h> on -stable instead of <sys/selinfo.h> to get the definition of struct selinfo.
Sponsored by: The Weather Channel
|
#
104727 |
|
09-Oct-2002 |
jhb |
Use d_thread_t for cdevsw functions instead of struct thread * so that it is easier to share this code with 4-stable.
|
#
104223 |
|
30-Sep-2002 |
jhb |
Trash the PnPBIOStable pointer later on when we know that the acpi probe 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.
|
#
103023 |
|
06-Sep-2002 |
jhb |
If we are using APIC_IO tell ACPI so it can route interrupts properly. This still doesn't work quite right because of other APIC_IO hacks in the i386 PCI code.
|
#
85556 |
|
26-Oct-2001 |
iwasaki |
Add APM compatibility feature to ACPI. 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
|