Commit Graph

1274 Commits

Author SHA1 Message Date
Joerg Wunsch
e5bf458f52 Remove the "no board found at" message, ia rather similar message with
the same information is printed one line below by the generic isa code
anyway.
1996-01-25 23:00:42 +00:00
Andrey A. Chernov
887c00b859 Change RUKEYMAP sligtly 1996-01-25 16:37:20 +00:00
Poul-Henning Kamp
e8cbe8fa47 Avoid local sprintfs and other printf'isms. 1996-01-25 07:21:50 +00:00
Poul-Henning Kamp
1ce9bf88c3 Use new printf features rather than local kludges. 1996-01-24 21:12:23 +00:00
Joerg Wunsch
7a8a029a66 Hide the probe warnings behind `bootverbose'. 1996-01-23 22:55:08 +00:00
Poul-Henning Kamp
c92a064d21 Reinstate AUTO_EOI_1. This did break suspend/resume on some portables.
In particular mine.  We may want to make it a negative option to
keep GENERIC sane, ie NO_AUTO_EOI_1.
1996-01-19 23:38:07 +00:00
Andrey A. Chernov
d9983e87e7 Fix buffer sizes calculation looking into new Linux driver.
Save 112K for SB, 64K for PAS and 64K for MSS.
Since PAS use SB emulation, 176K normally saved for it.
Few minor optimizations added like in Linux driver.
1996-01-18 20:54:15 +00:00
Andrey A. Chernov
e4ff5c2aef Workaround missing interrupts - dma_reset on them (when timeout occurse).
When you start tracker and produce some heavy disk activity,
output interrupts becomes lost and I don't know how to solve it
finally. Newly added code at least allows recovery after timeout.
1996-01-17 05:43:38 +00:00
Poul-Henning Kamp
7c145fea92 Use the new & improved printf rather than homegrown kludges.
Proposed by: bde
1996-01-16 18:13:18 +00:00
Andrey A. Chernov
5ce1b6a98e Small modification to my prev change:
1) set aborting flags for all signals because tsleep exited
not by timeout and not by wakeup.
2) Simplify expression.
1996-01-16 12:29:37 +00:00
Andrey A. Chernov
d352655d7e 1) Fix comments: 386bsd -> FreeBSD, some other wrong info.
2) Use CURSIG(curproc) in PROCESS_ABORTING instead of junk code was there.
3) Reanimate timeout code in DO_SLEEP by setting WK_TIMEOUT flag
   which is never set in old code.
4) DO_SLEEP: set aborting flag on interrupting singnals as supposed, not
   on signals which do nothing as in old code.
5) Cleanup WAKE_UP macro, WK_WAKEUP not used.
6) Remove wrong typecasts in sleep/wakeup code.
1996-01-16 10:19:23 +00:00
Andrey A. Chernov
d85314fa5f Since new bcd* macros not argument range overflow resistant,
fix argument overflow for years >= 2000
1996-01-16 06:35:40 +00:00
Andrey A. Chernov
2b20999cd6 sleep/wakeup macros was designed to do it on random address in the stack.
This random address can be matched (with some probability) with another
sleep addresses from other drivers, which can cause strange sleep/wakeup
sequence. Rewrite this ugly code to do the right thing.
1996-01-16 06:07:09 +00:00
Poul-Henning Kamp
791d77e0dd Get rid of two and a half printf in the kernel.
Add more features to the one remaining to handle the job:
	+	signed quantity.
	#	alternate format
	-	left padding
	*	read width as next arg.
	n	numeric in (argument specified) default radix.

Fix the DDB debugger to use these.
Use vprintf in debug routine in pcvt.

The warnings from gcc may become more wrong and  intolerable because
of this.

Warning:  I have not checked the entire source for unsupported or
changed constructs, but generally belive that there are only a few.

Suggested by: bde
1996-01-15 22:41:03 +00:00
Poul-Henning Kamp
3eb50b2edd My wife is busy making me a new conical hat, so you don't need to
send any to me this time.  Commited an old copy of this files where
the tables were swapped.  Duh!.
1996-01-15 21:26:43 +00:00
Poul-Henning Kamp
e95fbcfeb4 Soren called an said that I screwed up badly, so I backup until
I find out how... Sorry.
1996-01-15 21:12:50 +00:00
Poul-Henning Kamp
22d1e589b8 Remove some unused vars, use new hex2ascii macro. 1996-01-15 16:15:27 +00:00
Poul-Henning Kamp
2898c294f4 Make bin2bcd and bcd2bin global macroes instead of having local
implementations all over the place.
1996-01-15 10:28:44 +00:00
Bruce Evans
56ee67a3ff Fixed renaming of private DEBUG macro. The previous revision missed
one case in asc.c and almost all cases in gsc.c.
1996-01-13 20:43:10 +00:00
Bruce Evans
f668341de4 Fixed handling of Feb 29 in resettodr(). 1996-01-12 17:33:12 +00:00
Bill Paul
ad7b4f8d41 Fix the 'extraneous newline' problem a little more sensibly: just taking
it out fixes my problem but hoses the GUS MAX probe messages. Check what
device we have and print things appropriately for each.

Pointed out by: Jim Lowe <james@miller.cs.uwm.edu>
1996-01-09 03:19:51 +00:00
Peter Wemm
ad4f967485 clean up si_dprintf a bit so that it uses vararg argument parsing that does
not cause warnings, and uses printf() to do a vprintf()-like output.
1996-01-09 03:01:45 +00:00
Andrey A. Chernov
dc3f9062ca Replace ugly year/month calculations in resettodr to more clean
variants, idea taken from NetBSD clock.c.
At least year calculation was wrong, pointed by Bruce.
Use different strategy to store year for BIOS without RTC_CENTURY
1996-01-08 18:50:14 +00:00
Joerg Wunsch
bc64d5dbed MTRETENS for the wt driver. This patch got lost with
my previous commit.
1996-01-08 12:46:15 +00:00
Justin T. Gibbs
d026722aff Use the new adapter_softc field in the scsi_link structure so that
in the future, these drivers won't need to maintain an array of
configured units. They still need to because ISA interrupt handlers
take a unit number. :(

Pass "softc" pointers instead of unit numbers to many functions that
did a conversion of unit->softc anyway.
1996-01-07 19:22:39 +00:00
Bill Paul
0c83bb499c Add NMSS to the list of things that local.h checks for when decding
whether of not to automatically #define EXCLUDE_AUDIO; MSS is a real
audio device and we should not #define EXCLUDE_AUDIO if we have one.
(And I want it because it's the only mixer-capable audio driver that I
can use with my crummy Packard Bell (nee Aztech) audio board.)

This fixes the very confusing condition where having all of this:

mss0 at 0x530 irq 10 drq 1 on isa
gus0: <MS Sound System (CS4231)>
opl0 at 0x388 on isa
opl0: <Yamaha OPL-3 FM>
mpu0 at 0x300 irq 9 drq 0 on isa
mpu0: <MPU-401 MIDI Interface 0.0 >

will still give you this:

% cat /dev/sndstat
SoundCard Error: The soundcard system has not been configured

Also remove an unnecessary newline in the printf() message for the
'gus0' device shown above so that we don't wind up printing a blank
line between mss0 and gus0.
1996-01-07 08:12:13 +00:00
Peter Wemm
d92566062f Choose a different name to hold the option definition.. The original one
was overlapping with another file, and making some undesirable behavior a
little worse - it's triggering a bug in config that appears to have been
there for some time (before the options files, anyway.)
1996-01-06 23:10:57 +00:00
Paul Richards
3d019cce2c Added multicast support, currently #ifdef LNC_MULTICAST.
Changed parameter of lnc_watchdog to match what upper levels expect, fixed
a warning.
1996-01-05 19:12:47 +00:00
Garrett Wollman
0e41ee3037 Convert DDB to new-style option. 1996-01-04 21:13:23 +00:00
Garrett Wollman
a73af3a214 convert the math emulation to use the new-style options. 1996-01-04 19:51:50 +00:00
Peter Wemm
876791a6b6 Fix the number of ports created for devfs.. it had been only creating
enough nodes for the number of ports on the last module, not the number
of ports _total_ that the driver is managing...

Submitted by:  Robert Sanders <rsanders@mindspring.com>
1996-01-02 19:39:09 +00:00
Peter Wemm
5c7acd6044 Fix last "fix" - I had introduced a fencepost error.. :-(
Happily pointed out by: julian :-)
1996-01-02 09:20:29 +00:00
Peter Wemm
638c3d07b7 Fix up the DEVFS minor numbers that the Specialix driver registers... 1996-01-02 09:18:07 +00:00
Peter Wemm
a5b996a7ec recording cvs-1.6 file death 1995-12-30 19:02:48 +00:00
Bruce Evans
5c0ea38c00 Restored likely_com_ports[] from rev.1.122 so that Hayes ESP support at
least compiles.
1995-12-30 03:52:58 +00:00
Søren Schmidt
b6bf472318 Fixed a bug with the ATAPI_STATIC option, so it compiles again. 1995-12-29 22:17:12 +00:00
Bruce Evans
912e603778 Implemented non-statistical kernel profiling. This is based on
looking at a high resolution clock for each of the following events:
function call, function return, interrupt entry, interrupt exit,
and interesting branches.  The differences between the times of
these events are added at appropriate places in a ordinary histogram
(as if very fast statistical profiling sampled the pc at those
places) so that ordinary gprof can be used to analyze the times.

gmon.h:
Histogram counters need to be 4 bytes for microsecond resolutions.
They will need to be larger for the 586 clock.
The comments were vax-centric and wrong even on vaxes.  Does anyone
disagree?

gprof4.c:
The standard gprof should support counters of all integral sizes
and the size of the counter should be in the gmon header.  This
hack will do until then.  (Use gprof4 -u to examine the results
of non-statistical profiling.)

config/*:
Non-statistical profiling is configured with `config -pp'.
`config -p' still gives ordinary profiling.

kgmon/*:
Non-statistical profiling is enabled with `kgmon -B'.  `kgmon -b'
still enables ordinary profiling (and distables non-statistical
profiling) if non-statistical profiling is configured.
1995-12-29 15:30:05 +00:00
Bruce Evans
2c28d76196 Oops, this should have been committed with the other Hayes ESP changes. 1995-12-29 13:18:58 +00:00
Bruce Evans
768fd661e4 Added support for the Hayes ESP serial card.
Submitted by:	Sean Eric Fagan (sef@kithrup.com)
Based on code by John Vinopal (banshee@resort.com)
Cosmetic (I hope) changes by me (bde).
1995-12-29 12:51:32 +00:00
Mark Murray
aba89c509d 1) ifdef out some unused functions (for now)
2) improve 586 support
3) add 686 support
4) clean up comments etc
Submitted by:	bde
1995-12-29 08:04:32 +00:00
Peter Wemm
13b6889458 Add the attempted DMA address to the 'DMA beyond end of ISA' message so that
we can see if it's a small distance beyond the end, or way out. This may
give some clues as to whether it is being caused by something coalescing
the transfers in spite of the bounce buffers, or simply because of buffer
corruption.  (The BT driver seems to occasionally get hit by from this too,
except that it does not trap the transfer, and the system panics later
with vm_bounce_page_free.)  This "event" usually happens to me during a
savecore (on the rare occasion that a kernel coredump is actually taken
after a crash - the lack of kernel core dumps is another problem...).
1995-12-29 00:30:06 +00:00
Mark Murray
179c10f92d 1) Add #include <machine/cpu.h> to catch some 586 #defines
2) swap the 2 arguments to outb (kato)
Pointed out by: Kato Takenori <kato@eclogite.eps.nagoya-u.ac.jp>
1995-12-28 17:09:14 +00:00
Andrey A. Chernov
717df65cce Add more disc_optim calls to track line disc changes 1995-12-28 11:58:35 +00:00
Mark Murray
0738b16169 random_machdep.c: New version, also includes revectored interrupts, rather
than hooking permanently.
vector.s:       : Remove the interrupt hook. This is done dynamically, now.
1995-12-27 11:22:05 +00:00
Bruce Evans
337e9f0bd2 Renamed isa/random.c to isa/random_machdep.c to avoid a conflict with
libkern/random.c.
1995-12-26 12:50:24 +00:00
David Greenman
6410f76727 Add Pentium Pro CPU detection and special handling. For now, all the
optimizations we have for 586s also apply to 686s...this will be fine-
tuned in the future as appropriate.
1995-12-24 08:10:52 +00:00
David Greenman
e8636c6c19 Made "AUTO_EOI_1" standard. auto-EOI on the master ICU is a documented
feature of the ICU. auto-EOI on the slave is not safe, however, so it
remains an option. Killed religious FASTER_NOP when writing the ICU.

