Commit Graph

1910 Commits

Author SHA1 Message Date
Doug Rabson
3bfc7e5928 Remove fd driver from its old home and change files which include rtc.h
to account for its new location.
1999-05-31 18:36:14 +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
Doug Rabson
8b05278ca1 Allow up to 8 ports, 4 memory regions and two irqs and drqs. 1999-05-30 11:05:39 +00:00
Doug Rabson
319e3d3049 Activate/deactivate resources by calling the method, not through the
resource manager automatic handling of RF_ACTIVE.
1999-05-30 10:50:57 +00:00
Poul-Henning Kamp
6deb5a62cc Stop the TSC from being used as timecounter on K5/step0 machines. 1999-05-29 06:57:55 +00:00
Bruce Evans
b50641ef9c Fixed glitches (jumps) of about 1/HZ seconds for the i8254 timecounter.
The old version only worked right when the time was read strictly
more often than every 1/HZ seconds, but we only guarantee reading
it every (1/HZ + epsilon) seconds.  Part of rev.1.126-1.127 attempted
to fix this but didn't succeed.  Detect counter rollover using the
heuristic from the old version of microtime() with additional
complications for supporting calls from fast interrupt handlers.
This works provided i8254 interrupts are not delayed by more than
1/(2*HZ) seconds.

This needs more comments, and cleanups for the SMP case, and more
testing of the SMP case before it is merged into RELENG_3.

Tested by:		jhay
1999-05-28 14:08:59 +00:00
Alan Cox
72e51821d7 pmap_object_init_pt:
The size of vm_object::memq is vm_object::resident_page_count,
	not vm_object::size.
