summaryrefslogtreecommitdiffstats
path: root/sys/i386/bios
Commit message (Collapse)AuthorAgeFilesLines
* Make it explicit that D_MEM cdevsw d_flag is to signify that thekib2016-05-011-1/+1
| | | | | | | | | | | | | driver is (or behaves identically to) /dev/mem. Remove the D_MEM flag from random drivers. Note that currently the D_MEM flag does not affect any behaviour, but this going to change in the next commit. Noted and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D6149
* As <machine/pmap.h> is included from <vm/pmap.h>, there is no need toskra2016-02-221-1/+0
| | | | | | | include it explicitly when <vm/pmap.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5373
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-281-2/+1
|
* Revert r267961, r267973:gjb2014-06-271-1/+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
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-06-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* This isn't functionally identical. In some cases a hint to disableeadler2012-10-221-0/+3
| | | | | | | | unit 0 would in fact disable all units. This reverts r241856 Approved by: cperciva (implicit)
* Now that device disabling is generic, remove extraneous code from theeadler2012-10-221-3/+0
| | | | | | | | device drivers that used to provide this feature. Reviewed by: des Approved by: cperciva MFC after: 1 week
* Add missing header needed by free(9).kevlo2012-09-301-0/+1
| | | | Spotted by: David Wolfskill <david at catwhisker dot org>
* Free result of device_get_children(9).kevlo2012-09-301-0/+1
|
* Remove the argument-less .align directive in sys/i386/bios/smapi_bios.S.dim2012-08-291-1/+0
| | | | | | | | Specifying no argument is undocumented in the gas manual, and clang's integrated assembler refuses to parse it. Also, removing it causes no change at all in the resulting object file. MFC after: 1 week
* Do not invoke resume event handlers if suspend was successful.jkim2011-04-191-4/+6
| | | | Pointy hat to: jkim
* Add suspend/resume event handlers for apm(4) as well.jkim2011-04-191-6/+7
|
* Add compat shim for apm(4) to translate APM BIOS function numbers from i386jkim2010-11-111-0/+17
| | | | | | | to PC98-specific ones. Any binaries using apm ioctl(4) commands but built for i386 should also work on PC98 now. Reviewed by: imp, nyan
* Introduce the new kernel sub-tree x86 which should contain all the codeattilio2010-02-252-574/+0
| | | | | | | | | | | | | | shared and generalized between our current amd64, i386 and pc98. This is just an initial step that should lead to a more complete effort. For the moment, a very simple porting of cpufreq modules, BIOS calls and the whole MD specific ISA bus part is added to the sub-tree but ideally a lot of code might be added and more shared support should grow. Sponsored by: Sandvine Incorporated Reviewed by: emaste, kib, jhb, imp Discussed on: arch MFC: 3 weeks
* Unobfuscate unit number handling in apm(4).ed2009-10-311-13/+9
| | | | | | | | There is no need to use the lower 4 bits of the unit number to store the device type number. Just use 0 and 1 to distinguish them. devfs also guarantees that there can never be an open call on a device that has a unit number different to 0 and 1, so there is no need to check for this in open().
* Temporarily revert the new-bus locking for 8.0 release. It will bejhb2009-08-203-6/+0
| | | | | | reintroduced after HEAD is reopened for commits by re@. Approved by: re (kib), attilio
* Make the newbus subsystem Giant free by adding the new newbus sxlock.attilio2009-08-023-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Some minor style changes:imp2009-05-201-22/+14
| | | | | | | o Convert K&R function definitions to ANSI o Eliminate spaces/tabs that should have been deleted as part of the de__P efforts o Use struct thread * in preference to d_thread_t *.
* Oops, sorry. Fix for fix.mav2009-05-041-1/+1
|
* There is no atrtc driver in pc98, so hide atrtcclock_disable variable usagemav2009-05-041-0/+2
| | | | in APM driver for this platform. This should fix pc98 build.
* Rename statclock_disable variable to atrtcclock_disable that it actually is,mav2009-05-031-1/+2
| | | | | | | | | | | | | and hide it inside of atrtc driver. Add new tunable hint.atrtc.0.clock controlling it. Setting it to 0 disables using RTC clock as stat-/ profclock sources. Teach i386 and amd64 SMP platforms to emulate stat-/profclocks using i8254 hardclock, when LAPIC and RTC clocks are disabled. This allows to reduce global interrupt rate of idle system down to about 100 interrupts per core, permitting C3 and deeper C-states provide maximum CPU power efficiency.
* Replace all calls to minor() with dev2unit().ed2008-09-272-2/+2
| | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib
* Add multiple include guards.jhb2008-09-241-0/+4
|
* Now that all platforms use genclock, shuffle things around slightlyphk2008-04-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for better structure. Much of this is related to <sys/clock.h>, which should really have been called <sys/calendar.h>, but unless and until we need the name, the repocopy can wait. In general the kernel does not know about minutes, hours, days, timezones, daylight savings time, leap-years and such. All that is theoretically a matter for userland only. Parts of kernel code does however care: badly designed filesystems store timestamps in local time and RTC chips almost universally track time in a YY-MM-DD HH:MM:SS format, and sometimes in local timezone instead of UTC. For this we have <sys/clock.h> <sys/time.h> on the other hand, deals with time_t, timeval, timespec and so on. These know only seconds and fractions thereof. Move inittodr() and resettodr() prototypes to <sys/time.h>. Retain the names as it is one of the few surviving PDP/VAX references. Move startrtclock() to <machine/clock.h> on relevant platforms, it is a MD call between machdep.c/clock.c. Remove references to it elsewhere. Remove a lot of unnecessary <sys/clock.h> includes. Move the machdep.disable_rtc_set sysctl to subr_rtc.c where it belongs. XXX: should be kern.disable_rtc_set really, it's not MD.
* Hold Giant over the entire execution of the suspend path instead ofnjl2007-12-061-4/+4
| | | | | | | dropping it after each call into newbus. This doesn't fix any known problems but seems more correct. Submitted by: Marko Zec <zec / icir.org>
* Apply the same sort of locking done injulian2007-11-141-0/+10
| | | | | | | | | | | | | | sys/dev/acpica/acpi.c rev 1.196 a while ago: Grab Giant around calls to DEVICE_SUSPEND/RESUME in acpi_SetSleepState(). If we are resuming non-MPSAFE drivers, they need Giant held for them. This may fix some obscure suspend/resume problems. It has fixed keyrate setting problems that were triggered by cardbus (MPSAFE) changing the ordering for syscons resume (non-MPSAFE). Also, add some asserts that Giant is held in our suspend/resume and shutdown methods. Submitted by: Marko Zec
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-201-2/+2
| | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
* Tweak the probe/attach order of devices on the x86 nexus devices.jhb2007-03-203-3/+3
| | | | | Various BIOS-related psuedo-devices are added at an order of 5. acpi0 is added at an order of 10, and legacy0 is added at an order of 11.
* First part of a little cleanup in the calendar/timezone/RTC handling.phk2006-10-021-0/+1
| | | | | | Move relevant variables to <sys/clock.h> and fix #includes as necessary. Use libkern's much more time- & spamce-efficient BCD routines.
* APM was calling the suspend process from a timeout. This meant thatimp2006-05-252-27/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | other timeouts could not happen while suspending, including timeouts for things like msleep. This caused the system to hang on suspend when the cbb was enabled, since its suspend path powered down the socket which used a timeout to wait for it to be done. APM now creates a thread when it is enabled, and deletes the thread when it is disabled. This thread takes the place of the timeout by doing its polling every ~.9s. When the thread is disabled, it will wakeup early, otherwise it times out and polls the varius things the old timeout polled (APM events, suspend delays, etc). This makes my Sony VAIO 505TS suspend/resume correctly when APM is enabled (ACPI is black listed on my 505TS). This will likely fix other problems with the suspend path where drivers would sleep with msleep and/or do other timeouts. Maybe there's some special case code that would use DELAY while suspending and msleep otherwise that can be revisited and removed. This was also tested by glebius@, who pointed out that in the patch I sent him, I'd forgotten apm_saver.c MFC After: 3 weeks
* Fix build (including both asm.h and asmacros.h is evil).ru2005-07-221-2/+0
|
* Fix smbios(4) and add support for amd64jkim2005-07-211-4/+22
| | | | Approved by: anholt (mentor)
* - Consistently protect against NULL dereference.mdodd2005-04-121-48/+58
| | | | - Simplify conditional logic to make code easier to read.
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-062-2/+2
|
* Remove local hacks to set flags now that the device probe does this for us.njl2004-10-141-9/+1
| | | | | | | Tested on every device except sio_pci and the pc98 fd.c. Perhaps something similar should be done for the "disabled" hints also. MFC after: 2 weeks
* Clarify SDT feature word bits.mdodd2004-08-311-4/+5
| | | | Obtained from: NetBSD
* Fix checksum calculation.mdodd2004-08-311-12/+7
| | | | Submitted by: Jean Delvare <khali@linux-fr.org>
* o Return ai_batteries as 0xffffffff instead of -1. This is a nop change, butimp2004-06-162-2/+3
| | | | | | | | | placates gcc which seems to like to complain about -1 being assigned to an unsigned value. It is well defined and intended, but since signess bugs are being hunted just change to 0xffffffff. o Mask the lower 8 bits, not the lower 4 bits for the ai_capabilities word. All 8 bits are defined and the 0xf was almost certainly a typo. o Define APM_UNKNOWN to 0xff for emulation layer.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-162-7/+7
| | | | Bump __FreeBSD_version accordingly.
* Remove atdevbase and replace it's remaining uses with direct references tojhb2004-06-104-0/+4
| | | | KERNBASE instead.
* Add missing #include <sys/module.h>phk2004-05-301-0/+1
|
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-173-12/+9
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Device megapatch 4/6:phk2004-02-212-1/+4
| | | | | | | | 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.
* Device megapatch 1/6:phk2004-02-212-3/+0
| | | | | | | 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.
* - Implement selwakeuppri() which allows raising the priority of atanimura2003-11-091-1/+1
| | | | | | | | | | | | | thread being waken up. The thread waken up can run at a priority as high as after tsleep(). - Replace selwakeup()s with selwakeuppri()s and pass appropriate priorities. - Add cv_broadcastpri() which raises the priority of the broadcast threads. Used by selwakeuppri() if collision occurs. Not objected in: -arch, -current
* The present defaults for the open and close for device drivers whichphk2003-09-271-2/+0
| | | | | | | | | | | | | | provide no methods does not make any sense, and is not used by any driver. It is a pretty hard to come up with even a theoretical concept of a device driver which would always fail open and close with ENODEV. Change the defaults to be nullopen() and nullclose() which simply does nothing. Remove explicit initializations to these from the drivers which already used them.
* - Use the new resource_disabled() helper function to see if devices arejhb2003-07-021-10/+5
| | | | | | | | | | | | disabled. - Change the apm driver to match the acpi driver's behavior by checking to see if the device is disabled in the identify routine instead of in the probe routine. This way if the device is disabled it is never created. Note that a few places (ips(4), Alpha SMP) used "disable" instead of "disabled" for their hint names, and these hints must be changed to "disabled". If this is a big problem, resource_disabled() can always be changed to honor both names.
* Implement a loader tunable/sysctl to allow the user to request thatmdodd2003-06-221-0/+8
| | | | | | | the APM driver byte-swap battery time values. (For broken laptops.) PR: i386/42439 Submitted by: Bruce M Simpson <bms@spc.org>
* Despite my best efforts the Linux way of doing this is the onlymdodd2003-06-132-38/+20
| | | | | | | way that works correctly. - Remove unused function. - Move declaration of variables to .S file.
* Use __FBSDID().obrien2003-06-026-11/+17
|
OpenPOWER on IntegriCloud