Commit Graph

136 Commits

Author SHA1 Message Date
Mark Murray
fb919e4d5a Undo part of the tangle of having sys/lock.h and sys/mutex.h included in
other "system" header files.

Also help the deprecation of lockmgr.h by making it a sub-include of
sys/lock.h and removing sys/lockmgr.h form kernel .c files.

Sort sys/*.h includes where possible in affected files.

OK'ed by:	bde (with reservations)
2001-05-01 08:13:21 +00:00
Peter Wemm
37c9e8eebd Typo fix. s/criticale_t/critical_t/ 2001-03-28 14:54:28 +00:00
John Baldwin
0006681fe6 Switch from save/disable/restore_intr() to critical_enter/exit(). 2001-03-28 03:06:10 +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
Jonathan Lemon
608a3ce62a Extend kqueue down to the device layer.
Backwards compatible approach suggested by: peter
2001-02-15 16:34:11 +00:00
Mark Murray
d888fc4e73 RIP <machine/lock.h>.
Some things needed bits of <i386/include/lock.h> - cy.c now has its
own (only) copy of the COM_(UN)LOCK() macros, and IMASK_(UN)LOCK()
has been moved to <i386/include/apic.h> (AKA <machine/apic.h>).
Reviewed by:	jhb
2001-02-11 10:44:09 +00:00
John Baldwin
16d92c70f1 Revert the spin mutex for the cy(4) driver.
Requested by:	bde
2001-02-09 22:37:24 +00:00
John Baldwin
6221adac84 - Use a spin mutex instead of COM_LOCK, since COM_LOCK is going away.
The same name from the sio(4) driver was used and an appropriate
  dictionary item added at the top to reduce diffs.
- Catch up to the new swi API.
2001-02-09 17:55:32 +00:00
Bruce Evans
c1ac98a632 Converted to new-bus.
Reviewed by:	imp
2001-02-01 09:49:57 +00:00
Bruce Evans
a89bda90b1 Added used include of <sys/mutex.h>. The SMP case was broken by
incompletely converting simplelocks to mutexes (COM_LOCK() is supposed
to hide the SMP locking internals, but it now depends on mutex interfaces
being visible).
2001-01-30 17:05:58 +00:00
Peter Wemm
d42df83312 Disable cy - it is now completely broken and needs non-trivial work. 2001-01-25 01:56:27 +00:00
Peter Wemm
8c2956e18d Special case for compiling LINT - just give a warning and continue on.
At least we have a chance at getting test compile coverage for the rest
of the kernel now.
2001-01-17 00:47:46 +00:00
David Malone
7cc0979fd6 Convert more malloc+bzero to malloc+M_ZERO.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
2000-12-08 21:51:06 +00:00
Poul-Henning Kamp
cf9fa8e725 Move suser() and suser_xxx() prototypes and a related #define from
<sys/proc.h> to <sys/systm.h>.

Correctly document the #includes needed in the manpage.

Add one now needed #include of <sys/systm.h>.
Remove the consequent 48 unused #includes of <sys/proc.h>.
2000-10-29 16:06:56 +00:00
John Baldwin
49e0078b0f - Catch up to new software interrupt code.
- Add a missing curly brace.

Noticed by:	phk
2000-10-25 21:13:42 +00:00
John Baldwin
8088699f79 - Overhaul the software interrupt code to use interrupt threads for each
type of software interrupt.  Roughly, what used to be a bit in spending
  now maps to a swi thread.  Each thread can have multiple handlers, just
  like a hardware interrupt thread.
- Instead of using a bitmask of pending interrupts, we schedule the specific
  software interrupt thread to run, so spending, NSWI, and the shandlers
  array are no longer needed.  We can now have an arbitrary number of
  software interrupt threads.  When you register a software interrupt
  thread via sinthand_add(), you get back a struct intrhand that you pass
  to sched_swi() when you wish to schedule your swi thread to run.
- Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit
  more intuitive.  Also, prefix all the members of struct intrhand with
  'ih_'.
- Make swi_net() a MI function since there is now no point in it being
  MD.

Submitted by:	cp
2000-10-25 05:19:40 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Bruce Evans
00d8d16417 Don't depend on <machine/cpufunc.h> unnecessarily including <machine/lock.h>. 2000-10-12 16:15:24 +00:00
Bruce Evans
db8ec2a244 Use schedsofttty() again (SMPng casualty with intentionally wrong fix
in rev.1.101).

Made this file compile again after move of stuff from <machine.ipl.h>
to <sys/ipl.h>.
2000-10-08 14:37:39 +00:00
Poul-Henning Kamp
2404c3f99d Make LINT link.
cy driver is broken post SMPng.
2000-09-16 19:04:24 +00:00
Poul-Henning Kamp
3045b21279 Make LINT compile. 2000-09-16 18:48:11 +00:00
Poul-Henning Kamp
574abd2926 Make LINT compile again. 2000-09-16 18:46:05 +00:00
Jason Evans
0384fff8c5 Major update to the way synchronization is done in the kernel. Highlights
include:

* Mutual exclusion is used instead of spl*().  See mutex(9).  (Note: The
  alpha port is still in transition and currently uses both.)

* Per-CPU idle processes.

* Interrupts are run in their own separate kernel threads and can be
  preempted (i386 only).

Partially contributed by:	BSDi (BSD/OS)
Submissions by (at least):	cp, dfr, dillon, grog, jake, jhb, sheldonh
2000-09-07 01:33:02 +00:00
Peter Wemm
6a4c2576dc Mass update of isa drivers using compatability shims to use
COMPAT_ISA_DRIVER() so that we can get rid of the evil isa_compat.h table.
2000-05-28 13:40:48 +00:00
Warner Losh
d0d3b8345b Ahhrggg. Put the test for the compat shims AFTER the file that includes
them.

Pointed out by: bde
2000-03-27 20:24:02 +00:00
Warner Losh
76fbc068b8 Per conversations in -current, add #error to these drivers when you don't
have the right compatibility shims enabled.  ISA drivers to follow later.
2000-03-27 18:32:45 +00:00
Peter Wemm
1816634e49 Clean up some more loose ends..
isa_device->id_ri_flags and RI_FAST were not implemented and did nothing.
The two drivers that were mistakenly thinking this was working were
cy.c and loran.c - these should be converted to newbus.
GC (garbage collect) isa_device->id_alive
GC userconfig.c references to isa_device->id_scsiid (!).
2000-01-23 11:50:43 +00:00
Poul-Henning Kamp
1ab305ef60 Introduce ttyread() and ttywrite() which do the canonical thing.
Use them in many tty drivers.

Reviewed by: julian, bde
1999-09-28 11:45:31 +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
Poul-Henning Kamp
ae8e1d08d7 This patch clears the way for removing a number of tty related
fields in struct cdevsw:

        d_stop          moved to struct tty.
        d_reset         already unused.
        d_devtotty      linkage now provided by dev_t->si_tty.

These fields will be removed from struct cdevsw together with
d_params and d_maxio Real Soon Now.

The changes in this patch consist of:

        initialize dev->si_tty in *_open()
        initialize tty->t_stop
        remove devtotty functions
        rename ttpoll to ttypoll
        a few adjustments to these changes in the generic code
        a bump of __FreeBSD_version
        add a couple of FreeBSD tags
1999-09-25 16:21:39 +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
9929d2a045 Eliminate a bunch of #include "pci.h" and #if NPCI > 0 around entire
files.  config will leave the whole file out if configured to do so.
1999-07-03 20:17:08 +00:00
Bruce Evans
216b6d2da0 Really fix cy-driver-related panics when SMP is configured. Rev.1.88 only
fixed half the problem.

Tested by:	Michael Scott Boers <mboers@datacompusa.com>
1999-06-04 18:13:25 +00:00
Poul-Henning Kamp
2447bec829 Simplify cdevsw registration.
The cdevsw_add() function now finds the major number(s) in the
struct cdevsw passed to it.  cdevsw_add_generic() is no longer
needed, cdevsw_add() does the same thing.

cdevsw_add() will print an message if the d_maj field looks bogus.

Remove nblkdev and nchrdev variables.  Most places they were used
bogusly.  Instead check a dev_t for validity by seeing if devsw()
or bdevsw() returns NULL.

Move bdevsw() and devsw() functions to kern/kern_conf.c

Bump __FreeBSD_version to 400006

This commit removes:
        72 bogus makedev() calls
        26 bogus SYSINIT functions

if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.

I4b and vinum not changed.  Patches emailed to authors.  LINT
probably broken until they catch up.
1999-05-31 11:29:30 +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
Bruce Evans
4011dfccd2 Don't call disable_intr() when interrupts are already disabled, since
disable_intr() does non-recursive locking in the SMP case.  This should
fix cy-driver-related panics when SMP is configured.

Broken in:	rev.1.73 (3.1 and -current)
1999-05-28 13:23:21 +00:00
Bruce Evans
7a9757f3a5 Detect PCI device IDs for latest boards. Simplified the ID comparisons.
Submitted by:	Ivan Passos <ivan@cyclades.com> (rewritten by me)
1999-05-10 10:23:40 +00:00
Peter Wemm
579f45fa60 Simplify the COMPAT_PCI_DRIVER/DATA_SET hack. We can add:
#define COMPAT_PCI_DRIVER(name,data) DATA_SET(pcidevice_set,data)
.. to 2.2.x and 3.x if people think it's worth it.  Driver writers can do
this if it's not defined.  (The reason for this is that I'm trying to
progressively eliminate use of linker_sets where it hurts modularity and
runtime load capability, and these DATA_SET's keep getting in the way.)
1999-05-09 17:07:30 +00:00
Peter Wemm
dacc95aa33 Make this compile with CY_PCI_FASTINTR again. 1999-05-02 20:42:13 +00:00
Poul-Henning Kamp
f711d546d2 Suser() simplification:
1:
  s/suser/suser_xxx/

2:
  Add new function: suser(struct proc *), prototyped in <sys/proc.h>.

3:
  s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/

The remaining suser_xxx() calls will be scrutinized and dealt with
later.

There may be some unneeded #include <sys/cred.h>, but they are left
as an exercise for Bruce.

More changes to the suser() API will come along with the "jail" code.
1999-04-27 11:18:52 +00:00
Peter Wemm
96b3554e5c Use COMPAT_PCI_DRIVER() for registration if it exists. This shouldn't
hurt the driver portability to 3.x too much for where drivers are shared.
1999-04-24 20:17:05 +00:00
Alexander Langer
9b0f83b7fb Added missing newline to "no ports found!" message. 1999-04-15 00:13:20 +00:00
Bruce Evans
89955e6330 YAMFsio.c (1.227-1.228: set up input buffering dynamically). 1999-02-04 15:54:02 +00:00
Poul-Henning Kamp
4e2d2aa1cd Use suser() to check for super user rather than examining cr_uid directly.
Use TTYDEF_SPEED rather than 9600 a couple of places.

Reviewed by:	bde, with a few grumbles.
1999-01-30 12:17:38 +00:00
Matthew Dillon
0a5e03dda5 Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
1999-01-28 01:59:53 +00:00
Bruce Evans
b8cf6ea776 Use a fast interrupt handler for the PCI version of the cy driver
if option CY_PCI_FASTINTR is configured and mapping the irq to a
fastintr is possible.  Unfortunately, this has to be optional because
pci_map_int_right() doesn't handle the INTR_EXCL flag right --
INTR_EXCL is honoured even if the interrupt needs to be non-exclusive
for other devices to work.
1999-01-15 10:00:12 +00:00
Bruce Evans
8ff0acffb3 Fixed minor style bugs in previous commit. 1999-01-11 23:43:54 +00:00
Bruce Evans
443f91618b Updated for not-so-new version of Cyclom-Y PCI boards (with a custom
register for the PLX id).  Merge the vendor's modification of the 2.2.*
release version into -current for reference.  Will be cleaned up in next
commit.

Obtained from:	ftp://ftp.cyclades.com/pub/cyclades/cyclom-y/freebsd/3.0/cyy30.tar.gz
1999-01-11 23:35:01 +00:00
Bruce Evans
2a32c15f45 Unspammed includes in <machine/cpufunc.h> in the !SMP case. Partially
unspammed them in the SMP case.
1999-01-08 19:17:49 +00:00