Reviewed by:	bde
1995-12-23 16:53:57 +00:00
Poul-Henning Kamp
9dc731e563 Typo in my last commit. 1995-12-22 15:52:07 +00:00
Bruce Evans
b3a96d8a4c Renamed private DEBUG macro to avoid warnings when DEBUG is an option. 1995-12-22 15:39:45 +00:00
Bruce Evans
4fa403fb86 Fixed permissions of /dev/pcaudio*. 1995-12-22 15:27:48 +00:00
Bruce Evans
aa67202b2b Fixed arg order in an outb() call. add_timer_randomness() clobbered
part of the DMA channel 0 address and wasn't random in the intended
way.
Submitted by:	KATO Takenori <kato@eclogite.eps.nagoya-u.ac.jp>

Disable interrupts while reading the clock.  This probably isn't
important (allowing interrupts probably increased randomness in
the usual case).

Removed __i386__ ifdef.  This file is in an i386 directory and has
other i386 dependencies.
1995-12-22 15:20:50 +00:00
Bruce Evans
526d7a354a Synced with sio.c. This fixed the DEVFS initialization. cy.c is
supposed to be identical with sio.c for hardware-independent details.
1995-12-22 15:02:22 +00:00
Bruce Evans
bfd6eab381 Fixed bugs introduced in rev. 1.127 (some broken 16650 support was
unintentionally committed):
- the fifo was completely disabled for low speeds.  Apart from being
  unnecessarily inefficient, this invalidated com->tx_fifo_size.
