Commit Graph

97 Commits

Author SHA1 Message Date
Jonathan Lemon
2171c52a81 Unifdef VM86
Reviewed by:	silence on on -current
1999-06-01 18:17:50 +00:00
Poul-Henning Kamp
4e2f199e0c This commit should be a extensive NO-OP:
Reformat and initialize correctly all "struct cdevsw".

        Initialize the d_maj and d_bmaj fields.

        The d_reset field was not removed, although it is never used.

I used a program to do most of this, so all the files now use the
same consistent format.  Please keep it that way.

Vinum and i4b not modified, patches emailed to respective authors.
1999-05-30 16:53:49 +00:00
Poul-Henning Kamp
bfbb9ce670 Divorce "dev_t" from the "major|minor" bitmap, which is now called
udev_t in the kernel but still called dev_t in userland.

Provide functions to manipulate both types:
        major()         umajor()
        minor()         uminor()
        makedev()       umakedev()
        dev2udev()      udev2dev()

For now they're functions, they will become in-line functions
after one of the next two steps in this process.

Return major/minor/makedev to macro-hood for userland.

Register a name in cdevsw[] for the "filedescriptor" driver.

In the kernel the udev_t appears in places where we have the
major/minor number combination, (ie: a potential device: we
may not have the driver nor the device), like in inodes, vattr,
cdevsw registration and so on, whereas the dev_t appears where
we carry around a reference to a actual device.

In the future the cdevsw and the aliased-from vnode will be hung
directly from the dev_t, along with up to two softc pointers for
the device driver and a few houskeeping bits.  This will essentially
replace the current "alias" check code (same buck, bigger bang).

A little stunt has been provided to try to catch places where the
wrong type is being used (dev_t vs udev_t), if you see something
not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if
it makes a difference.  If it does, please try to track it down
(many hands make light work) or at least try to reproduce it
as simply as possible, and describe how to do that.

Without DEVT_FASCIST I belive this patch is a no-op.

