summaryrefslogtreecommitdiffstats
path: root/sys/i386/bios
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Merge PC98 support.mdodd2003-03-252-0/+122
|
* Correct a mis-merge.mdodd2003-03-241-2/+2
| | | | Noticed by: johan
* - Consolidate smapi driver.mdodd2003-03-243-361/+218
| | | | | - Attach to nexus. - Use null{open,close}() instead of rolling our own.
* Add the 'vpd' and 'smbios' drivers. The 'smbios' driver is just amdodd2003-03-242-0/+559
| | | | stub right now.
* Use repo-copied files in sys/i386/bios.mdodd2003-03-242-2/+2
|
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-032-27/+13
| | | | | | | | | | | | | 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)
* - Removed unecesary code.mdodd2003-01-183-55/+48
| | | | | - Correct smapi32_new() asm (still doesn't work.) - Attach to mainboard not isa.
* A driver for the System Management Application Programmdodd2003-01-174-0/+546
| | | | | | | | Interface (SMAPI) BIOS, which is present on some IBM Thinkpad models (560, 600, 770 to name a few.) The SMAPI BIOS provides access to System Information, System Configuration, and Power Management.
* Be consistent about functions being static.phk2002-10-161-1/+1
| | | | Spotted by: FlexeLint.
* use __packed.alfred2002-09-231-1/+1
|
* Hang apm off of the legacy device instead of the nexus.jhb2002-09-231-1/+1
|
* Use a function instead of embedding non-portable asm() constructsmarkm2002-09-211-1/+2
| | | | in C code.
OpenPOWER on IntegriCloud