- `ftl' became a bogus name.
- the 16650 probe breaks the COM_NOFIFO() case and has other bugs
  (disabled, not fixed).

Fixed bogus change of the fifo settings for the non-speed of 0.  This
bug made the above fifo bug occur even at non-low speeds.

Fixed the modes of the cua devices.  It isn't possible to set the uid
and gid correctly since the kernel can't know who uucp.dialer is.

Register the devswitch at device attach time.  SYSINIT() is not
the right way to initialize devswitches (if anything :->).
Eventually, the devswitch should be deregistered at device detach
and/or unload time and reregistered at device attach time ...  Then
some com->gone tests could be removed.

Cleaned up some other recent changes.
1995-12-22 14:58:55 +00:00
Poul-Henning Kamp
df85d797f7 Remove crufty "pg" function. 1995-12-22 13:09:39 +00:00
Garrett Wollman
a8178e4bb6 Increase Pentium cyclecounter calibration time to 131072 us. This
experimentally seems to give better results on my machine.
1995-12-20 20:57:33 +00:00
David Greenman
2838c9682a Implemented a (sorely needed for years) double fault handler to catch stack
overflows.
It sure would be nice if there was an unmapped page between the PCB and
the stack (and that the size of the stack was configurable!). With the
way things are now, the PCB will get clobbered before the double fault
handler gets control, making somewhat of a mess of things. Despite this,
it is still fairly easy to poke around in the overflowed stack to figure
out the cause.
1995-12-19 14:30:50 +00:00
Poul-Henning Kamp
27a0b398a7 Staticize.
Unstaticize a function in scsi/scsi_base that was used, with an undocumented
option.
My last count on the LINT kernel shows:
Total symbols:  3647
unref symbols:   463
undef symbols:     4
1 ref symbols:  1751
2 ref symbols:   485
Approaching the pain threshold now.
1995-12-17 21:23:44 +00:00
Bruce Evans
cc3b5b8ba6 Return the i/o size, not a truth value, in the probe. 1995-12-16 21:37:58 +00:00
Bruce Evans
62f84fd1ba One less magic number. 1995-12-16 21:32:19 +00:00
Peter Wemm
15a76dc428 Another shot at getting working si DEVFS entries.. Apparently, it didn't
understand %02d in it's format string...
1995-12-16 14:03:02 +00:00
Bruce Evans
6ea3e9d839 Completed function declarations and/or added prototypes and/or added
#includes to get prototypes.

pci now uses a different interrupt handler type for interrupts that it
dispatches and the isa interrupt handler type for the interrupts that
it handles.
1995-12-16 00:27:59 +00:00
David Greenman
51cdbfcdaf Changed arg type for pio functions.
Cast a few things appropriately to shut up the compiler.
1995-12-15 07:31:40 +00:00
Bruce Evans
0dfe10a65c Completed function declarations and/or added prototypes and/or added
#includes to get prototypes.
1995-12-15 00:54:32 +00:00
Bruce Evans
bfd8f1484e Removed unused #includes. 1995-12-15 00:40:38 +00:00
Bruce Evans
28cc517d85 Removed duplicated #includes of <sys/conf.h> 1995-12-15 00:29:31 +00:00
Bruce Evans
44faa2919b Completed function declarations and added prototypes. Sorted prototypes. 1995-12-15 00:11:27 +00:00
Bruce Evans
d14122ea44 Fixed staticization of DDB functions. 1995-12-14 23:01:51 +00:00
Bruce Evans
d1022821ae Removed my devsw access functions [un]register_cdev() and
getmajorbyname() which were a better (sigh) temporary interface to
the going-away devswitches.

Note that SYSINIT()s to initialize the devswitches would be fatal
in syscons.c and pcvt_drv.c (and are bogus elsewhere) because they
get called independently of whether the device is attached; thus
devices that share a major clobber each other's devswitch entries
until the last one wins.

conf.c:
Removed stale #includes and comments.
1995-12-14 22:03:12 +00:00
Peter Wemm
73852f5e36 Update the skeleton DEVFS code to match reality a little closer.. :-) 1995-12-14 14:29:10 +00:00
Peter Wemm
60f17fcd9f Change the generic "btintr" function's name to "bt_intr" - the same as
all the other bt_XXX() functions in i386/scsi/bt*.

This the important effect of forcing a link error if the user is
still using the old "vector btintr" which is dangerously wrong
after Justin's updates to the driver.

The correct isa vector line for the bt driver is "vector bt_isa_intr".
Justin mentioned this in the commit message and updated LINT and
GENERIC.  This change is to enforce that.. :-)
1995-12-14 14:19:19 +00:00
Poul-Henning Kamp
85f689485d Staticize. 1995-12-13 10:36:03 +00:00
Poul-Henning Kamp
c08c8adcf5 Remove MACH_KERNEL, ORIGINAL, and ZP_DEBUG,
I should have done this before it was imported.
1995-12-13 10:35:36 +00:00
Justin T. Gibbs
09c30e3a1e Isa/VL probe portion of the Buslogic SCSI driver. 1995-12-12 08:50:54 +00:00
Poul-Henning Kamp
94e20eb776 Staticize 1995-12-11 09:26:18 +00:00
John Dyson
983d613468 Undo a change that should not have been committed with the 1Tb enhancements. 1995-12-11 05:02:52 +00:00
John Dyson
a316d390bd Changes to support 1Tb filesizes. Pages are now named by an
(object,index) pair instead of (object,offset) pair.
1995-12-11 04:58:34 +00:00
Bruce Evans
cb8cad01f8 Unstaticized cx_cdevsw (it is used in if_cx.c).
Added a prototype.
1995-12-10 21:08:11 +00:00
Bruce Evans
81ab2caf0a Replaced nxreset by noreset (if the reset function gets called, then the
device must be configured.  It's hard to tell whether a reset function
should be noreset or nullreset since reset functions are never called.
Most drivers use nullreset but noreset has the advantage of complaining
if somehow gets called).
1995-12-10 20:54:38 +00:00
Bruce Evans
26ec204be0 Replaced nxmmap by nommap (if the mmap function gets called, then the
device must be configured).
1995-12-10 20:34:53 +00:00
Bruce Evans
690999827d Replaced scdsize by generic nopsize. 1995-12-10 20:10:23 +00:00
Bruce Evans
4439655d52 Replaced nxdump by nodump (if the dump function gets called, then the
device must be configured, so ENXIO is a bogus errno).

Replaced zerosize by nopsize.  zerosize was a temporary alias.
1995-12-10 19:53:42 +00:00
Bruce Evans
f332b8a1d5 Replaced nxdump by nodump (if the dump function gets called, then the
device must be configured, so ENXIO is a bogus errno).

Replaced zerosize by nopsize.  zerosize was a temporary alias.
1995-12-10 19:44:58 +00:00
Bruce Evans
c73feca0b7 Removed new alias d_size_t for d_psize_t.
Removed old aliases d_rdwr_t and d_ttycv_t for d_read_t/d_write_t and
d_devtotty_t.

Sorted declarations of switch functions into switch order.

Removed duplicated comments and declarations of nonexistent switch
functions.
1995-12-10 15:55:34 +00:00
Poul-Henning Kamp
6f4e0beb7e Staticize and cleanup. 1995-12-10 13:40:44 +00:00
Poul-Henning Kamp
3b0b66ee0e Staticize and cleanup.
Ohh, forgot this bit:
(covers sio.c too) recognize the 16650 too.
1995-12-10 13:40:33 +00:00
Bruce Evans
81c5b5f59a Moved vm includes out of centralized headers again. 1995-12-10 02:53:07 +00:00
Julian Elischer
4d92e19833 clean a few DEVFS things..
fix a bug where you couldn't place devices in the root directory
of devfs

remove deprecated routines

On my machine devfs now shows:
julian@erf.tfs.com:
julian@erf.tfs.com: ls -RF
bpf0            mem             ptypb           spkr            ttyp8
bpf1            null            ptypc           stderr          ttyp9
bpf2            pcaudio         ptypd           stdin           ttypa
bpf3            pcaudioctl      ptype           stdout          ttypb
console         pt              ptypf           tty             ttypc
cuaa0           ptyp0           random          ttyd0           ttypd
cuaia0          ptyp1           rsd0            ttyid0          ttype
cuala0          ptyp2           rsd1            ttyld0          ttypf
fd/             ptyp3           rvn             ttyp0           tun0
fd0.1440        ptyp4           rworm           ttyp1           urandom
fd1.1200        ptyp5           scsi/           ttyp2           vn
io              ptyp6           sd0             ttyp3           zero
kmem            ptyp7           sd1             ttyp4
lkm             ptyp8           snp0            ttyp5
log             ptyp9           snp1            ttyp6
lpt0            ptypa           snp2            ttyp7

./fd:
0       15      21      28      34      40      47      53      6       9
1       16      22      29      35      41      48      54      60
10      17      23      3       36      42      49      55      61
11      18      24      30      37      43      5       56      62
12      19      25      31      38      44      50      57      63
13      2       26      32      39      45      51      58      7
14      20      27      33      4       46      52      59      8

./scsi:
sctarg  ssc
julian@erf.tfs.com:

which is all devices really there except for disk slices/partitions..
(if I don't have it it's not there, which has GOT to be an improvement..)

no DEVFS fixes from device maintainers yet?
1995-12-09 09:11:25 +00:00
Poul-Henning Kamp
d2f265fab8 Julian forgot to make the *devsw structures static. 1995-12-08 23:23:00 +00:00
Julian Elischer
87f6c6625d Pass 3 of the great devsw changes
most devsw referenced functions are now static, as they are
in the same file as their devsw structure. I've also added DEVFS
support for nearly every device in the system, however
many of the devices have 'incorrect' names under DEVFS
because I couldn't quickly work out the correct naming conventions.
(but devfs won't be coming on line for a month or so anyhow so that doesn't
matter)

If you "OWN" a device which would normally have an entry in /dev
then search for the devfs_add_devsw() entries and munge to make them right..
check out similar devices to see what I might have done in them in you
can't see what's going on..
for a laugh compare conf.c conf.h defore and after... :)
I have not doen DEVFS entries for any DISKSLICE devices yet as that will be
a much more complicated job.. (pass 5 :)

pass 4 will be to make the devsw tables of type (cdevsw * )
rather than (cdevsw)
seems to work here..
complaints to the usual places.. :)
1995-12-08 11:19:42 +00:00
David Greenman
efeaf95a41 Untangled the vm.h include file spaghetti. 1995-12-07 12:48:31 +00:00
Peter Wemm
cde694287a Implement detection of whether or not bounce-buffering is required
for the particular card in use.  At the moment, I've set it to any of
the bt445S VLB cards (not the bt445C which apparently work) and the
bt5xx series (isa cards).  The 742 and PCI cards should not need it. :-)

It may be useful to have something like this:
#ifndef BOUNCE_BUFFERS
  if (bounce_buffers_required && more_than_16MB_ram)
    panic("this card requires bounce buffers for more than 16MB ram!")
#endif
1995-12-07 09:13:48 +00:00
Bruce Evans
0310c19f5d Replaced #includes of <sys/user.h> by less gross headers, usually
<sys/vm.h>.  Many device drivers need only the definition of vtophys()
from vm.

Added nearby #includes of <sys/conf.h> where appropriate.
1995-12-06 23:52:35 +00:00
Bruce Evans
86a1c05db0 Removed unnecessary #includes of <sys/user.h>. Some of these were just
to get the definitions of TRUE and FALSE which happen to be defined in
a deeply nested include.

Added nearby #includes of <sys/conf.h> where appropriate.
1995-12-06 23:44:23 +00:00
David Greenman
21864bc400 Updated my copyright.
Fixed two cases of "=" that should have been "==" in card type comparison.
Simplified expression that checks for interface up/down.
Moved ed_ring_copy to before its first use so that it's inlined as intended.
Change mbuf allocation policy so that a received packet is stored in just
an mbuf header (no cluster) if it will fit in one.
1995-12-05 13:01:33 +00:00
David Greenman
4a5f1499b0 all:
Removed ifnet.if_init and ifnet.if_reset as they are generally unused.
Change the parameter passed to if_watchdog to be a ifnet * rather than
a unit number. All of this is an attempt to move toward not needing an
array of softc pointers (which is usually static in size) to point to
the driver softc.

if_ed.c:
Changed some of the argument passing to some functions to make a little
more sense.

if_ep.c, if_vx.c:
Killed completely bogus use of if_timer. It was being set in such a way
that the interface was being reset once per second (blech!).
1995-12-05 02:01:59 +00:00
Peter Wemm
80308cade5 aargh! I tested JREMOD, only to discover that the "good oil" part of
it for si.c was accidently inside some #ifdef DEBUG code....
1995-12-04 17:33:45 +00:00
Poul-Henning Kamp
dd05856fd3 I don't know what I messed up in 1.40, but the crynwr mode didn't make it.
Here it is then, I hope.
1995-12-02 20:33:40 +00:00
Julian Elischer
124b8f8150 A quick fix for a problem that will go away in a few days anyway.. 1995-12-01 23:09:20 +00:00
Julian Elischer
1eeac5367e remove typo 1995-12-01 01:38:49 +00:00
Julian Elischer
de1676f933 A pair of really tiny patches that not only allow it all to compile
but also IT ACTUALLY WORKS!
FreeBSD with options  JREMOD now runs with no entries in the devsw tables
prior to the devices puting their own entries there..

Thanks to bde and terry for thoughts and comments.
next stop 'Real' devfs support in devices.
1995-11-30 05:59:09 +00:00
Andrey A. Chernov
662f3a95dd Fix my color/attr separation patch.
Swap foreground/background logic to allow DIM REVERSE
1995-11-30 03:29:31 +00:00
Garrett Wollman
9350db19e7 Fix Pentium CPU rate diagnosis:
- Don't print out meaningless iCOMP numbers, those are for droids.
	- Use a shorter wait to determine clock rate to avoid deficiencies
	  in DELAY().
	- Use a fixed-point representation with 8 bits of fraction to store
	  the rate and rationalize the variable name.  It would be
	  possible to use even more fraction if it turns out to be
	  worthwhile (I rather doubt it).

The question of source code arrangement remains unaddressed.
1995-11-29 19:57:22 +00:00
Bruce Evans
56cb20cd72 Removed builtin list of port addresses. The address for sio3
conflicted with S3 graphics cards.  Now users should put sio[2-3]
in the config file if the hardware exisst, even if the probe is
certain to fail due to an interrupt conflict.  Otherwise, ports
sharing the interrupt may fail the probe if the system is warm
booted while sio[2-3] are active (perhaps under another OS).  The
same problem for nonstandard ports is now handled better than
before.
1995-11-29 15:00:07 +00:00
Julian Elischer
7198bf4725 If you're going to mechanically replicate something in 50 files
it's best to not have a (compiles cleanly) typo in it! (sigh)
1995-11-29 14:41:20 +00:00
Julian Elischer
53ac6efbd8 OK, that's it..
That's EVERY SINGLE driver that has an entry in conf.c..
my next trick will be to define cdevsw[] and bdevsw[]
as empty arrays and remove all those DAMNED defines as well..

Each of these drivers has a SYSINIT linker set entry
that comes in very early.. and asks teh driver to add it's own
entry to the two devsw[] tables.

some slight reworking of the commits from yesterday (added the SYSINIT
stuff and some usually wrong but token DEVFS entries to all these
devices.

BTW does anyone know where the 'ata' entries in conf.c actually reside?
seems we don't actually have a 'ataopen() etc...

If you want to add a new device in conf.c
please  make sure I know
so I can keep it up to date too..

as before, this is all dependent on #if defined(JREMOD)
(and #ifdef DEVFS in parts)
1995-11-29 10:49:16 +00:00
Poul-Henning Kamp
3924871a1d staticize. 1995-11-29 10:26:51 +00:00
Poul-Henning Kamp
ad46e209d2 Add crynwr mode to the lp# interface.
Reviewed by:	pst, phk
Submitted by:	tim@sarc.city.ac.uk
1995-11-29 10:17:03 +00:00
Jordan K. Hubbard
d01b66804a A batch of Jim Lowe's patches:
o Add signed/unsigned functionality to the matrox meteor device driver.
	o Apply a few fixes to the sound driver.
	o Add a ``SPIGOT_UNSECURE'' compile time definition so, if one defines
	  SPIGOT_UNSECURE in their conf file, then they can use the spigot w/o
	  root.  There is a warning that this allows users access to the IO
	  page which is probably not secure.
Submitted by:	james
1995-11-29 01:07:59 +00:00
Julian Elischer
376c314995 the second set of changes in a move towards getting devices to be
totally dynamic. (the first was about 7 weeeks ago)

this is only the devices in i386/isa
I'll do more tomorrow.
they're completely masked by #ifdef JREMOD at this stage...
the eventual aim is that every driver will do a SYSINIT
at startup BEFORE the probes, which will effectively
link it into the devsw tables etc.

If I'd thought about it more I'd have put that in in this set (damn)
The ioconf lines generated by config will also end up in the
device's own scope as well, so ioconf.c will eventually be gutted
the SYSINIT call to the driver will include a phase where the
driver links it's ioconf line into a chain of such. when this phase is done
then the user can modify them with the boot: -c
config menu if he wants, just like now..
config will put the config lines out in the .h file
(e.g. in aha.h will be the addresses for the aha driver to look.)
as I said this is a very small first step..
the aim of THIS set of edits is to not have to edit conf.c at all when
adding a new device.. the tabe will be a simple skeleton..

when this is done, it will allow other changes to be made,
all teh time still having a fully working kernel tree,
but the logical outcome is the complete REMOVAL of the devsw tables.

By the end of this, linked in drivers will be exactly the same as
run-time loaded drivers, except they JUST HAPPEN to already be linked
and present at startup..
the SYSINIT calls will be the equivalent of the "init" call
made to a newly loaded driver in every respect.

For this edit,
each of the files has the following code inserted into it:

obviously, tailored to suit..
----------------------somewhere at the top:
#ifdef JREMOD
#include <sys/conf.h>
#define CDEV_MAJOR 13
#define BDEV_MAJOR 4
static void 	sd_devsw_install();
#endif /*JREMOD */
---------------------somewhere that's run during bootup: EVENTUALLY a SYSINIT
#ifdef JREMOD
        sd_devsw_install();
#endif /*JREMOD*/
-----------------------at the bottom:
#ifdef JREMOD
struct bdevsw sd_bdevsw =
	{ sdopen,	sdclose,	sdstrategy,	sdioctl,	/*4*/
	  sddump,	sdsize,		0 };

struct cdevsw sd_cdevsw =
	{ sdopen,	sdclose,	rawread,	rawwrite,	/*13*/
	  sdioctl,	nostop,		nullreset,	nodevtotty,/* sd */
	  seltrue,	nommap,		sdstrategy };

static sd_devsw_installed = 0;

static void 	sd_devsw_install()
{
	dev_t descript;
	if( ! sd_devsw_installed ) {
		descript = makedev(CDEV_MAJOR,0);
		cdevsw_add(&descript,&sd_cdevsw,NULL);
#if defined(BDEV_MAJOR)
		descript = makedev(BDEV_MAJOR,0);
		bdevsw_add(&descript,&sd_bdevsw,NULL);
#endif /*BDEV_MAJOR*/
		sd_devsw_installed = 1;
	}
}
#endif /* JREMOD */
1995-11-28 09:43:45 +00:00
Julian Elischer
7146c13e43 the second set of changes in a move towards getting devices to be
totally dynamic.

this is only the devices in i386/isa
I'll do more tomorrow.
they're completely masked by #ifdef JREMOD at this stage...
the eventual aim is that every driver will do a SYSINIT
at startup BEFORE the probes, which will effectively
link it into the devsw tables etc.

If I'd thought about it more I'd have put that in in this set (damn)
The ioconf lines generated by config will also end up in the
device's own scope as well, so ioconf.c will eventually be gutted
the SYSINIT call to the driver will include a phase where the
driver links it's ioconf line into a chain of such. when this phase is done
then the user can modify them with the boot: -c
config menu if he wants, just like now..
config will put the config lines out in the .h file
(e.g. in aha.h will be the addresses for the aha driver to look.)
as I said this is a very small first step..
the aim of THIS set of edits is to not have to edit conf.c at all when
adding a new device.. the tabe will be a simple skeleton..

when this is done, it will allow other changes to be made,
all teh time still having a fully working kernel tree,
but the logical outcome is the complete REMOVAL of the devsw tables.

By the end of this, linked in drivers will be exactly the same as
run-time loaded drivers, except they JUST HAPPEN to already be linked
and present at startup..
the SYSINIT calls will be the equivalent of the "init" call
made to a newly loaded driver in every respect.

For this edit,
each of the files has the following code inserted into it:

obviously, tailored to suit..
----------------------somewhere at the top:
#ifdef JREMOD
#include <sys/conf.h>
#define CDEV_MAJOR 13
#define BDEV_MAJOR 4
static void 	sd_devsw_install();
#endif /*JREMOD */
---------------------somewhere that's run during bootup: EVENTUALLY a SYSINIT
#ifdef JREMOD
        sd_devsw_install();
#endif /*JREMOD*/
-----------------------at the bottom:
#ifdef JREMOD
struct bdevsw sd_bdevsw =
	{ sdopen,	sdclose,	sdstrategy,	sdioctl,	/*4*/
	  sddump,	sdsize,		0 };

struct cdevsw sd_cdevsw =
	{ sdopen,	sdclose,	rawread,	rawwrite,	/*13*/
	  sdioctl,	nostop,		nullreset,	nodevtotty,/* sd */
	  seltrue,	nommap,		sdstrategy };

static sd_devsw_installed = 0;

static void 	sd_devsw_install()
{
	dev_t descript;
	if( ! sd_devsw_installed ) {
		descript = makedev(CDEV_MAJOR,0);
		cdevsw_add(&descript,&sd_cdevsw,NULL);
#if defined(BDEV_MAJOR)
		descript = makedev(BDEV_MAJOR,0);
		bdevsw_add(&descript,&sd_bdevsw,NULL);
#endif /*BDEV_MAJOR*/
		sd_devsw_installed = 1;
	}
}
#endif /* JREMOD */
1995-11-28 09:42:06 +00:00
Bruce Evans
43cbfcb357 Removed all #includes of the unused file <sys/device.h>. 1995-11-28 07:29:59 +00:00
Peter Wemm
070fc2ce12 Mainly cosmetic cleanups... It now uses more consistant message reporting
on the console, and no longer uses "SLXOS" which I suspect may be a
trademark... (I'm not sure, but this is not really a SLXOS driver anyway)
1995-11-28 02:07:36 +00:00
Andrey A. Chernov
00265e7d4d Separate colors & attributes as Terry points
Reviewed by: soren
1995-11-28 00:17:32 +00:00
Bruce Evans
84478e7f42 Fixed setting of speed B0 - don't output a bogus divisor of 0 and a
random prescaler, just hang up.  This may fix hangup problems with
mgetty.
1995-11-26 17:13:23 +00:00
Bruce Evans
fec104de77 Completed function declarations and/or added prototypes. 1995-11-24 15:15:30 +00:00
Bruce Evans
b8a89c9ada Added bogusly placed extern prototypes for functions that should probably
be static.
1995-11-24 15:08:07 +00:00
Bruce Evans
d818a9cc1f Fixed a comment. 1995-11-24 14:56:00 +00:00
John Dyson
dc4a0cee58 Update the wd.c driver to use the new TAILQ scheme for device
buffer queue.  Also, create a new subroutine 'tqdisksort' that
is an improved version of the original disksort that also uses
TAILQs.
1995-11-23 07:24:41 +00:00
Bruce Evans
512fef80a9 Completed function declarations and/or added prototypes. 1995-11-21 12:55:26 +00:00
Bruce Evans
6ad175be4d Restored static variable `nsio_tty' which is used only by pstat(8). Made
it `const' to inhibit compiler warnings.

Added #include of <pccard/driver.h> to get prototypes.  <pccard/slot.h>
is still necessary for its side effect of exporting non-slot things.
1995-11-21 09:15:04 +00:00
Peter Wemm
cc9fce5ad7 This driver supports the Arnet SYNC/570i ISA cards that is based on the
HD64570 chip. Both the 2 and 4 port cards is supported and auto detected.

Line speeds of up to 2Mbps is possible. At this speed about 85% of the
bandwidth is usable with 486DX processors.

The standard FreeBSD sppp code is used for the link level layer. The
default protocol used is PPP. The Cisco HDLC protocol can be used by
adding "link2" to the ifconfig line in /etc/sysconfig or where ever
ifconfig is run.

At the moment only the V.35 and X.21 interfaces is supported. The others
may need tweaks to the clock selection code.

Submitted by: John Hay <jhay@mikom.csir.co.za>
1995-11-21 02:32:04 +00:00
Bruce Evans
bf7141134e Quick fix for stat_imask and intr_mask[8] not having the RTC interrupt
bit set.  I broke stat_imask in Dec 1994 and update_intr_masks() has
copied the breakage to intr_mask[8] since Mar 1995.  This can cause
the RTC to stop interrupting in rare cases (under loads heavy enough
for a new RTC interrupt to occur at a critical time just before Xintr8
finishes handling the previous one) and may have caused worse problems.
1995-11-20 13:24:18 +00:00
Poul-Henning Kamp
4b2af45f4b Mega commit for sysctl.
Convert the remaining sysctl stuff to the new way of doing things.
the devconf stuff is the reason for the large number of files.
Cleaned up some compiler warnings while I were there.
1995-11-20 12:42:39 +00:00
Poul-Henning Kamp
bf6a29da66 Fix compiler warnings. 1995-11-20 12:13:32 +00:00
Poul-Henning Kamp
0f6873dbcc move variables inside the #ifdef. 1995-11-20 12:12:02 +00:00
Bruce Evans
27413a9eef Moved bogusly placed #endif that hid some prototypes. 1995-11-18 09:37:42 +00:00
Bruce Evans
6eeed24248 Updated comments. The comments about the unused addresses get broken
almost every time someone uses an address.  This file is probably not
the right place to keep track of the unused addresses (or used
addresses :->).

Fixed comments on #endif's to match code.

Added defines for ASC and GSC sizes.  This file is not the right place
to keep track of scanner addresses, but while there here and we
pretend to keep track of unused addresses, the sizes need to be here
too.

Sorted IO_*SIZE defines.
1995-11-18 09:29:39 +00:00
Bruce Evans
47b4b8b88e Fixed the types of the apm hook functions.
Completed function declarations.

Added prototypes.

Partially fixed the path to cons.h.
1995-11-18 08:58:14 +00:00
Bruce Evans
58bfbb4b1a Fixed the types of the apm hook functions.
Completed function declarations.

Added prototypes.
1995-11-18 08:39:28 +00:00
Bruce Evans
980dc8bb6e Fixed the type of a timeout function.
Added prototypes.
1995-11-18 08:35:49 +00:00
Bruce Evans
caa8e73783 Fixed staticization - use `static' in function headers, not just in
prototypes.
1995-11-18 08:29:04 +00:00
Bruce Evans
6b88228fc4 Fixed a bogus include path.
Removed a bogus include.