Stylistic/posixoid comments about the userland view of the <sys/*.h>
files welcome now, from userland they now contain the end result.

Next planned step: make all dev_t's refer to the same devsw[] which
means convert BLK's to CHR's at the perimeter of the vnodes and
other places where they enter the game (bootdev, mknod, sysctl).
1999-05-11 19:55:07 +00:00
Poul-Henning Kamp
52400704e9 Unconfuse DEV_MODULE() and DEV_DRIVER_MODULE() about the difference between
a major number for a dev_t.
1999-05-09 13:00:50 +00:00
Kazutaka YOKOTA
4e1cc0095d Make apm_probe() properly return an error code when APM BIOS calls
failed, so that the apm driver won't be attached.
1999-05-09 04:58:13 +00:00
Doug Rabson
566643e39e Move the declaration of the interrupt type from the driver structure
to the BUS_SETUP_INTR call.
1999-05-08 21:59:43 +00:00
Poul-Henning Kamp
46eede0058 Continue where Julian left off in July 1998:
Virtualize bdevsw[] from cdevsw.  bdevsw() is now an (inline)
        function.

        Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention
        to the order of the cmaj/bmaj arguments!)

        Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE
        (ditto!)

(Next step will be to convert all bdev dev_t's to cdev dev_t's
before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
1999-05-07 10:11:40 +00:00
Luoqi Chen
25b602e4c2 Now that each cpu has its own gdt table, we need to setup apm gdt entries in
all the tables.
1999-05-06 01:07:03 +00:00
Warner Losh
bb31204c9b DEVICE_SUSPEND was always returning ENXIO for reasons unknown. For
now we noisily ignore this (and all errors).  DEVICE_SUSPEND should be
corrected, but I wanted to unbreak suspend until that happens.
1999-04-21 07:57:55 +00:00
Doug Rabson
d6c789c07a Add support for 'disabled' probe hint. 1999-04-18 15:10:58 +00:00
Peter Wemm
6182fdbda8 Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition.  eisa, isapnp and pccard* are
not yet using the new resource manager.  Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
 ATA driver to the Alpha.  Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by:	core
1999-04-16 21:22:55 +00:00
Mike Smith
8f9e83e526 Perform APM power-off on power-off request, not halt request. 1998-12-10 23:36:14 +00:00
Archie Cobbs
4c6844ea51 Fix typo: "==" should have been "="
PR:		8280 (1/3 patches contained in this PR)
Reviewed by:	Nate Williams <nate@mt.sri.com>
Submitted by:	Sakari Jalovaara <sja@tekla.fi>
1998-12-04 21:28:39 +00:00
Mike Smith
35d27a0f39 Add the ability to specify where on the at_shutdown queue a handler is
installed.

Remove cpu_power_down, and replace it with an entry at the end of the
SHUTDOWN_FINAL queue in the only place it's used (APM).

Submitted by:	Some ideas from Bruce Walter <walter@fortean.com>
1998-10-30 05:41:15 +00:00
Jonathan Lemon
95b246f166 Use defines APM_BIOS and SYSTEM_BIOS instead of hardcoding 0x53 and 0x15. 1998-09-28 03:41:12 +00:00
Warner Losh
f71f5262b1 Add the ability to suspend as well as hibernate to the system. This
is the kernel part of my commits, the userlevel stuff will be done in
a separate commit.  Add the ability to suspend as well as hibernate to
syscons.  Create a new virtual key like hibernate for suspend.  Update
apm_bios.h to define more apm bios goodies.
1998-07-06 06:29:07 +00:00
Doug Rabson
ecbb00a262 This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.
1998-06-07 17:13:14 +00:00
Mike Smith
f9c9bbc054 If vm86 services are available, use these to perform the APM BIOS
probe and intialisation.  This will ultimately remove the grubby (but
functional) hack that copies a real-mode function into low memory
early in locore.s.
1998-06-03 01:59:42 +00:00
Poul-Henning Kamp
227ee8a188 Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed
around any access to it, unless you just wanted the seconds part.

Most uses of time.tv_sec now uses the new variable time_second instead.

gettime() changed to getmicrotime(0.

Remove a couple of unneeded splfoo() protections, the new getmicrotime()
is atomic, (until Bruce sets a breakpoint in it).

A couple of places needed random data, so use read_random() instead
of mucking about with time which isn't random.

Add a new nfs_curusec() function.

Mark a couple of bogosities involving the now disappeard time variable.

Update ffs_update() to avoid the weird "== &time" checks, by fixing the
one remaining call that passwd &time as args.

Change profiling in ncr.c to use ticks instead of time.  Resolution is
the same.

Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call
hzto() which subtracts time" sequences.

Reviewed by:	bde
1998-03-30 09:56:58 +00:00
Eivind Eklund
303b270b0a Staticize. 1998-02-09 06:11:36 +00:00
Eivind Eklund
7b778b5e61 Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.
This introduce an xxxFS_BOOT for each of the rootable filesystems.
(Presently not required, but encouraged to allow a smooth move of option *FS
to opt_dontuse.h later.)

LFS is temporarily disabled, and will be re-enabled tomorrow.
1998-01-24 02:54:56 +00:00
Nate Williams
e1d6dc656d This patch causes the "calltodo" timer list to be decremented by the amount
of time that the laptop was suspending.  Thus, select() calls that might have
suspended rather than firing  at 1hr + "time suspended" since the timer was
posted.

Adding:

    options  APM_FIXUP_CALLTODO

to the kernel config enables the patch.

[
This patch was slightly modified to use a consistant indent style and
I removed some unused local variables.  After this has been tested a
few weeks we'll make the options the default, so for now I'm now
documenting it in LINT.  Mike can later if he wants.
]

Reviewed by:	Mike Smith <msmith@freebsd.org>
Submitted by:	Ken Key  <key@cs.utk.edu>
1997-12-23 16:32:35 +00:00
Warner Losh
861570bb45 The Libretto's BIOS doesn't set edx on the APM_GETPWSTATUS call, so
the barrery time remaining is reported as a random number.  Initialize
edx to 0xffff in this case, and to 0 in all other cases.  This change
should be benign on other machines.
Reviewed by:	jdp
1997-12-04 02:40:00 +00:00
John Polstra
56fac9328e Expand the APMIO_GETINFO ioctl to return the estimated remaining
battery time.  For backward compatibility with old binaries, I
assigned a new ioctl number for this call, and retained the old
one as APMIO_GETINFO_OLD.  I also added eight words of padding and
a version field, so that future enhancements won't require jumping
through this hoop again.
1997-11-12 04:12:51 +00:00
Nate Williams
aaa7085e4b - Convert c++ comment to c comment.
Noted by: 	Bruce
1997-11-10 14:38:08 +00:00
Nate Williams
a61408ab2c - Update the email address in the copyrights. 1997-11-04 18:12:51 +00:00
Nate Williams
5796e497dc - If the APM BIOS fails to suspend the system after running the
suspend hooks, run the resume hooks to re-configure the system back
  to where it was.
1997-11-04 17:37:52 +00:00
Nate Williams
a27d2a5ed1 - Back out the last. APM_BROKEN_STATCLOCK doesn't exist in -current. 1997-10-23 04:18:49 +00:00
Nate Williams
7dca87cc4b - If APM_BROKEN_STATCLOCK is defined, make sure the statcloock is
disabled, don't rely on the flags to set it.
1997-10-22 23:04:07 +00:00
Justin T. Gibbs
607e08109a Convert to the new callout interface. 1997-09-21 21:33:10 +00:00
Garrett Wollman
a8da31fc3e Fix crash when halting where APM was configured but not enabled
by checking whether APM is active in apm_power_off() and returning
if not.  (The code was already written with the expectation that
this function would return if it fails.)
1997-06-19 00:25:03 +00:00
Garrett Wollman
dd57c0981c Fix definition of apm_power off (was suffering from cut&paste syndrome). 1997-06-15 02:19:40 +00:00
Garrett Wollman
3f7773458e When APM is configured, turn off the power when halting for good. 1997-06-15 02:03:03 +00:00
Poul-Henning Kamp
015056ae61 Fix embarrasing typo that survived because I applied the wrong patch-
file.
Noticed by:	Eric Jones <ejon@psa.pencom.com>
1997-03-30 09:08:00 +00:00
Poul-Henning Kamp
3d4d8fe94d Sanitize APM a bit. Convert various #ifdef to id_flags instead.
You may want to add "flags 0x31" to apm0 if you have a lousy
implementation.  Read LINT.
1997-03-29 11:07:12 +00:00
Poul-Henning Kamp
0a07eccfdd Try to talk to the APM BIOS with version 1.2 if possible. 1997-03-28 18:38:19 +00:00
KATO Takenori
d025bca112 Makefile generates boths IBM-PC and PC-98 version of object code in
apm_init.inc.  The PC-98 version of object is included in `#ifdef
PC98'.

Pointed-out by:	URATA Shuichiro <s-urata@nmit.tmg.nec.co.jp>
1997-03-09 16:46:05 +00:00
Peter Wemm
6875d25465 Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.
1997-02-22 09:48:43 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Nate Williams
58eb96aa43 > The extra include of <sys/time.h> is because apm uses microtime() and my
> <sys/param.h> doesn't include <sys/time.h>
>
> I removed the NAPM check since it's wasteful to check twice.  apmprobe()
> checks the unit number, and that's the right check.

Submitted by:	bde
1997-01-07 15:36:34 +00:00
Nate Williams
16d2ae1333 - Cleanup up the driver (remove un-needed parameters, white-space,
etc..), plus add a better display suspend function.
- Changed the Copyright's to reflect the new 'jp.FreeBSD.org' email
  address.

Submitted by:	nate & HOSOKAWA, Tatsumi <hosokawa@jp.FreeBSD.org>
1997-01-06 06:02:03 +00:00
Nate Williams
db81a742b3 APM_DSVALUE_BUS is no longer with the addition of the correct fix to
machdep.c.  We no longer walk on the data segment the BIOS sets up.
1996-09-07 17:41:22 +00:00
Poul-Henning Kamp
bfbb029d87 Remove devconf, it never grew up to be of any use. 1996-09-06 23:09:20 +00:00
Bruce Evans
5eba77c97c Use (full) <> paths instead of ambiguous "" paths for headers not in
the current directory.
1996-08-28 17:54:17 +00:00
Nate Williams
68753bffb7 Add some comments explaining what APM_DSVALUE_BUG does no that I know
what it does and why it's needed.  Now I have to figure out how to fix
the bug. :)

[ No functional changes ]
1996-07-11 16:35:12 +00:00
Nate Williams
6774cdb846 Whee. Fix two bugs which ended up cancelling each other out.
apm_setup.s was storing apm_cs16_base and apm_cs32_base addresses in
each others slots, and apm.c was reversing the result so the bugs
cancelled out, but the code looked wrong.

No functional differences unfortunately.

Submitted by:	dave edmondson <davided@sco.com>
1996-07-10 15:09:48 +00:00
Bruce Evans
9b2b0822b7 Removed unused #includes of <i386/isa/icu.h> and <i386/isa/icu.h>. icu.h
is only used by the icu support modules and by a few drivers that know
too much about the icu (most only use it to convert `n' to `IRQn').  isa.h
is only used by ioconf.c and by a few drivers that know too much about
isa addresses (a few have to, because config is deficient).
1996-06-18 01:22:40 +00:00
Nate Williams
e78325798b Freudian slip. Change M_DEVBUG -> M_DEVBUF.
Submitted by:	 "Stephen F. Combs" <combssf@salem.ge.com>
1996-06-04 17:50:28 +00:00
Nate Williams
f421018241 Fix typo. in the APM_DSVALUE_BUG code that I missed.
Obtained from:	Someone on the mailing list (sorry, I forgot who)
1996-06-04 17:37:46 +00:00
Nate Williams
2922666380 - This code adds some backwards compatability hacks for buggy APM BIOS
implementations, and synchronizes us with the Nomad's latest code.

This code is based on the Nomad code, but heavily hacked by me.

Reviewed by:	phk
Submitted by:	the 'Nomads'
1996-04-23 19:59:14 +00:00