Commit Graph

148 Commits

Author SHA1 Message Date
Matthew N. Dodd
95ca467a68 - Removed unecesary code.
- Correct smapi32_new() asm (still doesn't work.)
- Attach to mainboard not isa.
2003-01-18 04:36:12 +00:00
Matthew N. Dodd
7534ac7ab7 A driver for the System Management Application Program
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.
2003-01-17 08:10:18 +00:00
Poul-Henning Kamp
1eaae5cbe8 Be consistent about functions being static.
Spotted by:	FlexeLint.
2002-10-16 08:57:14 +00:00
Alfred Perlstein
4f492bfab5 use __packed. 2002-09-23 18:54:32 +00:00
John Baldwin
ae829cae03 Hang apm off of the legacy device instead of the nexus. 2002-09-23 15:56:09 +00:00
Mark Murray
bebe1b92bd Use a function instead of embedding non-portable asm() constructs
in C code.
2002-09-21 18:51:19 +00:00
Mark Murray
39ae7d0dc4 Sort includes. 2002-09-21 18:30:12 +00:00
Alfred Perlstein
b63dc6ad47 Remove __P. 2002-03-20 05:48:58 +00:00
Mitsuru IWASAKI
899ccf541a Add generalized power profile code.
This makes other power-management system (APM for now) to be able to
generate power profile change events (ie. AC-line status changes), and
other kernel components, not only the ACPI components, can be notified
the events.

 - move subroutines in acpi_powerprofile.c (removed) to kern/subr_power.c
 - call power_profile_set_state() also from APM driver when AC-line
   status changes
 - add call-back function for Crusoe LongRun controlling on power
   profile changes for a example
2002-03-04 18:46:13 +00:00
Mitsuru IWASAKI
f9390180fe Some fix for the recent apm module changes.
- Now that apm loadable module can inform its existence to other kernel
   components  (e.g. i386/isa/clock.c:startrtclock()'s TCS hack).
 - Exchange priority of SI_SUB_CPU and SI_SUB_KLD for above purpose.
 - Add simple arbitration mechanism for APM vs. ACPI.  This prevents
   the kernel enables both of them.
 - Remove obsolete `#ifdef DEV_APM' related code.
 - Add abstracted interface for Powermanagement operations.  Public apm(4)
   functions, such as apm_suspend(), should be replaced new interfaces.
   Currently only power_pm_suspend (successor of apm_suspend) is implemented.

Reviewed by:	peter, arch@ and audit@
2001-11-01 16:34:07 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Poul-Henning Kamp
f83880518b Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.
2001-03-26 12:41:29 +00:00
Peter Wemm
02846353f9 Commit some tweaks I have had laying around my tree for over a year now.
Always set the APM "device" description.  Some minor style tweaks.
2001-03-13 05:56:48 +00:00
Garrett Wollman
0a2c3d48c6 select() DKI is now in <sys/selinfo.h>. 2001-01-09 04:33:49 +00:00
Poul-Henning Kamp
53ce36d17a Remove unneeded #include <sys/proc.h> lines. 2000-10-29 13:57:19 +00:00
Mitsuru IWASAKI
2bfb7205bf Add Timer device driver for power management events.
The code for suspend/resume is derived from APM device driver.

Some people suggested the original code is somewhat buggy, but I'd
like to just move it from apm.c without any major changes for the
initial version.  This code should be refined later.

To use pmtimer to adjust time at resume time, add
	device	pmtimer
in your kernel config file, and add
	hint.pmtimer.0.at="isa"
in your device.hints

Reviewed by:	-current, bde
2000-09-14 22:34:57 +00:00
Hajimu UMEMOTO
8ad6d022ca Add output of per battery information to apm(1).
New ioctl APMIO_GETPWSTATUS is introduced.

Reviewed by:	-mobile and -current folks (no objection)
2000-08-13 17:05:27 +00:00
Mitsuru IWASAKI
8000a5797e Cleanup debug messages and Add some enhancements from linux on
display control by apm -d.
 - Remove APM_DEBUG to avoid re-build kernel with such a unspported optioin.
 - Introduce new denug flag `debug.apm_debug' which can be controlled by
   sysctl interface and loader by setting like "debug.apm_debug=1", you
   will get debug messages from APM driver.
 - Add some enhancements from linux on display control by apm -d.  I'm
   expecting that we can see some improvements on some laptops where
   apm -d doesn't work correctly so far.

Reviewed by:	-mobile and -current folks (no objection)
Suggested by:	Susumu WAKABAYASHI <susumu@wakabaya.net>
2000-08-04 20:28:53 +00:00
Warner Losh
3c91d95c96 Except for the information gathering IOCTLs, require apm device be
opened for write.  This should make the apm device read only safe.
2000-07-19 06:32:00 +00:00
Nick Hibma
16422b76f1 Correctly handle suspend and resume in APM.
Up to now, errors from DEVICE_SUSPEND(root_bus) were ignored. The fix for
this problem (the introduction of defaults for device methods) has been
committed months ago by Doug Rabson.

Second, the suspended devices were not always properly resumed on error.

Third, swapped the order for calling restore hooks and restore methods, to
be in line with the cases above.

Reviewed by:	Doug Rabson
Approved by:	jhk
2000-02-06 14:57:05 +00:00
Peter Wemm
690f85de65 Remove a bunch of unused (NO-OP) #if NFOO > 0 type includes and some
#include "foo.h" headers.
2000-01-29 16:17:36 +00:00
Matthew N. Dodd
919886a01f Correctly test CF. 2000-01-13 08:49:47 +00:00
Jonathan Lemon
2ba5960c24 Remove code to select APM version with flags to the apm0 device. This
code has been disabled for the last 4 months.

Prodded into action by:	 n_hibma
1999-12-02 03:13:11 +00:00
Peter Wemm
cd3535a676 Use DRIVER_MODULE(), apm.c already takes care of it's devices with
make_dev().
1999-11-08 07:44:26 +00:00
Mitsuru IWASAKI
29803c2003 i8254_restore is called from apm_default_resume() to reload
the countdown register.
this should not be necessary but there are broken laptops that
do not restore the countdown register on resume.
when it happnes, it messes up the hardclock interval and system clock,
which leads to the infamous "calcru: negative time" problem.

Submitted by:	kjc, iwasaki
Reviewed by:	Steve O'Hara-Smith <steveo@eircom.net> and committers.
Obtained from:	PAO3
1999-10-30 14:56:01 +00:00
Nick Sayer
5277685400 Fix APM's make_devs:
1. chown root:operator, chmod 660

2. Add /dev/apmctl as well as /dev/apm
1999-10-12 15:00:06 +00:00
Nick Sayer
dd35cab101 Prepare for the apm_saver screen saver module.
1. Break out the definition of the soft state structure into an include
file.

2. un-static the soft state and apm_display(), and group them under a
comment that notes the dependency.
1999-10-02 03:34:15 +00:00
Poul-Henning Kamp
d6a0e38a1b Remove five now unused fields from struct cdevsw. They should never
have been there in the first place.  A GENERIC kernel shrinks almost 1k.

Add a slightly different safetybelt under nostop for tty drivers.

Add some missing FreeBSD tags
1999-09-25 18:24:47 +00:00
Mitsuru IWASAKI
43834dfd27 Return immediately from apm_suspend() when APM BIOS wasn't initialized.
Pressing Alt-Pause key will cause machine to reboot with apm disabled.

PR:		i386/13817
Submitted by:	yokota
1999-09-20 15:29:23 +00:00
Mitsuru IWASAKI
38d336b5b8 Handle CAPABILITIESCHANGE event.
Document USERSTANDBYREQ and CAPABILITIESCHANGE events to apmd manpage.
1999-09-11 16:00:28 +00:00
Nick Sayer
d34e591d4d Handle UserStandbyRequests as well as the other 3 members of the
{,USER}{STANDBY,SUSPEND}REQ matrix.
1999-09-11 15:12:31 +00:00
Matthew N. Dodd
478c54971b SYSINIT() needs sys/kernel.h. Include it. 1999-09-03 03:14:36 +00:00
Matthew N. Dodd
7612e4c122 This adds the i386 specific support for systems with a MicroChannel
Architecture bus.

Reviewed by: msmith
1999-09-03 02:04:28 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Poul-Henning Kamp
9dcbe2404a Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().
1999-08-23 20:59:21 +00:00
Peter Wemm
7fa76d3a80 Add an identify method to allow apm to attach itself to the nexus
without hooks in there.
1999-08-22 19:51:33 +00:00
Mitsuru IWASAKI
49d3a95692 Fix `key release event prevent suspend' problem. We don't need
`sleep 1; zzz' trick now.

- APM BIOS Call for suspend/standby now should be issued with delay.
- Delay for suspend/standby can be adjusted by using sysctl(8) interface
  (eg. sysctl -w machdep.apm_suspend_delay=3).
1999-08-22 14:48:00 +00:00
Mike Smith
fcb893a801 Implement a new generic mechanism for attaching handler functions to
events, in order to pave the way for removing a number of the ad-hoc
implementations currently in use.

Retire the at_shutdown family of functions and replace them with
new event handler lists.

Rework kern_shutdown.c to take greater advantage of the use of event
handlers.

Reviewed by:	green
1999-08-21 06:24:40 +00:00
Mitsuru IWASAKI
8e52b99964 - Add apm_check_function_supported() and call it from
apm_bioscall() to check requested BIOS is supported or not.

- Add workaround in apm_driver_version() for the buggy BIOSes which
  don't return the connection version in %ax.

PR:		i386/13028
Reviewed by:	sanpei@sanpei.org and Warner Losh.
1999-08-14 18:39:40 +00:00
Mike Smith
091edd6845 Don't trust the segment limits that the BIOS reports; instead give it
as much space as possible to avoid lossage due to sloppy BIOS
programming.
1999-08-02 18:46:34 +00:00
Mike Smith
600d8382d9 Reenable the APMIO_BIOS ioctl and translate arguments into the new format
(which is more like the old than I thought).

Requested-by:	imp
1999-07-30 19:35:03 +00:00
Mike Smith
733e6274d7 Remove all vestiges of APMIO_BIOS
Submitted by:	N. Dudorov <nnd@mail.nsk.ru>
1999-07-30 08:24:23 +00:00
Mitsuru IWASAKI
d0c9cc72d2 No more apm_errno. It breaks the build with APM_DEBUG,
uses (sc->bios.r.eax >> 8) & 0xff instead.
1999-07-29 18:15:33 +00:00
Mike Smith
fc372ebd4d Nuke this, it's not used anymore. 1999-07-29 01:52:13 +00:00
Mike Smith
496027bf08 Major update to the kernel's BIOS-calling ability.
- Add support for calling 32-bit code in other segments
 - Add support for calling 16-bit protected mode code

Update APM to use this facility.

Submitted by:	jlemon
1999-07-29 01:49:19 +00:00
Mike Smith
a9063682da Remove unused real-mode APM setup support. We've been using the vm86
mode initialiser for a while now, and it's looking happy.
1999-07-28 20:20:31 +00:00
Mike Smith
29c7e03718 Remove unused real-mode APM init functions. 1999-07-28 20:07:12 +00:00
Mike Smith
30f41f1f8d Remove some erroneous comments about how APM is initialised. 1999-07-28 19:37:32 +00:00
Mitsuru IWASAKI
c0039f8e42 Add braces to make if-else statement clearer.
PR:		12663
Submitted by:	Adam Wight <adamw@holonet.net>
1999-07-22 14:45:22 +00:00
Mitsuru IWASAKI
50e0a471cc Add apmd support code. 1999-07-10 18:08:57 +00:00