Added prototypes.
1995-11-18 08:21:15 +00:00
Bruce Evans
c5d1682b14 Staticized an inline function. All inlines in kernel headers should be
static.  The function shouldn't be here anyway.  It is driver dependent,
while `ic' files are supposed to only depend on the IC.
1995-11-18 08:12:30 +00:00
Bruce Evans
27513ca73b Fixed (nonexistent) initialization of bp->b_pblkno. disksort() for
floppies must have been random in 2.x since we reintroduced sorting
on b_pblkno on 1995/03/18.  Drivers still initialize b_cylin/b_resid
although this is no longer used.

Removed unused, wrong function fdsize().  (Returning 0 means that the
device exists and has size 0, not that the device doesn't exist.
swaponvp() allows for size 0 by stupidly calling the d_psize function
twice if the size isn't 0.  setdumpdev() doesn't allow for it.)

Continued removing /* ARGSUSED */ from drivers.
1995-11-18 07:48:11 +00:00
Bruce Evans
0f5c6b7d97 Fixed the type of a timeout function.
Removed related bogus casts of function pointers.
Removed a bogus include.
1995-11-18 07:07:04 +00:00
Bruce Evans
eabc9678bc Included <sys/conf.h>. It used to be included as a side effect of
including <sys/devconf.h>.
1995-11-16 09:56:02 +00:00
David Greenman
f13d0e7dbf Correct the bogus probe for 8216/8416 cards...it was broken.
Submitted by:	Steve Piette <steve@simon.chi.il.US>
1995-11-15 07:45:56 +00:00
Poul-Henning Kamp
920e8dc220 Fiddle with <machine/isa_device.h> 1995-11-14 20:49:24 +00:00
Poul-Henning Kamp
2a02fd2542 Staticize various private parts. 1995-11-14 09:58:47 +00:00
Poul-Henning Kamp
cc028d77d6 Make a lot of private stuff static 1995-11-14 09:53:17 +00:00
Bruce Evans
b3e24f9ce9 Changed the first (name) arg of MOD_DEV(), MOD_EXEC() and MOD_MISC()
from a string to an identifier so that it can be used to generate
declarations and strings.  It's much easier to stringize an identifier
than to identifize a string.  A uniform naming scheme must be used
for the automatically generated things to apply.  This is a feature.

Used the module identifer to generate prototypes for the module load,
unload and stat functions.  Removed the few prototypes for these that
already existed.

Used the module identifier to generate a unique struct tag in MOD_DEV().
This should probably be done for all the MOD_*() macros.

Moved the trailing semicolon from the MOD_*() macro definitions to the
macro invocations that didn't already (bogusly) have it.

Staticized the module load and unload functions.

Added function return types for the module load, unload and stat functions.

lkm/ibcs2/ibcs2.c:
Included <sys/sysproto.h> to get everything prototyped.
Cleaned up #includes.

lkm/ibcs2/ipfw.c:
Cleaned up #includes.

lkm/linux/linux.c:
The module name had to change from "linux_emulator" to "linux_mod" to
be automatically generated.
Cleaned up #includes.

lkm/syscons/*/*_saver.c:
Completed delcarations of function pointers.

sys/i386/isa/atapi.c:
The module name had to change from "atapi" to "atapi_mod" to be
automatically generated.

sys/i386/isa/wcd.c:
Used the fixed MOD_DEV().  This module has two devices and expanded the
macro in the source instead of fixing it.
The module names had to change from "wcd" and "rwcd" to "wcd_mod" and
"rwcd_mod" to be automatically generated.

sys/pccard/pcic.c:
The module name had to change from "pcic" to "pcic_mod" to be
automatically generated.
1995-11-14 07:35:57 +00:00
Bruce Evans
e7b632b588 Replaced nosys() by lkm_nullcmd(). 1995-11-13 08:52:08 +00:00
Mark Murray
a07ffb0cda Add /dev/random hooks to the key input routines for pcvt. This allows
the scancodes on a PCVT machine to be used as stochastic input as well
as SysCons..
Reviewed by:	Joerg Wunsch
1995-11-12 17:02:45 +00:00
Peter Wemm
5d0bad8280 Sync the public source with what I'm currently running.
Most of this is cleaning up, but there are some functional changes,
doc/comment improvements, error checking, gcc -Wall cleanups.  Input buffer
flushing is enabled now, although I'm still not quite certain it's right.
1995-11-09 21:53:48 +00:00
Bruce Evans
fec5f38c65 Nuked some more bogus devswitch macros. The wcd lkm was broken. 1995-11-09 09:17:49 +00:00
Justin T. Gibbs
67e1bd423c Remove old eisaconf cruft from the eisa files. The old eisaconf kludged
in here to do some conflict detection.  The new code doesn't do conflict
detection yet, but it will be implemented in another way.

aic7770.c moved to i386/eisa
1995-11-05 04:45:16 +00:00
Bruce Evans
4ff3de8e80 Added `#include "ioconf.h"' to <machine/conf.h> and cleaned up the
misplaced extern declarations (mostly prototypes of interrupt handlers)
that this exposed.  The prototypes should be moved back to the driver
sources when the functions are staticalized.

Added idempotency guards to <machine/conf.h>.  "ioconf.h" can't be
included when building LKMs so define a wart in bsd.kmod.mk to help
guard against including it.
1995-11-04 17:08:13 +00:00
Mark Murray
96441a8c38 Remove the #ifdev DEVRANDOM's, as promised.
/dev/random is now a part of the kernel! you will need to make
the device in /dev: sh MAKEDEV random
and take a look at some test code in src/tools/test/random.
1995-11-04 16:00:56 +00:00
Bruce Evans
fff87b3946 Always declare vga_move_charset(). It doesn't depend on option XSERVER. 1995-11-04 14:00:00 +00:00
Bruce Evans
4fda91c705 Moved prototypes for devswitch functions from conf.c and driver sources
to <machine/conf.h>.  conf.h was mechanically generated by
`grep ^d_ conf.c >conf.h'.  This accounts for part of its ugliness.  The
prototypes should be moved back to the driver sources when the functions
are staticalized.
1995-11-04 13:25:33 +00:00