1999-05-28 05:38:56 +00:00
John Birrell
4d562a18fc - Make setroot() conditional on FFS etc, to avoid a compiler warning
on systems with no FFS.
- Remove all references to mfs from cpu_rootconf(). mfs_init is
  called prior to cpu_rootconf(), so it can set mountrootfsname to mfs
  and (more imporantly) set rootdev using the (bogus in Bruce's opinion)
  special major number of 255.
1999-05-24 00:30:49 +00:00
Doug Rabson
a3be63b3ce * Factor out the common code between the isa bus drivers for i386 and alpha.
* Re-work the resource allocation code to use helper functions in subr_bus.c.
* Add simple isa interface for manipulating the resource ranges which can be
  allocated and remove the code from isa_write_ivar() which was previously
  used for this purpose.
1999-05-22 15:18:28 +00:00
Peter Wemm
2b5be3fad4 Recover from removing the last (unshared) interrupt handler.
PR:		11806
Submitted by:	Assar Westerlund <assar@sics.se>
1999-05-22 09:39:31 +00:00
Bill Paul
ab431312b4 This commit adds driver support for PCI fast ethernet cards based on the
ADMtek AL981 "Comet" chipset. The AL981 is yet another DEC tulip clone,
except with simpler receive filter options. The AL981 has a built-in
transceiver, power management support, wake on LAN and flow control.
This chip performs extremely well; it's on par with the ASIX chipset
in terms of speed, which is pretty good (it can do 11.5MB/sec with TCP
easily).

I would have committed this driver sooner, except I ran into one problem
with the AL981 that required a workaround. When the chip is transmitting
at full speed, it will sometimes wedge if you queue a series of packets
that wrap from the end of the transmit descriptor list back to the
beginning. I can't explain why this happens, and none of the other tulip
clones behave this way. The workaround this is to just watch for the end
of the transmit ring and make sure that al_start() breaks out of its
packet queuing loop and waiting until the current batch of transmissions
completes before wrapping back to the start of the ring. Fortunately, this
does not significantly impact transmit performance.

This is one of those things that takes weeks of analysis just to come
up with two or three lines of code changes.
1999-05-21 04:37:48 +00:00
Nick Hibma
f26c33d249 usbdi.h:
Implement priorities.
GENERIC, LINT, files:
        Remove remarks about ordering of device names.
GENERIC, LINT:
        Sort the devices alphabetically in LINT and GENERIC.
1999-05-20 20:02:37 +00:00
Peter Wemm
8dc26439da Move pcibus (host -> pci bus) probe/attach routines from nexus
to pcibus.c.  pci_cfgopen() becomes static and there are no more
bus #ifdef's in nexus.c.
1999-05-18 20:48:43 +00:00
Alan Cox
88b67a96af pmap_qremove:
Eliminate unnecessary TLB shootdowns.
1999-05-18 06:01:49 +00:00
Peter Wemm
2f2ffb8d2c Don't hardcode IRQ 13 for NPX. It's as good as hardwired in the hardware
though, on systems (386 mostly) that still have a seperate fpu, but it
might be possible to find systems where the FPU coprocessor is wired to
a different IRQ pin.
1999-05-15 17:58:58 +00:00
Doug Rabson
6c2e3dde8c * Define a new static method DEVICE_IDENTIFY which is called to add device
instances to a parent bus.
* Define a new method BUS_ADD_CHILD which can be called from DEVICE_IDENTIFY
  to add new instances.
* Add a generic implementation of DEVICE_PROBE which calls DEVICE_IDENTIFY
  for each driver attached to the parent's devclass.
* Move the hint-based isa probe from the isa driver to a new isahint driver
  which can be shared between i386 and alpha.
1999-05-14 11:22:47 +00:00
David E. O'Brien
282462f969 Add the `xe' Xircom PC Card driver. 1999-05-14 03:57:25 +00:00
Bruce Evans
4daefb91bf Renamed the private copies of strlen and strcpy to gdb_strlen and
gdb_strcpy, respectively.  This saves fixing the wrong return type
of the private strlen and makes the addresses of strlen and strcpy
unambiguous.
1999-05-13 07:34:25 +00:00
Luoqi Chen
0f0fe5a4c5 Unbreak VESA on SMP. 1999-05-12 21:39:07 +00:00
Luoqi Chen
2ee16532b6 VM86_FRAMESIZE is now the size of vm86 frame, not the number of 4-byte words.
Requested by:	Bruce
1999-05-12 21:30:51 +00:00
Poul-Henning Kamp
02342b0cfe Fix dumpon. It passes a udev_t from userland to kernel, that needs a
udev2dev() before we use it.

It really should pass a name like swapon does.
1999-05-12 07:40:50 +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
Luoqi Chen
cd121c9cae Yet another place I missed when increasing trapframe size, which causes problem
to SIGFPE handling.

Reviewed by:	Bruce Evans	<bde@zeta.org.au>
1999-05-11 16:29:21 +00:00
Luoqi Chen
fcfe0b7b48 Do not hardcode size of struct vm86frame.
Submitted by:	Jonathan Lemon <jlemon@americantv.com>
1999-05-11 16:04:40 +00:00
Doug Rabson
41787a353d Add missing suspend/resume methods. 1999-05-10 17:56:23 +00:00
Peter Wemm
7f2d5fc4f2 Move the mfs_getimage() prototype to mfs_extern.h duplicating it
everywhere.
1999-05-10 17:12:45 +00:00
Bruce Evans
149c3aa60a [Forgot to commit this in the batch a few days ago.]
Fixed profiling of elf kernels.  Made high resolution profiling compile
for elf kernels (it is broken for all kernels due to lack of egcs support).

Renaming of many assembler labels is avoided by declaring by declaring
the labels that need to be visible to gprof as having type "function"
and depending on the elf version of gprof being zealous about discarding
the others.  A few type declarations are still missing, mainly for SMP.

PR:		9413
Submitted by:	Assar Westerlund <assar@sics.se> (initial parts)
1999-05-10 10:51:25 +00:00
Peter Wemm
45d84a2db3 Clean out some unused leftovers from before the split from the old isa.c. 1999-05-09 23:56:00 +00:00
Peter Wemm
3bab4ac5a1 For what it's worth, idelayed is declared as a volatile in the headers,
and even though it's not used in this file make it a volatile here too.
1999-05-09 23:32:29 +00:00
Peter Wemm
0264a0ebd1 loadandclear() uses an atomic instruction (even on SMP, where it's an
implicitly LOCK'ed instruction), so there shouldn't be any harm in making
it volatile pointer compatable for one of the users of it.  It seems to
generate the same code regardless.
1999-05-09 23:30:01 +00:00
Peter Wemm
18c3dd1745 s/main/mi_startup/ for the kernel entry point so that egcs doesn't get
upset about it (and generate things like __main() calls that are reserved
for main()).  Renaming was phk's suggestion, but I'd already thought about
it too.  (phk liked my suggested name tada() but I decided against it :-)

Reviewed by:	phk
1999-05-09 19:01:49 +00:00
Poul-Henning Kamp
aa713cb898 Oops. If ROOTDEVNAME isn't defined, have -r call -a. 1999-05-09 16:56:09 +00:00
Poul-Henning Kamp
b307e58fc7 Major lobotomy of config(8). The
config kernel mumble mumble

line has been obsoleted and removed and with it went all knowledge of
devices on the part of config.

You can still configure a root device (which is used if you give
the "-r" flag) but now with an option:

        options         ROOTDEVNAME=\"da0s2e\"

The string is parsed by the same code as at the "boot -a" prompt.

At the same time, make the "boot -a" prompt both more able and more
informative.

ALPHA/PC98 people:  You will have to adapt a few simple changes
(defining rootdev and dumpdev somewhere else) before config works
for you again, sorry, but it's all in the name of progress.
1999-05-09 16:46:01 +00:00
Poul-Henning Kamp
3000820ae0 add some amount of sanity to the way the gdb stuff finds its device.
I'm not too happy about the result either, but at least it has less
chance of backfiring.

This particular feature could be called "a mess" without offending
anybody.
1999-05-09 10:51:13 +00:00
Poul-Henning Kamp
33525517b5 Duh, bdevsw() takes dev_t arg. 1999-05-09 07:56:36 +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
Peter Wemm
0bbd01ea13 Add some notes about the globalness of certain things like interrupts
and ISA DMA channels (ie: on most PCI systems, they are not.. they are
on the ISA side of the PCI-ISA bridge and could be duplicated if there
were multiple PCI-ISA bridges, say in a laptop docking station), while
the APIC resources would be global on SMP systems.
Also, revert a previous change, change some printfs back to panics.
1999-05-08 21:34:34 +00:00
Peter Wemm
14d3b6b80c GC some #if 0 junk 1999-05-08 21:28:39 +00:00
Peter Wemm
f98661016d Don't print 'interrupting at irq nn' on the x86 family, it's not all
that big a deal just yet and isn't worth a whole line on the boot screen.
This could change later in the face of multi-ISA-bus (eg: laptop docking
stations with two independent ISA busses) and SMP/APIC systems.  The Alpha
already has multiple interrupt destinations to deal with.
1999-05-08 20:24:44 +00:00
Peter Wemm
1a738e4be7 Look up the sensitive flag better, allowing interoperation between old and
new isa drivers with sensitive flags.  If the resource_find() code
is meant to "find" the wildcard sensitive flag for a driver even though
a unit is supplied, this can be simplified.
1999-05-08 18:15:49 +00:00
Peter Wemm
df5c783c68 Fix unused variable "flags". (only used if #ifdef I586_CPU) 1999-05-08 18:14:09 +00:00
Peter Wemm
9c06a38614 Make sure the mem_range_AP_init() prototype is seen where it's needed, and
#ifdef SMP around it for fun.
1999-05-08 17:48:22 +00:00
Poul-Henning Kamp
4be2eb8c49 I got tired of seeing all the cdevsw[major(foo)] all over the place.
Made a new (inline) function devsw(dev_t dev) and substituted it.

Changed to the BDEV variant to this format as well: bdevsw(dev_t dev)

DEVFS will eventually benefit from this change too.
1999-05-08 06:40:31 +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
Kirk McKusick
e244fe31d6 Generalize to allow any serial port to be used as the GDB port.
Mark the GDB port in the config file with flags 0x80. Currently
only the sio driver checks these flags and sets up a GDB port,
but adding similar code to other serial drivers would be easy.
For backward compatibility, if an sio port is marked as the console
and no port is marked as the gdb port, the GDB port will be mapped
to the console port. This hack should go away at some point.
1999-05-07 06:50:41 +00:00
Peter Wemm
94f9940a0c Ensure prototype for pnp_configure() is visible. 1999-05-06 22:16:19 +00:00
Peter Wemm
dfd5dee1b0 Add sufficient braces to keep egcs happy about potentially ambiguous
if/else nesting.
1999-05-06 18:13:11 +00:00
Peter Wemm
97bf178703 I'm not sure why the #ifdef SMP became #if 1 (this overrode the npx probe
and always succeeded as is required on SMP).  Anyway, reverting this
still compiles and appears ok.
1999-05-06 12:47:21 +00:00
Bruce Evans
ea2b3e3d1b Fixed profiling of elf kernels. Made high resolution profiling compile
for elf kernels (it is broken for all kernels due to lack of egcs support).

Renaming of many assembler labels is avoided by declaring by declaring
the labels that need to be visible to gprof as having type "function"
and depending on the elf version of gprof being zealous about discarding
the others.  A few type declarations are still missing, mainly for SMP.

PR:		9413
Submitted by:	Assar Westerlund <assar@sics.se> (initial parts)
1999-05-06 09:44:57 +00:00