Commit Graph

6628 Commits

Author SHA1 Message Date
Mike Smith
0a9d630ea8 Protect against PCI devices which may have their 'changed' flag set,
or list items which may look like devices but which don't have an
isa_device structure attached to them.

This _shouldn't_ be possible, but it appears to have been
observed-by: Joerg
1996-11-05 05:52:36 +00:00
John Dyson
db2c0faa4c Vastly improved contigmalloc routine. It does not solve the
problem of allocating contiguous buffer memory in general, but
make it much more likely to work at boot-up time.  The best
chance for an LKM-type load of a sound driver is immediately
after the mount of the root filesystem.

This appears to work for a 64K allocation on an 8MB system.
1996-11-05 04:19:08 +00:00
Sujal Patel
e89054370f Add audio mixer ioctls.
Only writing to the mixer is implemented.
1996-11-05 02:04:37 +00:00
Guido van Rooij
b3ac88f13f New vx driver for:
3COM 3C590 Etherlink III PCI,
        3COM 3C595 Fast Etherlink PCI,
        3COM 3C592 Etherlink III EISA,
        3COM 3C590 Fast Etherlink EISA,
        3COM 3C900 Etherlink XL PCI and
        3COM 3C905 Fast Etherlink XL PCI.

This driver is based on OpenBSD's driver. I modified it to run under FreeBSd
and made it actually work usefully.
Afterwards, nao@tom-yam.or.jp (HAMADA Naoki) added EISA support as well as
early support for 3C900 Etherlink XL PCI and 3C905 Fast Etherlink XL PCI.
He also split up the driver in a bus independant and bus dependant parts.

Especially the 3c59X support should be pretty stable now.

Submitted by:	partly nao@tom-yam.or.jp (HAMADA Naoki)
Obtained from:partly OpenBSD
1996-11-04 22:17:20 +00:00
Søren Schmidt
10661203e7 Fix the hanging keyboard problem under Xaccel. Apprently we are loosing
an interrupt somewhere. The solution here is to check for keyboard
input each time the screen update timer ticks. Not pretty, but works.
1996-11-04 21:01:08 +00:00
Jeffrey Hsu
78769fbc6a struct mfsnode bloated in size by 12 bytes, so reduce spare padding by 3 longs.
We now only have 4 spare bytes before hitting the dreaded 32 byte threshold.
1996-11-04 20:53:02 +00:00
Bruce Evans
fd25850c96 Don't clobber max_ncyls, ending up guessing thetotal number of cylinders as
the number in the 4th slot.

Fixes PR 1893.

Should be in 2.1.5 and 2.2.
1996-11-04 17:40:43 +00:00
Bruce Evans
206e5b7e27 Fixed some races and misleading comments in ufs_rename().
1. When a directory is renamed to an existing (empty) directory,
it is possible for the target vnode to become the source vnode
underneath you (because another process may complete the same
rename).  It was assumed that this can't happen, and the bogus
errno EINVAL was returned.  This was fairly harmless.

Fix: return ENOENT instead, as if the source directory was renamed
a little earlier.

2. The same metamorphosis is possible for non-directories.  It was
assumed that this can't happen, and the code for handling "just
removing a link name" happened to be used.  This would have worked
except for fatal bugs in the link name removal - the link name was
assumed to still be there, and a null pointer was followed.

Fix: check the result of relookup().  This fixes PR 1930.

Notes:

(a) POSIX seems to say that removing link names shall have no effect.
BSD (4.4Lite2 at least) does something reasonable instead.

(b) The relookup() may find a file unrelated to the original.
Removing this isn't correct.  Consider 3 existing files A, B and
C, and concurrent renames: AB = rename(A, B), another AB, and
CA = rename("c", "a").  If rename() is atomic, then only the
following results are possible:

	AB, AB (fails), CA: A = original C, B = original A, C = gone
	AB, CA, AB:         A = gone,       B = original C, C = gone
	CA, AB, AB (fails): A = gone,       B = original C, C = gone

but ufs_rename() can give:

	A,AB,CA,B (sorta):  A = gone,       B = original A, C = gone

This usually doesn't matter, since getting into a race is usually
an error.
---

These fixes should be in 2.1.6 and 2.2.
1996-11-04 16:05:51 +00:00
Poul-Henning Kamp
50affa0e18 Set REVISION=3.0 and RELDATE=199701 1996-11-03 12:04:05 +00:00
John Dyson
5c2a644a47 Fix a problem with running down processes that have left wired
mappings with mlock.  This problem only occurred because of the
quick unmap code not respecting the wired-ness of pages in the
process.  In the future, we need to eliminate the dependency
intrinsic to the design of the code that wired pages actually
be mapped.  It is kind-of bogus not to have wired pages mapped,
but it is also a weakness for the code to fall flat because
of a missing page.

This show fix a problem that Tor Egge has been having, and also
should be included into 2.2-RELEASE.
1996-11-03 03:40:47 +00:00
Joerg Wunsch
bb6382fae2 Fix the broken EOF handling in the floppy driver. The most obvious
appearance of this bug was the malfunctioning -M option in GNU tar (it
worked only by explicitly specifying -L).

Reviewed by:	bde, and partially corrected accoring to his comments

Candidate for 2.2, IMHO even for 2.1.6.
1996-11-02 23:31:11 +00:00
Joerg Wunsch
4441bd4c1b Avoid touching the LEDs too early in the game. After the recent
changes to the keyboard code in pcvt, this update_led() very often
caused pcvt to hang early at boot time.

(Eventually, a better solution should be found, but the simple
omission serves well as a workaround for something that is actually a
show-stopper class problem.)

Candidate for 2.2.
1996-11-02 23:28:06 +00:00
Poul-Henning Kamp
59a95186d2 Fill in the bios-geometry array in struct bootinfo.
2.2 candidate.
1996-11-02 14:46:27 +00:00
Satoshi Asami
ce8ba0cdf6 The last update/merge of PC98 stuff before 2.2. The whole
pc98/pc98/sound directory has vanished now!

Submitted by:	FreeBSD(98) Development Team
1996-11-02 10:41:28 +00:00
Paul Traina
39daae723d add in CONSPEED option which controls console serial port speed 1996-11-02 02:26:06 +00:00
Paul Traina
7fe8c7a026 add in CONSPEED option 1996-11-02 02:25:22 +00:00
Paul Traina
6564e095d3 Rationalize support for serial consoles running at baud rates other than 9600
baud.  This isn't particularly beautiful, but neither is it disgustingly
gross.
1996-11-02 02:24:39 +00:00
John Hay
75c66a120a if_sr.c corrupted the global variable `ticks'.
Cosmetic changes:
if_sr_.c won't compile with a K&R compiler, so there is no need to cast
the timeout arg to the (wrong) type.
Submitted by:	bde
1996-10-31 20:22:40 +00:00
Andrey A. Chernov
edcfa07284 collate_range_cmp -> __collate_range_cmp 1996-10-31 04:32:27 +00:00
Julian Elischer
d13d3630fd Further improved version of hadling a HALT when there is no console. 1996-10-31 00:57:28 +00:00
Satoshi Asami
e30f001135 More merge and update.
(1) deleted #if 0

    pc98/pc98/mse.c

(2) hold per-unit I/O ports in ed_softc

    pc98/pc98/if_ed.c
    pc98/pc98/if_ed98.h

(3) merge more files by segregating changes into headers.

  new file (moved from pc98/pc98):

    i386/isa/aic_98.h

  deleted:

    well, it's already in the commit message so I won't repeat the
    long list here ;)

Submitted by:	The FreeBSD(98) Development Team
1996-10-30 22:41:46 +00:00
Julian Elischer
75680b05c6 if there is no console, cngetc should act like getc and return -1
make callers aware of this in those cases where it can occur.
1996-10-30 21:40:25 +00:00
Poul-Henning Kamp
0cf34a4a5f Pass right arp to bpf_mtap(). 1996-10-30 08:50:26 +00:00
Peter Wemm
37bd2b301c Fix braino on my part. When we have three different port ranges (default,
"high" and "secure"), we can't use a single variable to track the most
recently used port in all three ranges.. :-]  This caused the next
transient port to be allocated from the start of the range more often than
it should.
1996-10-30 06:13:10 +00:00
John Dyson
d700038439 Fix a potential deadlock from the previous commit. 1996-10-30 03:52:57 +00:00
John Dyson
56673451a7 Fix the /proc/???/map file so that it is possible to read an arbitrarily
large process map.  Another commit will follow to fix a problem just found
during this one... Sorry!!! :-(.
1996-10-30 03:45:00 +00:00
John Dyson
851c12ff1d Change mmap to use OBJT_DEFAULT instead of OBJT_SWAP by default
for anonymous objects.  The system will automatically change the
type to SWAP if needed (for size or pageout reasons.)
1996-10-29 22:07:11 +00:00
Bruce Evans
61679f2ba2 Search for labels on all slices whenever any minor for a drive is opened.
If DEVFS is configured, create devfs devices for previously invisible
partitions on the slices.

Fixed an old aliasing bug which caused E=17 errors from DEVFS for
DIOCSDINFO when there were no real slices.
1996-10-29 13:15:30 +00:00
Satoshi Asami
4d2d765487 Another round of merge/updates.
(1) Add #ifdef PC98:

	sys/pc98/boot/biosboot/boot2.S

 (2) Fix bug that made it impossible to boot from sd's other than unit 0:
	sys/pc98/boot/biosboot/sys.c

 (3) Delete redundant $Id$:

	sys/pc98/pc98/clock.c (reject$B$5$l$k$+$b$7$l$J$$(B)

 (4) unt -> u_int:
	sys/pc98/pc98/if_ed.c

 (5) Add support for rebooting by the hot-key sequence:

	sys/pc98/pc98/kbdtables.h

 (6) Display now looks like PC/AT version:

	sys/pc98/pc98/npx.c

 (7) Change comment to match that of PC/AT version:

	sys/pc98/pc98/pc98.c

 (8) Add function prototypes:

	sys/pc98/pc98/pc98_machdep.c

 (9) Include PC98 headers:

	sys/pc98/pc98/sound/adlib_card.c
	sys/pc98/pc98/sound/audio.c
	sys/pc98/pc98/sound/dev_table.c
	sys/pc98/pc98/sound/dmabuf.c
	sys/pc98/pc98/sound/midi_synth.c
	sys/pc98/pc98/sound/midibuf.c
	sys/pc98/pc98/sound/opl3.c
	sys/pc98/pc98/sound/oatmgr.c
	sys/pc98/pc98/sound/sb16_dsp.c
	sys/pc98/pc98/sound/sb16_midi.c
	sys/pc98/pc98/sound/sb_card.c
	sys/pc98/pc98/sound/sb_dsp.c
	sys/pc98/pc98/sound/sb_midi.c
	sys/pc98/pc98/sound/sb_mixer.c
	sys/pc98/pc98/sound/sequencer.c
	sys/pc98/pc98/sound/sound_config.h
	sys/pc98/pc98/sound/sound_switch.c
	sys/pc98/pc98/sound/soundcard.c
	sys/pc98/pc98/sound/sys_timer.c

(10) Merge in PC98 changes:

	sys/i386/isa/sound/os.h

(11) Deleted as result of 9. and 10. above:

	sys/pc98/pc98/sound/ad1848_mixer.h
	sys/pc98/pc98/sound/aedsp16.c
	sys/pc98/pc98/sound/coproc.h
	sys/pc98/pc98/sound/finetune.h
	sys/pc98/pc98/sound/gus_hw.h
	sys/pc98/pc98/sound/gus_linearvol.h
	sys/pc98/pc98/sound/hex2hex.h
	sys/pc98/pc98/sound/mad16.h
	sys/pc98/pc98/sound/midi_ctrl.h
	sys/pc98/pc98/sound/midi_synth.h
	sys/pc98/pc98/sound/opl3.h
	sys/pc98/pc98/sound/os.h
	sys/pc98/pc98/sound/pas.h
	sys/pc98/pc98/sound/sb_mixer.h
	sys/pc98/pc98/sound/soundvers.h
	sys/pc98/pc98/sound/tuning.h

Submitted by:	The FreeBSD(98) Development Team
1996-10-29 08:37:02 +00:00
John Hay
ebcdcb982a Add support for the SDL RISCom N2pci cards. Bring in the enhancements
made to the Arnet driver.
1996-10-29 03:53:21 +00:00
John Hay
c2b3cc824d Remove some unnecessary code in the interrupt handler.
Check that a received packet isn't longer than MCLBYTES. This will
sometimes happen if a cable is plugged into or removed from a live
system.
Try to cater better for early receive interrupts.
1996-10-28 19:40:01 +00:00
John Hay
21b4a6992c A #define really don't need a ; at the end. 1996-10-28 19:35:37 +00:00
Warner Losh
ac1ad962f7 comaptibles->compatibles 1996-10-28 17:16:40 +00:00
Justin T. Gibbs
853925d190 In data_phase_reinit when I converted the code to use bcopy, I should have
used mvi instead of mov.  Luckily this code is most likely never executed
since it is only there for sanity should a target goes into the data phase
twice during a single selection or reselection.
1996-10-28 17:00:24 +00:00
Poul-Henning Kamp
7f6a56eff7 devfs_tree.c: improve our bdevvp() function.
devfs_vnops.c:	move a debug printf to be consistent.
1996-10-28 11:36:06 +00:00
Poul-Henning Kamp
19060a3ad9 init_main.c: pass -d to init if DEVFS_ROOT
kern_conf.c:	gd driver is a disk.
vfs_subr.c:	include opt_devfs.h
1996-10-28 11:34:57 +00:00
Poul-Henning Kamp
f22d3967da DEVFS_ROOT -> opt_devfs.h 1996-10-28 11:32:55 +00:00
Joerg Wunsch
72b53fbfa3 Kill _OLD_PATH_LOG. It's not needed. 1996-10-28 08:25:51 +00:00
Justin T. Gibbs
b36b7d853f Add basic support for the 398X cards as multi-channel SCSI host adapters.
This involves expanding the support of the SEEPROM routines to deal with
the larger SEEPROMs on these cards and providing a mechanism to share
SCB arrays between multiple controllers.

Most of the 398X support came from Dan Eischer.

ahc_data -> ahc_softc

Clean up some more type bogons I missed from the last pass.
1996-10-28 06:10:33 +00:00
Justin T. Gibbs
8c64b9a600 Add basic support for the 398X cards as multi-channel SCSI host adapters.
This involves expanding the support of the SEEPROM routines to deal with
the larger SEEPROMs on these cards and providing a mechanism to share
SCB arrays between multiple controllers.

Most of the 398X support came from Dan Eischer.

ahc_data -> ahc_softc

Clean up some more type bogons I missed from the last pass.

Be more clear when handing the NO_MATCH condition.  NO_MATCH can also
happen when the sequencer encounters an SCB we've asked to be aborted.
1996-10-28 06:10:02 +00:00
Justin T. Gibbs
2e92a4ad78 Add some code to allow SCB sharing for the 398X cards. This involves passing
an extra parameter to ahc_alloc.
1996-10-28 06:06:42 +00:00
Justin T. Gibbs
1affda38c1 Add two new aic7xxx driver options:
AHC_FORCE_PIO - This forces the driver to use PIO even on systems that
	say they have memory mapped the controller's registers.  This
	seems to fix Ken Lam's problems.  I've also placed this option
	in the GENERIC kernel file so that we are guaranteed to install
	even on these flakey machines.

AHC_SHARE_SCBS - This option attempts to share the external SCB SRAM on
	the 398X controllers allowing a totoll of 255 non-paged SCBs.
	This doesn't work quite yet, so this option is mostly here to
	help 398X owners to experiment and give me feedback until this
	works properly.
1996-10-28 06:05:58 +00:00
Justin T. Gibbs
85772b6529 Fix problems dealing with non-tagged devices when SCB paging is enabled.
Mostly this involved changing the semantics of the findSCB routine so that
it could be used at times other than handling a reconnection.
1996-10-28 06:01:08 +00:00
Poul-Henning Kamp
281cd9b020 The way we get a vnode for swapdev is not quite kosher. In particular
it breaks in the DEVFS_ROOT case.  replicate a bit too much of bdevvp()
in here to circumvent the problem.  The real problem is the magic that
lives in bdevsw[1].
1996-10-27 22:31:00 +00:00
Wolfram Schneider
510681905e Move static variable nextpid out from fork1(). Now top(1) can print
last pid value.
1996-10-27 13:29:22 +00:00
Søren Schmidt
66e7fce7ac Use the calibrated/adjustable i8254 frequency `timer_freq' instead of
TIMER_FREQ.

Fixed missing splx() in scrn_timer().  The bug was harmless because of the
undocumented behaviour that the ipl is automatically restored for timeout
functions (see softclock()).  Perhaps we should depend on this behaviour.

Fixed the ddb fix in rev.1.176.  The in_debugger flag was no use because
it only works when the debugger is entered via the keyboard hotkey.  The
debugger may be entered for breakpoints and traps, and the console putc
routine has no way of knowing when it was, so the console putc routine
must (almost?) always remove the cursor image.

Not fixed: console switching in ddb doesn't work (ISTR it working), and
console 0 shouldn't be switched to for the debugger hotkey unless console
0 is /dev/console.

Fixed side effects from calling add_keyboard_randomness() in the console
getc routine by not calling it.  add_keyboard_randomness() currently
always reenables interrupts on 386's and 486's.  This is very bad if the
console getc routine is called from the debugger and the debugger was
entered with interrupts disabled.

Fixed preservation of initial screen and now-bogus comment about it.  It
was broken by setting the initial scr_buf to `buffer' instead of Crtat.
`buffer' was full of nulls and the first scroll cleared everything above
the things written through syscons.

Submitted by:	bruce (bde@freebsd.org)
1996-10-26 20:16:58 +00:00
Bruce Evans
9272350657 Removed initialization of a variable that went away. Oops. 1996-10-26 00:11:57 +00:00
Bill Fenner
430d30d837 Don't allow reassembly to create packets bigger than IP_MAXPACKET, and count
attempts to do so.
Don't allow users to source packets bigger than IP_MAXPACKET.
Make UDP length and ipovly's protocol length unsigned short.

Reviewed by:	wollman
Submitted by:	(partly by) kml@nas.nasa.gov (Kevin Lahey)
1996-10-25 17:57:53 +00:00
Bruce Evans
484141f666 Declare pointers to signal handling functions in full instead of as
sig_t's so that <sys/signal.h> isn't a prerequisite.
1996-10-25 16:20:34 +00:00
Bruce Evans
9ef7d39520 Removed unused #includes.
Strength-reduced used #include.

Staticized pcaintr().

Fixed some style bugs.
1996-10-25 16:09:31 +00:00
Bruce Evans
9275c7cc3e Use macros from timmerreg.h instead of private ones.
Use global timer_freq instead of private TIMER_CLK.

Removed unused #includes.

Fixed some comments.
1996-10-25 14:00:47 +00:00
Bruce Evans
2d872b777d Print the clock calibration messages all on one (long) line again so
that they are easy to grep for.

Removed now-unused i586 counter variables.

Fixed some style bugs.
1996-10-25 13:46:21 +00:00
Bruce Evans
835bd1ce62 Improved biasing of i586 clock by adjusting for hardclock() latency.
I decided to do this for every hardclock() call instead of lazily
in microtime().  The lazy method is simpler but has more overhead
if microtime() is called a lot.

CPU_THISTICKLEN() is now a no-op and should probably go away.
Previously it did nothing directly but had the side effect of
setting i586_last_tick for CPU_CLOCKUPDATE() and i586_avg_tick for
debugging.  CPU_CLOCKUPDATE() now uses a better method and
i586_avg_tick is too much trouble to maintain.

Reduced nesting of #includes in the usual case.

Increased nesting of #includes when CLOCK_HAIR is defined.  This
is a kludge to get typedefs for inline functions only when the
inline functions are used.  Normally only kern_clock.c defines
this.  kern_clock.c can't include the i386 headers directly.

Removed unused LOCORE support.
1996-10-25 13:01:56 +00:00
Bruce Evans
22b9cd6f99 Removed #include of <machine/clock.h>. It is no longer used, and would
break when I remove LOCORE support from clock.h.
I586_CTR_MULTIPLIER_SHIFT = 32 from clock.h is actually still used, but
32 is so magic that it doesn't get used explicitly.
1996-10-25 12:26:19 +00:00
Bruce Evans
1471a79514 Unremoved used #include of <sys/systm.h> for the !GUPROF case. 1996-10-25 06:58:53 +00:00
Justin T. Gibbs
7491f60b54 - KNF cleanup.
- Add support for memory mapped I/O.
1996-10-25 06:43:10 +00:00
Justin T. Gibbs
df9ab5b30f - KNF cleanup.
- Add support for memory mapped I/O.
- Use DMA to get SCBs down to the adapters.
- Remove old paging code.
- Be much smarter about how we allocate SCB space.  The old, simple method
  wasted almost half a page per SCB. Ooops.
- Make command complete interrupt processing more efficient.
- Break the monolithic ahc_intr into sub-routines.  The sub-routines handle
  rare, special case events so the function call is not a penalty and the
  removal of the code from the main routine most likely improves performance
  instruction prefech will work better and less code is pushed into the cache.
- Never, ever allow tagged queueing if a device has disconnection disabled.
- Clean up and simplify timeout code.  Many of the changes are to handle the
  new DMA scheme.
1996-10-25 06:42:53 +00:00
Justin T. Gibbs
7c34df884c KNF cleanup.
Update to handle new arg to ahc_alloc.
1996-10-25 06:35:38 +00:00
Justin T. Gibbs
971791f48d Go back to using DMA to get SCBs down to the adapter.
SCB paging is now handled almost entirely by the sequencer and also uses
DMA.  This should make SCB paging at least an order of magnitude more
efficient and vastly simplifies the implementation.

Add a few space optimizations so this code still fits on aic7770 chips.

Update comments.
1996-10-25 06:34:59 +00:00
Søren Schmidt
d672246bcc Added a missing break, so all static bins would be missed :( 1996-10-24 19:13:00 +00:00
John Dyson
fcae040bc0 Remove a bogus optimization in the mmap code. It is superfluous,
and at best is the same speed as the unoptimized code.  At worst, it
slows down trivial programs.
1996-10-24 02:56:23 +00:00
John Dyson
c864a7c0a9 Fix setting breakpoints in shared regions. 1996-10-24 02:47:05 +00:00
Julian Elischer
36be1f6be9 Reviewed by: various (mailing list feedback)
Submitted by:	whistle communications

move the socket from /dev to /var/run by default
TRANSITIONALLY make syslog add a symlink..
I PROMISE I'll remove that as soon as I have the makefiles etc fixed as well.
1996-10-23 20:17:57 +00:00
Garrett Wollman
64682bc28a Give ip_len and ip_off more natural, unsigned types. 1996-10-23 18:35:50 +00:00
Andrey A. Chernov
3deeb59da9 GNU-style changes:
1) Rename FNM_ICASE to FNM_CASEFOLD
2) Add FNM_LEADING_DIR
Add proper (unsigned char) casts to tolower().
Use 'char' function argument for proper sign extension
1996-10-23 16:40:20 +00:00
Paul Traina
dcb21864dc Remove SC_KBD_PROBE_WORKS option and replace it with a simple run-time flag
bit (0x0008) in the sc driver configuration line.  This way it's easy to
boink a generic kernel.

Also, document and place in an opt_ file the #define's for overriding which
serial port is the system console.
Approved by:	sos
1996-10-23 07:29:44 +00:00
Satoshi Asami
4f3d818c12 Another round of merge.
(1) Bug fix (pass boot drive):

	pc98/boot/biosboot/boot2.S

(2) Delete code for unsupported high-resolution modes and move old
    Epson notebook code to epsonio.h:

  	pc98/boot/biosboot/io.c
	pc98/i386/vm_machdep.c
	pc98/pc98/fd.c
	pc98/pc98/pc98.c
	pc98/pc98/pc98.h
	pc98/pc98/epsonio.h (new)

(3) Change aic driver so that PCMCIA cards (I/O port same as PC/AT)
    and PC-9801-100 cards can be selected with a flag in kernel config
    file:

	pc98/pc98/aic6360.c
	pc98/pc98/aic_98.h (new)

(4) Fix wcd entry (it was broken).  Delete mcd, it doesn't work on
    98.  Change aic entry according to above:

	pc98/conf/GENERIC98

(5) Move pc98_machdep.c to top of files in pc98/pc98:

	pc98/conf/files.pc98

(6) Delete empty lines:

	pc98/i386/locore.s

(7) Fix (it didn't work if I586 was specified):

	pc98/pc98/clock.c

(8) Staticize:

	pc98/pc98/pc98_machdep.c

(9) Enable workaround for Cyrix bug for 5x86 also:

	pc98/i386/machdep.c
	pc98/i386/trap.c

All the above deletes this file too:

	pc98/i386/pmap.c

(phew!)
Submitted by:	The FreeBSD(98) Development Team
1996-10-23 07:25:35 +00:00
John Dyson
845c4ec464 Account for the UPAGES in the same way as before moving the MD code
from vm_glue into pmap.c.  Now RSS should appear to be the same as before.
1996-10-23 05:31:54 +00:00
Søren Schmidt
6713d4a747 Changed args to the nat functions. 1996-10-22 22:26:02 +00:00
Stefan Eßer
9ac309b8ce Definitions for ioctl() accesses to PCI config space registers.
Submitted by:	wollman
1996-10-22 20:33:19 +00:00
Stefan Eßer
10e966fae4 Add support for ioctl() accesses to PCI config space registers.
Garrett Wollman sent me this code a few weeks ago for review, and I made
some significant changes, which he in turn accepted ...

In order to make use of these changes, a device entry has to added to /dev.

Submitted by:	wollman
1996-10-22 20:20:14 +00:00
Poul-Henning Kamp
40060a90b9 close bin/1648 libmd not 64bit safe.
if something fails to compile now, you need to add #include <sys/types.h>

Partially Submitted by:	Jason Thorpe <thorpej@nas.nasa.gov>
1996-10-22 16:27:47 +00:00
Bill Fenner
a73356a1be Fix comments, which appear to have been mangled long ago and far away. 1996-10-21 23:05:57 +00:00
Nate Williams
bbabe47be8 When compiling with '-Wall -pedantic', the byte swapping macros gave the
following warning:
  warning: ANSI C forbids braced-groups within expressions

Adding __extension__ before the statement-expression seems to work right.

Submitted by:	bde (a *long* time ago)
1996-10-21 17:15:05 +00:00
Doug Rabson
425b5191a4 If a large (>4096 bytes) directory was modified, the old directory
contents are discarded, including the cached seek cookies.
Unfortunately, if the directory was larger than NFS_DIRBLKSIZ, then
this confused nfs_readdirrpc(), making it appear as if the directory
was truncated.

Reviewed by:	Karl Denninger <karl@Mcs.Net>
1996-10-21 10:07:52 +00:00
Alexander Langer
92579404e8 Fix signed/unsigned comparison warnings.
Reviewed by:	bde
1996-10-20 21:01:46 +00:00
Poul-Henning Kamp
bd7ea4dcfc Removing old isdn stuff. 1996-10-20 18:35:35 +00:00
Poul-Henning Kamp
494405d890 Removing old isdn stuff. 1996-10-20 18:24:17 +00:00
Poul-Henning Kamp
eca997a43f removing old isdn stuff. 1996-10-20 18:16:49 +00:00
Wolfram Schneider
95e4966c47 add flag FNM_ICASE for case insensitve search
Reviewed by: ache
1996-10-20 15:15:59 +00:00
Poul-Henning Kamp
8e774bbf9d Add four sysctl variables that joerg wanted. 1996-10-20 15:01:58 +00:00
Alexander Langer
af44ef0a2f Reword two comments. 1996-10-19 20:23:12 +00:00
David Greenman
8713ad7411 Kill unnecessary test in coredump() that wasn't removed in rev 1.19
when the check for P_SUGID was added.
1996-10-19 01:06:20 +00:00
Søren Schmidt
c070783c4b Changed mouse functionality a bit, now the pointer disappears if
there is keyboard input.
The mousepointer is shown again immediately if moved.

Also a function pointer used to install a userwritten extra
ioctl handler (sc_user_ioctl). This way its is possible to
install user defined videomodes etc etc. No further changes
should be in the kernel.
1996-10-18 18:51:37 +00:00
Jordan K. Hubbard
d0ec898db5 ns_nettype should be declared, not externed. 1996-10-18 15:59:25 +00:00
Jordan K. Hubbard
889eef6fca Add back line for options NS, though commented out for now until
Tony tells me what to do with the ns_nettype extern which is still
unresolved for this optioin.
1996-10-18 03:52:48 +00:00
Julian Elischer
24b3bdfe8d Just because something doesn't make sense doesn't mean it should be illegal..
just ignore it instead.
===================================================================
RCS file: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v
retrieving revision 1.30
diff -r1.30 devfs_vnops.c
631d630
<           (vap->va_size != VNOVAL) || /* doesn't make sense in devfs */
1996-10-17 22:47:23 +00:00
Poul-Henning Kamp
81acf468e2 DKFL_MULTI lives in flags, not in status. 1996-10-17 21:18:42 +00:00
Bruce Evans
d6b9e17eb5 Improved non-statistical (GUPROF) profiling:
- use a more accurate and more efficient method of compensating for
  overheads.  The old method counted too much time against leaf
  functions.
- normally use the Pentium timestamp counter if available.
  On Pentiums, the times are now accurate to within a couple of cpu
  clock cycles per function call in the (unlikely) event that there
  are no cache misses in or caused by the profiling code.
- optionally use an arbitrary Pentium event counter if available.
- optionally regress to using the i8254 counter.
- scaled the i8254 counter by a factor of 128.  Now the i8254 counters
  overflow slightly faster than the TSC counters for a 150MHz Pentium :-)
  (after about 16 seconds).  This is to avoid fractional overheads.

files.i386:
permon.c temporarily has to be classified as a profiling-routine
because a couple of functions in it may be called from profiling code.

options.i386:
- I586_CTR_GUPROF is currently unused (oops).
- I586_PMC_GUPROF should be something like 0x70000 to enable (but not
  use unless prof_machdep.c is changed) support for Pentium event
  counters.  7 is a control mode and the counter number 0 is somewhere
  in the 0000 bits (see perfmon.h for the encoding).

profile.h:
- added declarations.
- cleaned up separation of user mode declarations.

prof_machdep.c:
Mostly clock-select changes.  The default clock can be changed by
editing kmem.  There should be a sysctl for this.

subr_prof.c:
- added copyright.
- calibrate overheads for the new method.
- documented new method.
- fixed races and and machine dependencies in start/stop code.

mcount.c:
Use the new overhead compensation method.

gmon.h:
- changed GPROF4 counter type from unsigned to int.  Oops, this should
  be machine-dependent and/or int32_t.
- reorganized overhead counters.

Submitted by:	Pentium event counter changes mostly by wollman
1996-10-17 19:32:31 +00:00
Jordan K. Hubbard
04d59a46c0 Bring back netns so that Netcon can take over support for it, as agreed.
This was actually easier than I thought - CVS is smart enough to handle
"resurrections" now. :-)
1996-10-17 18:42:33 +00:00
Jordan K. Hubbard
0082fb4657 I'm not sure why, but Netcon's TFS filesystem code doesn't want to
add free vnodes back to the freelist.  They must do their own vnode
management.  Anyway, this change is *only* activated with their filesystem
and doesn't affect anyone else.  Whoops, forgot the submitted-by lines
in my previous commits too.. :-(
Submitted-By: Tony Ardolino <tony@netcon.com>
1996-10-17 17:56:07 +00:00
Bruce Evans
b40a35f250 Added missing extern declaration of timer_freq.
Sorted declarations of scalars.
1996-10-17 17:31:25 +00:00
Jordan K. Hubbard
88e038fe4a Netcon's changes for their extended NS support. This only effects
people compiling with NS, so the effects on everyone else are nil.
1996-10-17 17:16:58 +00:00
Jordan K. Hubbard
17a6a9e3cc Some very small changes to support Netcon's TFS filesystem.
These patches were formerly applied by the Netcon installer
before rebuilding your kernel.
1996-10-17 17:12:04 +00:00
Nate Williams
b4c9d8eaf5 This patch attempts to make the pccard probe in if_ed.c work with
non-memory-mapped cards.

Submitted by:	Michael Smith <msmith@atrad.adelaide.edu.au>
Reviewed by:	phk,dg
1996-10-17 13:42:13 +00:00
John Dyson
402bcb9621 Fix a problem that could cause msync (or many other things) to deadlock.
The heuristic for managment of memory backing the buffer cache was
nice, but didn't work due to some architectural problems.  Simplify
and improve the algorithm.
1996-10-17 03:04:43 +00:00
John Dyson
a669a6e9a9 Make processes waken up eligible for immediate swap-in. 1996-10-17 02:58:20 +00:00
John Dyson
ad98052216 Clean up the rundown of the object backing a vnode. This should fix
NFS problems associated with forcible dismounts.
1996-10-17 02:49:35 +00:00
Julian Elischer
138e4d769c actually impliment permissions for teh chown/chmod/etc functions
that resemble what the man pages say.
also fix braino (type last week)
1996-10-16 23:14:00 +00:00
Søren Schmidt
717fb679ee Oops forgot to remove a debug printf. 1996-10-16 20:59:08 +00:00
Bruce Evans
ebd707d36a Fixed miscounting for non-statistical (GUPROF) profiling:
- use CROSSJUMP() and CROSSJUMP_LABEL() for conditional jumps from idle()
  into cpu_switch() and vice versa.
- moved badsw code to after cpu_switch().

Cosmetic changes:
- moved sw0 string to be immediately after its caller (badsw).
- removed unused #include.
1996-10-16 18:37:58 +00:00
Bruce Evans
435929a84b Added macros CROSSJUMP(), CROSSJUMP_LABEL() and GPROF_RET. These will
be used to fix some benign(?) bugs in GUPROF profiling.

Fixed stale comments and long lines.
1996-10-16 18:13:25 +00:00
Julian Elischer
336cf5014e Allow the utimes call to work on devfs nodes. 1996-10-16 18:02:53 +00:00
Søren Schmidt
ea5a2b2e00 Prepare kernel to take advantage of "branded" ELF binaries. 1996-10-16 17:51:08 +00:00
Julian Elischer
66478c637b Add support for embedded operation withou console
The boot.c patch is applied only to teh JULIAN_HACK branch
the muted console is controlable by a sysctl variable kern.consmute
1996-10-16 00:19:40 +00:00
Søren Schmidt
b5ca878577 Corrected the setting of winsize on open().
Problem pointed out by David Nugent - davidn@blaze.net.au.
1996-10-15 20:27:07 +00:00
Garrett Wollman
67f7ea2d71 Preserve file flags in accept(2).
Submitted by: fredriks@mcs.com in PR#1775 (this implmentaion is different)
1996-10-15 19:28:44 +00:00
Bruce Evans
62c3734cbe Updated #includes to 4.4lite style. 1996-10-15 19:22:46 +00:00
Bruce Evans
aad9af2ba3 Removed nested include of <sys/proc.h> from <vm/vm_object.h> and fixed
the one place that depended on it.  wakeup() is now prototyped in
<sys/systm.h> so that it is normally visible.

Added nested include of <sys/queue.h> in <vm/vm_object.h>.  The queue
macros are a more fundamental prerequisite for <vm/vm_object.h> than
the wakeup prototype and previously happened to be included by
namespace pollution from <sys/proc.h> or elsewhere.
1996-10-15 18:24:34 +00:00
Bruce Evans
5e26bd9a05 Forward-declared `struct route' for the KERNEL case so that <net/route.h>
isn't a prerequisite.

Fixed style of ifdefs.
1996-10-15 16:54:47 +00:00
Bruce Evans
9e25bb3c6b Synchronized with biosboot/Makefile:
- use gcc-2.7.2 alignment features
- get CWARNFLAGS form <bsd.kern.mk>
- fixed whitespace differences.
1996-10-15 16:26:05 +00:00
John Dyson
675878e732 Move much of the machine dependent code from vm_glue.c into
pmap.c.  Along with the improved organization, small proc fork
performance is now about 5%-10% faster.
1996-10-15 03:16:45 +00:00
Bruce Evans
64a88efa64 Fixed setting of the keyboard LEDs. For some keyboards and/or keyboard
controllers, it is an error to issue a command before the keyboard
has had time to reply to the previous command.  Setting the LEDs
involves issueing 2 commands, so it never worked on these keyboards.

Fixed resetting of keyboard.  It is possible for unprocessed
scancodes to be present when the reset routine is called.  This
usually occurs after switching from one console driver to another
in userconfig.  pcvt and syscons attempt to flush any stale scancodes,
but sometimes fail to do so because keyboard and/or keyboard
controller takes a long time to send the scancodes after reset
(scancodes are apparently not flushed by reset!).  syscons handles
this later by not checking for errors at strategic places, but pcvt
was confused.

Use an impossible initial and failure mode setting for the LEDs
so that the LEDs always get set if they are possibly out of sync.

Added missing spltty() in update_led().
1996-10-14 21:44:05 +00:00
Jordan K. Hubbard
50019cb3c4 Change the boot-time menu. 1996-10-14 21:19:43 +00:00
Paul Traina
972a3f282a Expose the control mechanism for serial console boot so that the default
shipped with freebsd can be changed without modifying the Makefiles directly.

Creates:	BOOT_FORCE_COMCONSOLE
		BOOT_PROBE_KEYBOARD
		BOOT_PROBE_KEYBOARD_LOCK
		BOOT_COMCONSOLE			(port value for console)
1996-10-14 17:25:53 +00:00
David Greenman
a309908dc3 Fixed a bug that got introduced when I changed the CY16_RESET and
CY_CLEAR_INTR definitions. This might have affected probing of ISA
versions of the Cyclom 16/32-Y.
1996-10-14 16:43:11 +00:00
David Greenman
6fd560f670 Make this compile again for the CyDebug case. 1996-10-14 16:10:00 +00:00
Stefan Eßer
b86a81e448 pci_map_mem() did a too restrictive check on the mapping type:
PCI_MAP_MEMORY_TYPE_32BIT_1M should be accepted as well as
PCI_MAP_MEMORY_TYPE_32BIT (and now is).
(Problem reported by David Greenman.)
1996-10-14 13:04:34 +00:00
Bruce Evans
14c0bb7c89 Oops, PROBE_KEYBOARD_LOCK wasn't supposed to be enabled by default. 1996-10-14 12:37:47 +00:00
Stefan Eßer
b7ccd3dc56 Move the initialization of np->ns_sync and ns_async out of ncr_getclock(),
which does no longer get called for non-Ultra cards.
Fix suggested by Gerard Roudier, slightly modified by me.
1996-10-14 10:09:52 +00:00
Poul-Henning Kamp
18acc00c6d Remove some old compatibility names. 1996-10-13 14:36:37 +00:00
Poul-Henning Kamp
6704a50967 Stop using old compatibility names from buf.h 1996-10-13 14:36:06 +00:00
Poul-Henning Kamp
1111860c29 Remove a stale comment. 1996-10-13 07:16:50 +00:00
John Dyson
8de30f117f Pmap_resident_count was mistakenly removed from pmap.h, thereby
disabling the RSS listing in ps and ^T.  This commit re-inserts
the macro defn.
1996-10-13 03:14:57 +00:00
John Dyson
8f3a9a1b78 Minor optimization for final rundown of a pmap. 1996-10-13 01:38:37 +00:00
David Greenman
7a28c2a8cd Change DEVFS device naming convention for cuac*, ttyc*. 1996-10-13 01:30:32 +00:00
David Greenman
3010cd6550 Changes to add support for the PCI version of the Cyclades Cyclom-Y
serial adapter, and support for multiple Cyclom controllers.
1996-10-13 01:09:24 +00:00
Bruce Evans
ccb174975a Fixed lblktosize(). It overflowed at 2G. This bug only affected
ufs_read() and ufs_write().

Found by: looking at warnings for comparing the result of lblktosize()
(which is usually daddr_t = long) with file sizes (which are u_quad_t
for ufs).  File sizes should probably be off_t's to avoid warnings
when the are compared with file offsets, so the fixed lblktosize()
casts to off_t instead of u_quad_t.

Added definition of smalllblksize().  It is the same as the old
lblksize() and is more efficient for small block numbers on 32-bit
machines.

Use smalllblktosize() instead of its expansion in blksize() and
dblksize().  This keeps the line length short and makes it more
obvious that the shift can't overflow.
1996-10-12 22:12:51 +00:00
John Dyson
bdef8bf092 Undo a mistaken change from splhigh to splvm. Subr_rlist has been
capable of being used for things other than swap space allocation,
and splvm would have been appropriate for only swap space allocation
and other VM things.  My commit broke that (and was actually a mistake.)
1996-10-12 21:37:59 +00:00
John Dyson
9d3fbbb5f4 Performance optimizations. One of which was meant to go in before the
previous snap.  Specifically, kern_exit and kern_exec now makes a
call into the pmap module to do a very fast removal of pages from the
address space.  Additionally, the pmap module now updates the PG_MAPPED
and PG_WRITABLE flags.  This is an optional optimization, but helpful
on the X86.
1996-10-12 21:35:25 +00:00
Bruce Evans
da2186afa3 Cleaned up:
- fixed a sloppy common-style declaration.
- removed an unused macro.
- moved once-used macros to the one file where they are used.
- removed unused forward struct declarations.
- removed __pure.
- declared inline functions as inline in their prototype as well
  as in theire definition (gcc unfortunately allows the prototype
  to be inconsistent).
- staticized.
1996-10-12 20:36:15 +00:00
Bruce Evans
8ba0c490a9 Removed __pure's and __pure2's. __pure is a no-op for recent versions
of gcc by definition, and __pure2 is a no-op in effect (presumably the
compiler can see when an inline function has no side effects).
1996-10-12 20:09:48 +00:00
Bruce Evans
4458ac71b1 Removed nested include if <sys/socket.h> from <net/if.h> and
<net/if_arp.h> and fixed the things that depended on it.  The nested
include just allowed unportable programs to compile and made my
simple #include checking program report that networking code doesn't
need to include <sys/socket.h>.
1996-10-12 19:49:43 +00:00
Alexander Langer
bfcffdaf03 Log the interface name which received the packet.
Suggested by:	Hal Snyder <hsndyer@thoughtport.com>
1996-10-12 19:38:50 +00:00
Bruce Evans
e07fd62c16 Staticized `nfs_dwrite'. 1996-10-12 17:39:39 +00:00
Bruce Evans
71f4712b50 Staticized. Things exported by linker sets should always be static. 1996-10-12 17:34:25 +00:00
Stefan Eßer
bdf9734704 Fix previous commit: The INB/OUTB macros require np->vaddr to be
initialized, or a kernel panic will occur.

Submitted by:	Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1996-10-12 17:33:48 +00:00
Bruce Evans
bcb2e44399 Moved declarations of tsleep() and wakeup() from proc.h to systm.h so
that proc.h doesn't have to be included so often.
1996-10-12 16:11:58 +00:00
Bruce Evans
2dab355e6b Removed verbose comment about `securelevel'. It just duplicated part
of init.8 except for bugs and anachronisms.
1996-10-12 15:54:04 +00:00
Julian Elischer
1737b9d383 reads and writes to devices update m and a times
add some security onn the chmod/chown operations
should now be root or owner
(still needs more thought but kinda-plugs tow holes pointed out by bde)
1996-10-12 00:07:53 +00:00
Stefan Eßer
20bc4c3ac1 Improve support of SCSI cards based on the 53c860 and 53c875.
Still no support for Ultra-SCSI and other new features, but the code
should now correctly initialize the clock pre-scaler (based on freqency
measurement results, if necessary).

Fix support of 16 targets for WIDE SCSI.

Disable bus reset in case no progress is made for too long ("ncr dead"
message), which did not work too well with scanners and other slow devices.
1996-10-11 19:50:12 +00:00
Paul Traina
a51764a8bf Fix two bugs I accidently put into the syn code at the last minute
(yes I had tested the hell out of this).

I've also temporarily disabled the code so that it behaves as it previously
did (tail drop's the syns) pending discussion with fenner about some socket
state flags that I don't fully understand.

Submitted by:	fenner
1996-10-11 19:26:42 +00:00
Garrett Wollman
a3af8d44a3 Add primitive link MIB support. 1996-10-11 18:40:48 +00:00
Garrett Wollman
f5b7ed3e67 Implement the RFC 1650 MIB. 1996-10-11 15:19:23 +00:00
Jordan K. Hubbard
05c7537241 Yikes! This must have fallen in with a mass-commit by mistake.
Put RELEASE back.
Pointed-out-by: peter
1996-10-11 14:35:10 +00:00
Doug Rabson
f31dba4c5d This fixes a problem with the nfs socket handling code which happens
if a single process is performing a large number of requests (in this
case writing a large file).  The writing process could monopolise the
recieve lock and prevent any other processes from recieving their
replies.

It also adds a new sysctl variable 'vfs.nfs.dwrite' which controls the
behaviour which originally pointed out the problem.  When a process
writes to a file over NFS, it usually arranges for another process
(the 'iod') to perform the request.  If no iods are available, then it
turns the write into a 'delayed write' which is later picked up by the
next iod to do a write request for that file.  This can cause that
particular iod to do a disproportionate number of requests from a
single process which can harm performance on some NFS servers.  The
alternative is to perform the write synchronously in the context of
the original writing process if no iod is avaiable for asynchronous
writing.

The 'delayed write' behaviour is selected when vfs.nfs.dwrite=1 and
the non-delayed behaviour is selected when vfs.nfs.dwrite=0.  The
default is vfs.nfs.dwrite=1; if many people tell me that performance
is better if vfs.nfs.dwrite=0 then I will change the default.

Submitted by:	Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1996-10-11 10:15:33 +00:00
John Dyson
f2c832d788 Mostly some fixes from bde to start support for ASYNC I/O (SIGIO).
Submitted by:	bde
1996-10-11 02:27:30 +00:00
Poul-Henning Kamp
932b06fca5 Added a bdev and cdev for "geometry disk", my generic disk geometry subsystem.
I really wish somebody would complete DEVFS :-(
1996-10-10 20:41:13 +00:00
Garrett Wollman
4f02305016 Implement the 802.3 MIB in a way that uses the generic interface
defined in if_mib.h.
1996-10-10 19:44:10 +00:00
Bruce Evans
a0ea75ecbd Don't include "opt_cpu.h" in <machine/clock.h>, since this breaks lkm's.
The change breaks kern_clock.c; fix that temporarily by including
"opt_cpu.h" there.
1996-10-10 10:25:26 +00:00
Bruce Evans
10c84befd7 Added missing include of "opt_cpu.h". I missed it because PERFMON
features are used without testing for i586 features that they depend
on.  Configuring option PERFMON without configuring a suitable cpu
still doesn't fail right.
1996-10-10 10:18:48 +00:00
Bruce Evans
9829c47606 Fixed spelling errors in function names in previous commit. 1996-10-10 08:04:03 +00:00
Paul Traina
e0c973266d The recent change to clock.h to include opt_cpu.h (bug!!!) uncovered a
compile error in ncrcontrol.c -- ncr.c should not be including clock.h
when not compiled for the kernel.
1996-10-10 04:09:37 +00:00
Jordan K. Hubbard
978afeee5f Correct the intro text so user is not encouraged to step off cliffs.
Also document the fact that you can hit ESC to skip configuration.
1996-10-09 23:36:54 +00:00
Satoshi Asami
dffcea8d5f Another round of updates. Highlights:
(1) Merged i386/i386/sb.h, deleted pc98/pc98/sb.h.

(2) pc98/conf/GENERIC8 looks more like i386/conf/GENERIC now.

(3) Fixed display bug in pc98/boot/biosboot/io.c.

(4) Prepare to merge memory allocation routines:

	pc98/i386/locore.s
	pc98/i386/machdep.c
	pc98/pc98/pc98_machdep.c
	pc98/pc98/pc98_machdep.h

(5) Support new board "C-NET(98)":

	pc98/pc98/if_ed98.h
	pc98/pc98/if_ed.c

(6) Make sure FPU is recognized for non-Intel CPUs:

	pc98/pc98/npx.c

(7) Do not expect bss to be zero-allocated:

	pc98/pc98/pc98.c

Submitted by:	The FreeBSD(98) Development Team
1996-10-09 21:47:16 +00:00
Bruce Evans
c20b324bb6 Put I*86_CPU defines in opt_cpu.h. 1996-10-09 19:47:44 +00:00
Bruce Evans
272937b07f Oops, this wasn't supposed to have -Wcast-qual yet.
Also disabled -Wunused.  It caused too many warnings even for me.
The sign mismatch warnings should be fixed first.  They are more
important and harder to disable (they are controlled by -W, which
controls too many things).
1996-10-09 18:41:40 +00:00
Bruce Evans
d656e316f8 Added new documented options I586_OPTIMIZED_BCOPY and I586_OPTIMIZED_BZERO.
Added old misnamed option I586_FAST_BCOPY in options.i386.

Added old undocumented CLK* and SI_DEBUG options in LINT.
1996-10-09 18:36:44 +00:00
Garrett Wollman
6303c69c89 Get rid of obsolete RTF_MASK and RTF_CHAINDELETE flags. 1996-10-09 18:35:10 +00:00
Jordan K. Hubbard
b4a346809a Accept 'Q' or 'ESC' in intro screen as a "Jane, stop this crazy thing!"
request.
1996-10-09 18:31:20 +00:00
Bruce Evans
cf232f113f Enable the i586-optimized bcopy if the cpu is a "586" and option
I586_OPTIMIZED_BCOPY is configured.

Similarly for bzero/I586_OPTIMIZED_BZERO.

Fake 586's had better have a hardware FPU with non-broken exception
handling (we mask exceptions, but broken exception handling may trap
on the instructions that do the masking).  I guess this means that
the routines won't work on most 386's or FPUless 486's even when they
have a h/w FPU.
1996-10-09 18:30:08 +00:00
Bruce Evans
18860b410d Added i586-optimized bcopy() and bzero().
These are based on using the FPU to do 64-bit stores.  They also
use i586-optimized instruction ordering, i586-optimized cache
management and a couple of other tricks.  They should work on any
i*86 with a h/w FPU, but are slower on at least i386's and i486's.
They come close to saturating the memory bus on i586's.  bzero()
can maintain a 3-3-3-3 burst cycle to 66 MHz non-EDO main memory
on a P133 (but is too slow to keep up with a 2-2-2-2 burst cycle
for EDO - someone with EDO should fix this).  bcopy() is several
cycles short of keeping up with a 3-3-3-3 cycle for writing.  For
a P133 writing to 66 MHz main memory, it just manages an N-3-3-3,
3-3-3-3 pair of burst cycles, where N is typically 6.

The new routines are not used by default.  They are always configured
and can be enabled at runtime using a debugger or an lkm to change
their function pointer, or at compile time using new options (see
another log message).

Removed old, dead i586_bzero() and i686_bzero().  Read-before-write is
usually bad for i586's.  It doubles the memory traffic unless the data
is already cached, and data is (or should be) very rarely cached for
large bzero()s (the system should prefer uncached pages for cleaning),
and the amount of data handled by small bzero()s is relatively small
in the kernel.

Improved comments about overlapping copies.

Removed unused #include.
1996-10-09 18:16:17 +00:00
Bruce Evans
14f3567a32 Don't claim the console when the driver is disabled. The getc/putc
part of the console driver usually works when the driver is disabled,
but the normal read/write part doesn't (it caused a panic).
1996-10-09 15:24:21 +00:00
Bruce Evans
50ec4d5916 Added option PROBE_KEYBOARD_LOCK which gives a serial console if the
keyboard is locked.
1996-10-08 22:41:34 +00:00
Bruce Evans
4fd6d53a24 Saved about 160 bytes by using the gcc-2.7 alignment options. 1996-10-08 22:35:48 +00:00
Bruce Evans
5bac261e76 Print the dos device number for read failures. 1996-10-08 22:31:31 +00:00
Bruce Evans
86f17a898e Removed unused arg to badsect(). It wasted 16 bytes.
Staticized badsect().

Avoid warning for benign signed vs unsigned comparison.
1996-10-08 22:25:22 +00:00
Bruce Evans
3eeeca733b Use the same warning flags as for the kernel. This causes surprisingly
few warnings.
1996-10-08 22:18:34 +00:00
Bruce Evans
6b30bfd370 Oops, forgot to cvs add bsd.kern.mk.
Centralized the definition of CWARNFLAGS into bsd.kern.mk.
1996-10-08 22:10:49 +00:00
Bruce Evans
9e72552ff0 Centralized the definition of CWARNFLAGS into bsd.kern.mk. 1996-10-08 22:09:03 +00:00
Bruce Evans
e8e87818d1 Fixed pessimized (short) i/o port types. 1996-10-08 21:08:18 +00:00
Marc G. Fournier
524e95de2b Fixed the wrong include file for a "prototype mismatch" error between
dlfcn.h and link.h
1996-10-08 01:38:36 +00:00
Marc G. Fournier
0e9cb8bed8 dlfcn.h and link.h have conflicting declarations for dlopen/dlsym,
with dlfcn.h declaring them as:

void *dlopen __P((const char *, int));
void *dlsym __P((void *, const char *));

while link.h declared them as

extern void *dlopen __P((char *, int));
extern void *dlsym __P((void *, char *));

Fix link.h to match dlfcn.h
1996-10-07 20:49:03 +00:00
Garrett Wollman
5893891624 All three files: make COMPAT_IPFW==0 case work again.
ip_input.c:
	- delete some dusty code
	- _IP_VHL
	- use fast inline header checksum when possible
1996-10-07 19:21:46 +00:00
Garrett Wollman
011acecf50 Remove some historical cruft inherited from the loopback driver in which
there were three possible different code paths through which we could
discard a packet (which, after all, is the entire function of this interface).
1996-10-07 19:11:55 +00:00
David Greenman
6d6a026b47 Improved in_pcblookuphash() to support wildcarding, and changed relavent
callers of it to take advantage of this. This reduces new connection
request overhead in the face of a large number of PCBs in the system.
Thanks to David Filo <filo@yahoo.com> for suggesting this and providing
a sample implementation (which wasn't used, but showed that it could be
done).

Reviewed by:	wollman
1996-10-07 19:06:12 +00:00
Garrett Wollman
545c48b83a Fix padding of short packets (PR#1701).
Submitted by: seki@sysrap.cs.fujitsu.co.jp
1996-10-07 17:50:00 +00:00
Paul Traina
ebb0cbea75 Increase robustness of FreeBSD against high-rate connection attempt
denial of service attacks.

Reviewed by:	bde,wollman,olah
Inspired by:	vjs@sgi.com
1996-10-07 04:32:42 +00:00
Justin T. Gibbs
1e03c19aab Try number two. Add missing paren in MSG_IDENTIFY macro. 1996-10-07 03:53:43 +00:00
Justin T. Gibbs
0a42ab8379 Advanced Systems Inc. SCSI Controller driver and ISA/VL front end.
I have only tested the ABP5140 card and only with a single CDROM drive
but it seems to work fine.  This driver relies on features found only in
the SCSI branch so will not work in -current until those changes
are brought in.  It also doesn't have any error handling code *yet*.
The goal is to use this driver as the development platform for the new
generic SCSI layer error recovery/handling code.

PCI and EISA front ends will show up as soon as I get my hands on
the cards.  There are also a few issues in the driver that I need
to clear up with AdvanSys before I can suggest sticking one of
these cards in your server. 8-)

Thanks to AdvanSys for releasing this code under a suitable copyright.

Obtained from:  Ported from the Linux driver writen by
		bobf@advansys.com (Bob Frey).
1996-10-07 02:07:07 +00:00
Justin T. Gibbs
b109ceda2f Bring in bug fix from 'SCSI' branch. 1996-10-06 22:50:56 +00:00
John Dyson
853a7bc893 Make the default cache size optim to be 256K, the old default was
64K.  The change has essentially neutral effect on those machines with
little or no cache, and has a positive effect on "normal" machines
with 256K or more cache.
1996-10-06 22:26:13 +00:00
Wolfram Schneider
353ef7f927 delete unused variable BINDIR, use new variable MODLOAD/MODUNLOAD 1996-10-06 22:17:16 +00:00
Wolfram Schneider
7bc830bb88 add variables MODLOAD and MODUNLOAD for modlad/modunload commands 1996-10-06 22:10:35 +00:00
John Dyson
66166d45de Substitution of a long divide by a shift. Other cosmetic improvements.
Submitted by:	bde
1996-10-06 21:19:33 +00:00
Justin T. Gibbs
020f6d4ee5 If, during an SDTR negotiation, the target comes back with a response
that is too low for the aic7xxx chip to handle with sync transfers,
negotiate async transfers.
1996-10-06 19:43:36 +00:00
Bruce Evans
bb2038d538 Improved the btodb() and dbtob() macros. I made them give unsigned
[long long] results when I last worked on them, but they are normally
used together with to daddr_t's and off_t's which are signed, so the
unsigned results did little except cause warnings.
1996-10-06 19:24:02 +00:00
Bruce Evans
e2bbfa26bd Cleaned up vm types. Cosmetic.
The main change is from unsigned long unsigned int.  It just needs to
be a 32-bit type and unsigned int is most natural.  Using a non-long
type has the "advantage" of hiding bugs in the "machine-independent"
code where it prints foo_t's using %d or %x.  These bugs are currently
hidden bug not compiling with -Wformat.

I tried changing vm_ooffset_t from long long to unsigned long long, but
that was wrong because vm_ooffset_t needs to be long to match off_t,
although file offsets are never negative.

Reviewed by:	dyson
1996-10-06 19:13:37 +00:00
John Dyson
f7d6dab2fd Fix a problem with the page coloring code that the system will not always
be able to use all of the free pages.  This can manifest as a panic
using DIAGNOSTIC, or as a panic on an indirect memory reference.
1996-10-06 18:27:39 +00:00
Justin T. Gibbs
2ea8799246 Bring aic7xxx driver bug fixes from 'SCSI' into current. 1996-10-06 16:38:45 +00:00
Bruce Evans
d1f6ee03f1 Fixed build of LINT yet again. getchar() clashed with getchar() in pcvt.
Staticized it in userconfig.  The one in pcvt is unused.

Removed bogus unused arg to getchar().  This should not have compiled
in the USERCONFIG_BOOT case, but the getchar() was also non-prototyped
and defined in K&R style.

Staticized the badly named global variable `next'.  Even static variables
should have a unique module-specific prefix so that they can be referenced
easily in debuggers, etc.
1996-10-06 16:30:15 +00:00
David Greenman
8d0f240d36 Moved a #if for VISUAL_USERCONFIG case...the last commit didn't completely
fix the problem.
1996-10-06 15:27:36 +00:00
Jordan K. Hubbard
3a501ea715 Conditionalize introfunc on USERCONFIG_BOOT && VISUAL_USERCONFIG 1996-10-06 10:15:27 +00:00
John Dyson
ffe2522e29 Fix 4 problems:
Major: When blocking occurs in allocbuf() for VMIO files,
	       excess wire counts could accumulate.
	Major: Pages are incorrectly accumulated into the physical
	       buffer for clustered reads.  This happens when bogus
	       page is needed.
	Minor: When reclaiming buffers, the async flag on the buffer
	       needs to be zero, or the reclaim is not optimal.
	Minor: The age flag should be cleared, if a buffer is wanted.
1996-10-06 07:50:05 +00:00
Justin T. Gibbs
5a3df2165a Bring this over from the SCSI branch. I need it to bring in the fixes to
the aic7xxx driver.
1996-10-06 02:14:31 +00:00
Jordan K. Hubbard
8996308b98 Document USERCONFIG_BOOT, even though it doesn't belong where it is. ;-) 1996-10-05 11:01:24 +00:00
Jordan K. Hubbard
d50a30076c Multiple changes stacked as one commit since they all depend on one another.
First, change sysinstall and the Makefile rules to not build the kernel
nlist directly into sysinstall now.  Instead, spit it out as an ascii
file in /stand and parse it from sysinstall later.  This solves the chicken-n-
egg problem of building sysinstall into the fsimage before BOOTMFS is built
and can have its symbols extracted.  Now we generate the symbol file in
release.8.

Second, add Poul-Henning's USERCONFIG_BOOT changes.  These have two
effects:

	1. Userconfig is always entered, rather than only after a -c
	   (don't scream yet, it's not as bad as it sounds).

	2. Userconfig reads a message string which can optionally be
	   written just past the boot blocks.  This string "preloads"
	   the userconfig input buffer and is parsed as user input.
	   If the first command is not "USERCONFIG", userconfig will
	   treat this as an implied "quit" (which is why you don't need
	   to scream - you never even know you went through userconfig
	   and back out again if you don't specifically ask for it),
	   otherwise it will read and execute the following commands
	   until a "quit" is seen or the end is reached, in which case
	   the normal userconfig command prompt will then be presented.

  How to create your own startup sequences, using any boot.flp image
from the next snap forward (not yet, but soon):

	% dd of=/dev/rfd0 seek=1 bs=512 count=1 conv=sync <<WAKKA_WAKKA_DOO
USERCONFIG
irq ed0 10
iomem ed0 0xcc000
disable ed1
quit
WAKKA_WAKKA_DOO


Third, add an intro screen to UserConfig so that users aren't just thrown
into this strange screen if userconfig is auto-launched.  The default
boot.flp startup sequence is now, in fact, this:

	USERCONFIG
	intro
	visual

(Since visual never returns, we don't need a following "quit").

Submitted-By: phk & jkh
1996-10-05 10:44:07 +00:00
Julian Elischer
dd45d8ad18 If we have no console device it is possible to be
1/ session leader
2/ Have a console device vnode (/dev/console)
3/ have  NULL pointer for a consoel tty struct.

fix the only case where the tty struct is referenced without a prior
check for existance.
1996-10-04 23:43:12 +00:00
David Greenman
d41fe60984 Oops, missed a chunk in that last commit. 1996-10-04 14:17:32 +00:00
David Greenman
1c41fd74b9 Implemented a more sophisticated mechanism for finding the chip iobase
so that 32Y boards will work.
Fixed bogus indenting and added a pair of parens.
1996-10-04 10:33:13 +00:00
David Greenman
8d1005c8c4 Added multicast support (BPF cookie bug was already fixed).
Submitted by:	Steven McCanne <mccanne@cs.berkeley.edu>
1996-10-03 10:47:03 +00:00
Jordan K. Hubbard
890c2894d8 Make return or newline synonymous with down-arrow in the value editor.
It's a lot easier to whap through multiple changes if you can use the return
key.
1996-10-03 07:51:40 +00:00
Peter Wemm
1a7eb2dcab Drop an unused param to unmap_pages(). 1996-10-03 06:14:48 +00:00
Jordan K. Hubbard
a1406d7cf0 Fix stupid typo. 1996-10-03 01:22:22 +00:00
Jordan K. Hubbard
e669728232 Add fxp and vx to list of known device types. 1996-10-03 01:01:01 +00:00
Jordan K. Hubbard
0c8c5f852a scresume erroneously used before declared. Move the function
rather than add another APM ifdef just for the forward decl.
[Boy, sure a lot of warnings in here!]
1996-10-03 00:42:27 +00:00
Søren Schmidt
4a8aeffeb2 Fixed the userconfig problem (and one with ddb as well).
The rudimentary support for a splash page is there, and works, it
just needs a splash page...
1996-10-02 22:00:38 +00:00
Jordan K. Hubbard
1ffb1e5eb6 New support for displaying PCI devices without making you insane.
Submitted-by: msmith [bless his heart]
1996-10-02 08:09:09 +00:00
John Dyson
39b1a97c77 MSDOS FS used to allocate a buffer before extending the VM object. In
certain error conditions, it is possible for pages to be left allocated
in the object beyond it's end.  It is generally bad practice to allocate
pages beyond the end of an object.
1996-10-02 05:01:17 +00:00
Paul Traina
14b7c0f2f9 add SC_SPLASH_SCREEN to opt_syscons.h (sigh) 1996-10-02 03:48:09 +00:00
Søren Schmidt
d58801b2ee Fixed the "missing updates" reported by ache.
Moved a little closer to having a splash page capability.
1996-10-01 23:24:09 +00:00
Jordan K. Hubbard
10dce6c9f3 #ifdef another instance of toggle_splash_screen() which Soren missed. 1996-10-01 07:38:14 +00:00
Paul Traina
6e702c9964 Document the Adaptec driver options for tagged command queueing and SCB
paging (with a warning not to use SCB paging) and create an opt_aic7xxx.h
file for these options.
1996-10-01 03:01:06 +00:00
Peter Wemm
f62b417ba5 Add support for storing a -R path in ld in the section dispatch table,
support LD_HINTS_VERSION_2 that has the ldconfig pathname stored in the
ld.so.hints file (ie: a new library can be installed and used without
needing to run ldconfig -m first)

Reviewed by: nate, jdp
Obtained from: NetBSD (mostly)
1996-10-01 00:25:32 +00:00
Peter Wemm
8bd5578830 Add the linker set stab types: N_SETA N_SETT N_SETD N_SETB N_SETV 1996-10-01 00:01:43 +00:00
Søren Schmidt
ebe3b2aabd Dont make splash screen the default :) 1996-09-30 23:10:35 +00:00
Søren Schmidt
a221620c79 Fix a couble of nasties regarding mouse pointer and different
resolutions.
Allow middle mouse button to be used for pasting.
Also added the beginnings of support for a splash page.
1996-09-30 23:00:58 +00:00
Julian Elischer
793dc173fa if we jump the time, we need to check all the process real interval timers. 1996-09-30 19:28:52 +00:00
Bruce Evans
92d0aa20dc Work around UMC8669F and Startech UART bugs by not writing to the
divisor latch registers if the registers wouldn't change.

Use the default console cfcr setting while setting the divisor
latch registers for console i/o.  Input may be messed up by
transiently changing the cfcr.

Use a usual cfcr setting while setting the divisor latch registers
in the probe.  This shouldn't matter, but this is not the place to
test the UART's handling of 5 bit words.

Removed a stale devfs comment.
1996-09-30 12:22:27 +00:00
Bruce Evans
edbfbd9280 Whaddya know, visual userconfig sort of supports pci, but the support
was always disabled because "pci.h" wasn't included.  Now the configured
pci devices are listed and you can edit bogus flags for them.

Fixed bitrot in the disabled code.  A used #include was removed and const
poisoning wasn't fixed.

Removed unused #include.
1996-09-30 11:25:19 +00:00
Bruce Evans
ece15d78ea Added "memory" to clobber list in invlpg(). It needs it if invltlb()
needs it.

Fixed style in invlpg().

Sorted recently renamed functions.

Added prototypes in the non-gcc section for recently added/renamed
functions.
1996-09-29 18:35:07 +00:00
Bruce Evans
dc927d0c6b Started unspamming <sys/systm.h>. Don't include <machine/stdarg.h>
to get the declaration of va_list; just use _BSD_VA_LIST.  Fixed
the 2 places that need <machine.stdarg.h> but didn't include it
explicitly.
1996-09-29 15:00:37 +00:00
David Greenman
78fb85bbf7 Backed out one of my "performance optimizations" as it results in sometimes
not resuming the NIC as required for transmit. Thanks to Alan Cox
<alc@cs.rice.edu> for noticing this.
Added another performance optimization to compensate. :-)

Changed crscdt to 1...strange, but this seems to be needed for some reason
despite what the manual says.
1996-09-29 10:20:45 +00:00
John Dyson
27e9b35e07 Essentially rename pmap_update to be invltlb. It is a very machine
dependent operation, and not really a correct name.  invltlb and invlpg
are more descriptive, and in the case of invlpg, a real opcode.

Additionally, fix the tlb management code for 386 machines.
1996-09-28 22:37:57 +00:00
Bruce Evans
322dfc2bd5 Fixed undeclared variables for the !(PQ_L2_SIZE > 1) case.
Removed redundant #include.
1996-09-28 17:53:18 +00:00
Bruce Evans
efebc4ab84 Fixed bitrot in the read-only attribute:
- kern.maxfilesperproc was read-only (and thus essentially useless).

Removed unused #includes.  Strength-reduced used #includes.
1996-09-28 16:33:21 +00:00
Bruce Evans
7c1aacb5be Oops, read-only is spelled RD here. 1996-09-28 15:53:30 +00:00
Bruce Evans
501b55314c Fixed bitrot in the read-only attribute:
- kern.maxproc and kern.maxprocperuid were read-only (and thus essentially
  useless.  Apparently no one uses them).
- all the user sysctls were read-write (and thus it was possible for them
  to be inconsistent with the authoritative fixed values in the library).

Removed unused #include.
1996-09-28 15:43:39 +00:00
Bruce Evans
f53687f7b5 Restored my change in rev.1.119 which was clobbered by the previous commit. 1996-09-28 15:28:40 +00:00
John Dyson
9299d3c4bb Move pmap_update_1pg to cpufunc.h. Additionally,
use the invlpg opcode instead of the nasty looking .byte directives.
There are some other minor micro-level code improvements to pmap.c
1996-09-28 04:22:46 +00:00
John Dyson
a8f42fa9a6 Correct vget by removing a window where a vnode can potentially go away. 1996-09-28 03:36:07 +00:00
John Dyson
a2f4a84696 Reviewed by:
Submitted by:
Obtained from:
1996-09-28 03:33:40 +00:00
Bruce Evans
e2e0d560a2 Added -I- to ${INCLUDES}. This makes 4.4Lite's (mis?)use of "foo.h"
for headers in the compile directory work unsurprisingly.  Without
-I-, the search for "foo.h" begins in the directory of the file
that includes it, and the compile directory is only searched because
`-I.' is in ${INCLUDES}.

Removed -I$S/sys from ${INCLUDES}.  It was once necessary to find
things like "param.h" in $S/sys.  Now <sys/param.h> is found in $S.
1996-09-27 16:34:16 +00:00
Peter Wemm
ed82824ef8 Some warning cleanups. There were some needless casts that also caused
gcc -Wcast-qual to scream.  There's still quite a few left, but since I'm
cleaning out my tree, I'll commit these now.
1996-09-27 13:50:59 +00:00
Peter Wemm
32d8f04c11 part 2 of the bsdi compat tweak attempt. I believe that BSDI use both
lcall 7,0 (ie: ldt slot 0) and lcall 0x87,0 (ldt slot 16, it's shifted
three bits to the left).  I was fiddling with this so long ago, I don't
recall the specifics.
1996-09-27 13:38:02 +00:00
Peter Wemm
90af01bef3 Apparently, BSDI have a new system call gate. I was experimenting
with this quite a while ago when somebody reported a BSD/OS 2.1 binary
that wouldn't run.  I'm pretty sure they tried it and I'm pretty sure
they mentioned to me that the patch worked.
1996-09-27 13:33:49 +00:00
Peter Wemm
ad3bbe7a2d Drat, missed this prototype for random_select(). 1996-09-27 13:29:41 +00:00
Peter Wemm
983febf3dc I've been meaning to commit this for months. Implement select()
for /dev/random and /dev/urandom.  Both are always writable, urandom is
always readable, and /dev/random is readable when >= 8 bits are in the
pool.
1996-09-27 13:25:13 +00:00
Paul Traina
b3f3fea5fd Fix a couple of bugs causing false positives 1996-09-26 20:52:13 +00:00
Bruce Evans
388dfa7112 Fixed a few hundred warnings (2400 in LINT) for signed vs unsigned
comparisons in the inb() and outb() macros.  I decided that int args
are OK here.  Any type that can hold a u_int16_t without overflow
is correct, and 32-bit types are optimal.

Introduced a few tens of warnings (100 in LINT) for use of pessimized
(short) types for the port arg.  Only a few drivers are affected by
this.  u_short pessimizations aren't detected.

Added `__extension__' before the statement-expression in inb() so
that it can be compiled without warnings by gcc -pedantic.
1996-09-24 17:47:59 +00:00
Bruce Evans
0c8ea4d48c Eliminated includes of the "temporary" backwards compatibility header
<sys/dir.h> in applications.  Maintained existing (inadequate) ifdefs
for dir.h vs dirent.h in libdialog, amd and rarpd, but didn't add any
new ones.
1996-09-24 08:08:11 +00:00
Peter Wemm
a6fc828816 call srandom() during the boot to start the sequence with a slightly less
predictable seed.
1996-09-23 04:37:54 +00:00
Peter Wemm
840a0352e9 add simple srandom() and prototype 1996-09-23 04:31:43 +00:00
Wolfram Schneider
148531ef1e add forgotten $Id$ 1996-09-22 21:56:57 +00:00
Poul-Henning Kamp
d920a829d4 Remove the extra length field from the utrace entries. It's redundant. 1996-09-22 18:17:51 +00:00
Bruce Evans
38a14cf7f6 Reformatted FreeBSD additions to match 4.4Lite style. Mixed tabs and
spaces after #define's look ugly in diffs.
1996-09-22 14:57:44 +00:00
David Greenman
1cd443ace8 Fixed a bug with the management of the pointer to the first TxCB in the
ring that caused wrong things to happen sometimes.
Doubled the number of transmit descriptors to 128 so that the internal
FIFO in the NIC can be fully filled when dealing with small packets.
Several minor performance improvements.
1996-09-22 11:48:54 +00:00
Gary Palmer
9986e07e1f Remove the code that renices +4 a process that has had 10 minutes of
CPU time. I find it slightly annoying on one of our servers here.

Also disliked by: David Greenman
1996-09-22 06:35:24 +00:00
Bruce Evans
ebedb5ad97 Cleaned up all headers that include <sys/ioctl.h> or <sys/ioccom.h>:
- don't include <sys/ioctl.h> in any header.  Include <sys/ioccom.h>
  instead.  This was already done in 4.4Lite for the most important
  ioctl headers.  Header spam currently increases kernel build
  times by 10-20%.  There are more than 30000 #includes (not counting
  duplicates) for compiling LINT.
- include <sys/types.h> if and only it is necessary to make the header
  almost self-sufficient (some ioctl headers still need structs from
  elsewhere).
- uniformized idempotency ifdefs.  Copied the style in the 4.4Lite
  ioctl headers.
1996-09-21 14:59:43 +00:00
Bruce Evans
83f52dabab Include <sys/filio.h> explicitly - don't depend on <machine/soundcard.h>
bogusly defining non-soundcard ioctls.
1996-09-21 14:53:28 +00:00
Bruce Evans
ec16abb2c5 Moved the prototype for ioctl() from <sys/ioctl.h> to <sys/ioccom.h>
so that applications don't have to include <sys/ioctl.h> just to get
a prototype for ioctl().
1996-09-21 08:42:37 +00:00
Paul Traina
12eafeb016 I don't understand, I committed this fix (move a counter and fixed a typo)
this evening.

I think I'm going insane.
1996-09-21 06:39:20 +00:00
Andrey A. Chernov
96d719e6e0 Syntax error: so_incom -> so_incomp 1996-09-21 06:30:06 +00:00
Bruce Evans
88ce2dfc41 Fiexed CFLAGS. Compiling things in the kernel without -O now causes
zillions of warnings about static inline functions because `inline'
is ignored without -O.
1996-09-21 01:51:11 +00:00
Paul Traina
4195b4af58 If the incomplete listen queue for a given socket is full,
drop the oldest entry in the queue.

There was a fair bit of discussion as to whether or not the
proper action is to drop a random entry in the queue.  It's
my conclusion that a random drop is better than a head drop,
however profiling this section of code (done by John Capo)
shows that a head-drop results in a significant performance
increase.

There are scenarios where a random drop is more appropriate.
If I find one in reality, I'll add the random drop code under
a conditional.

Obtained from: discussions and code done by Vernon Schryver (vjs@sgi.com).
1996-09-20 21:25:18 +00:00
Bruce Evans
253c0899b2 Don't include <sys/conf.h> for the kernel in disk-related headers.
It is needed for implementation details but very little of it is
needed for the interface.  Include it in the few places that didn't
already include it.

Include <sys/ioccom.h> in <sys/disklabel.h> (as already in
<sys/diskslice.h>) so that all the disk-related headers are almost
self-sufficient.
1996-09-20 17:39:44 +00:00
Bruce Evans
ec55e44ec8 Changed an arg name in the pseudo-prototype for bzero() to match
the prototype.

Put the jump table for i486_bzero() in the data section.  This
speeds up i486_bzero() a little on Pentiums without significantly
affecting its speed on 486's.

Don't waste time falling through 14 nop's to return from do1 in
i486_bzero().

Use fastmove() for counts >= 1024 (was > 1024).  Cosmetic.

Fixed profiling of fastmove().

Restored meaningful labels from the pre-1.1 version in fastmove().
Local labels are evil.

Fixed (high resolution non-) profiling of __bb_init_func().
1996-09-20 16:52:09 +00:00
Bruce Evans
a1971699ac Fixed lots of warnings from gcc-2.7.x about "left-hand operand of
comma expression has no effect" in the MAKE_SET() macro.  This also
fixes compiling with -O3 (which removes static functions unless
there is a suitable reference to them).  Declaring all the static
symbols as __unused would also fix the warning, but would be bogus
(they are used) and wouldn't fix -O3.  However, the dummy pointers
for the references waste about 1.5K text and 20K symbol space for
GENERIC.  This wastage hasn't changed - the dummy pointers are just
nonzero now.
1996-09-20 14:36:14 +00:00
David Greenman
eadd5e3a24 Fixed a bug in the receive buffer allocation code that resulted in a
panic if an mbuf cluster couldn't be allocated. This was caused by a
failure to re-initialize m_data when the old mbuf/mbcluster was recycled.
1996-09-20 11:05:39 +00:00
Paul Traina
9c4b2574d4 Handle ICMP codes defined in RFC1812 more appropriately 1996-09-20 08:23:54 +00:00
Nate Williams
d977b72dbd Whoops, I should've used the LINT config file. More ts -> tv changes
for timespec structure.
1996-09-20 05:56:36 +00:00
Nate Williams
95a1574e4f Whoops, I should've used the LINT config file. More ts -> tv changes
for timespec structure.
1996-09-20 05:51:12 +00:00
David Greenman
3163485ccc Add back shutdown support, this time using the at_shutdown() mechanism. 1996-09-20 04:35:15 +00:00
David Greenman
4a684684f4 When the devconf stuff was ripped out of the kernel, the ripper neglected
to deal with the fact that we relied on devconf to do the shutdown
callouts in various drivers. The changes in this commit are to add support
for device shutdown in this driver via the new at_shutdown() mechanism.
Similar changes need to be made to all of the other drivers that need
a shutdown routine called (if_de.c comes to mind immediately).
1996-09-20 04:11:53 +00:00
John Dyson
08c2c9ddf5 Fix an spl window, a page manipulation at interrupt time that was
incorrect, and correct the support for B_ORDERED.  The spl window
fix was from Peter Wemm, and his questions led me to find the problem with
the interrupt time page manipulation.
1996-09-20 02:26:35 +00:00
Poul-Henning Kamp
e6c4b9ba32 Add the utrace(caddr_t addr,size_t len) syscall, that will store the
data pointed at in a ktrace file, if this process is being ktrace'ed.
I'm using this to profile malloc usage.
The advantage is that there is no context around this call, ie, no
open file or socket, so it will work in any process, and you can
decide if you want it to collect data or not.
1996-09-19 19:49:13 +00:00
Nate Williams
030e2e9ebb In sys/time.h, struct timespec is defined as:
/*
         * Structure defined by POSIX.4 to be like a timeval.
         */
        struct timespec {
                time_t  ts_sec;         /* seconds */
                long    ts_nsec;        /* and nanoseconds */
        };

        The correct names of the fields are tv_sec and tv_nsec.

Reminded by:	James Drobina <jdrobina@infinet.com>
1996-09-19 18:21:32 +00:00
David Greenman
cd6eea255f Fixed bug with reversed trunc/round_page() in madvise...start must be
trunced, end must be rounded.
1996-09-19 10:12:41 +00:00
David Greenman
f9be9005ce Implemented a better, dynamic, mechanism for adjusting the transmit
threshold.
1996-09-19 09:15:20 +00:00
Poul-Henning Kamp
a6e173ca49 Various de-bogotifications of userconfig. 1996-09-19 08:32:37 +00:00
Poul-Henning Kamp
e8993539b8 Add APM_IDLE_CPU option, that is off by default.
I maintain that it saves more power to simply "hlt" the CPU than to
spend tons of time trying to tell the APM bios to do the same.
In particular if you do it 100 times a second...
1996-09-19 08:28:16 +00:00
Paul Traina
0570e4476a Add a new sysctl variable kern.sominqueue to override the MINIMUM queue
specified in a listen(2) system call.
1996-09-19 00:54:36 +00:00
David Greenman
7af18210c3 Increased transmit threshold to 1024 bytes to fix a problem with underruns
on machines with poor PCI performance.
1996-09-18 16:18:05 +00:00
John Dyson
f9da2540d2 Add needed spl protection, and some minor cleanups in vfs_vmio_release.
Submitted by:	Peter Wemm <peter@spinner.dialix.com> and me.
1996-09-18 15:57:41 +00:00
David Greenman
40e4ce5ab9 Updated driver to a newer version from Matt Thomas, preserving our local
changes. This version should fix a number of bugs such as with auto-
speed sensing and at least one known panic.

Submitted by:	Matt Thomas (matt@3am-software.com)
1996-09-18 14:44:31 +00:00
Steven Wallace
b3618bcf57 .TARGETOBJDIR has been removed from make and CANONICALOBJDIR set in
bsd.obj.mk.  Also, a make target called objwarn checks to see
if ${.OBJDIR} != ${.CURDIR} and ${.OBJDIR} != ${CANONICALOBJDIR}
and outputs a warning.  (No warning for the latter if MAKEOBJDIR or MAKEOBJDIRP
REFIX is set).  objwarn is called from all targets in bsd.prog.mk, bsd.kmod.mk,
and bsd.lib.mk.

Reviewed by:	bde
1996-09-18 06:09:19 +00:00
Peter Wemm
7b8830a51e Argh, I have had one "uid 0 on /: file system full" too many. The problem
is that it doesn't say _what_ did it! (the core dumped console message
is very useful for listing the process name and pid).  This adds similar
information.
1996-09-17 14:38:16 +00:00
Rodney W. Grimes
7ccde0654a Re-enable conf82371fb2 now that I have verified that it works, even if
it only prints 2 bits out of hundreds.  (Minimizing the diff between
-head and 2.1.5.)
1996-09-16 08:56:39 +00:00
Poul-Henning Kamp
1e882d2791 Fix something that has annoyed me since day one of userconfig: when the
<More> prompt receives a 'q', just abandon the list, the user wants out.
1996-09-15 19:35:23 +00:00
Bruce Evans
dd106ca742 Removed iprintf(). It was copied to db_iprintf() in ddb. 1996-09-15 11:24:21 +00:00
Bruce Evans
c7c34a24a3 Attached vm ddb commands show map', show vmochk', `show object',
`show vmopag', `show page' and `show pageq'.  Moved all vm ddb stuff
to the ends of the vm source files.

Changed printf() to db_printf(), `indent' to db_indent, and iprintf()
to db_iprintf() in ddb commands.  Moved db_indent and db_iprintf()
from vm to ddb.

vm_page.c:
Don't use __pure.  Staticized.

db_output.c:
Reduced page width from 80 to 79 to inhibit double spacing for long
lines (there are still some problems if words are printed across
column 79).
1996-09-14 11:54:59 +00:00
Bruce Evans
831031ce00 Attached simple external ddb commands show rtc', show pgrpdump'
and `show cbstat'.  The pgrpdump code was previously controlled by
`#ifdef DEBUG'.
1996-09-14 10:53:48 +00:00
Bruce Evans
6337f4efa8 Support statically attaching of ddb commands in non-ddb modules.
The details are hidden in the DB_COMMAND(cmd_name, func_name) and
DB_SHOW_COMMAND(cmd_name, func_name) macros.  DB_COMMAND() adds to
the top-level ddb command table and DB_SHOW_COMMAND adds to the
`show' subtable.  Most external commands will probably be `show'
commands with no side effects.  They should check their pointer
args more carefully than `show map' :-), or ddb should trap internal
faults better (like it does for memory accesses).

The vm ddb commands are temporarily unattached.

ddb.h:
Also declare `db_indent' and db_iprintf() which will replace vm's
`indent' and iprintf().
1996-09-14 09:13:15 +00:00
Bruce Evans
2e82980a4c Moved instantiation of `poff' to sys.c. It is no longer used in disk.c.
Saved a few bytes by copying `dosdev' and/or `name' to local variables.
This optimization (for dosdev) was done in one place before but this
was lost in the devread() cleanup.   This optimization (for dosdev)
can almost be done by bogusly declaring dosdev as const, but gcc still
often space-pessimizes code like the following:

	extern const int dosdev; ... foo(dosdev); bar(dosdev);

gcc often doesn't bother to copy dosdev to a temporary local because
the local would have to be preserved in memory across the call to
foo().  OTOH, for

	extern int dosdev; ... auto int dosdev_copy = dosdev; ...
		foo(dosdev_copy); bar(dosdev_copy);

the copy must be made because foo() might alter dosdev.
1996-09-14 07:41:00 +00:00
Bruce Evans
310abe0579 Removed declarations of recently deleted variables and cleaned up
#includes.
1996-09-14 07:38:14 +00:00
Bruce Evans
d154cceba7 Potentially saved a whole 4 bytes and reduced bogusness by eliminating
the pointer to the string "/kernel".  This pointer was once only
statically to once save space, but it has had to be dynamically
initialized for some time, so the static initialization just wastes
space.  The string gets moved to the text section, so the actual
savings may be negative due to padding.
1996-09-14 07:12:02 +00:00
John Dyson
8fdfa820e4 Clean up some more problems with freeing busy or wired pages. The
vfs_bio code was not waiting properly for page state until manipulating
it.
1996-09-14 04:40:33 +00:00
Bruce Evans
a7f8f2ab55 Changed cncheckc() interface so that it is 8-bit clean - return -1
instead of 0 if there is no input.
1996-09-14 04:31:09 +00:00
Bruce Evans
4fab2f9bc7 Changed cncheckc() interface so that it is 8-bit clean - return -1
instead of 0 if there is no input.

pcvt_drv.c:
Partially fixed pccncheckc().  It returned a boolean value instead of
the character that it fetches from the input fifo (if any).  I think
it still discards characters after the first for multi-char input.
1996-09-14 04:30:32 +00:00
Bruce Evans
daed6ffd24 Changed cncheckc() interface so that it is 8-bit clean - return -1
instead of 0 if there is no input.

syscons.c:
Added missing spl locking in sccncheckc().  Return the same value as
sccngetc() would.  It is wrong for sccngetc() to return non-ASCII, but
stripping the non-ASCII bits doesn't help.
1996-09-14 04:27:46 +00:00
Bruce Evans
40b55a34ae Changed cncheckc() interface so that it is 8-bit clean - return -1
instead of 0 if there is no input.
1996-09-14 04:25:32 +00:00
Bruce Evans
8b3fb3e16d Removed another devconf leftover. A fat devconf support function was
still being used just to support printing of the device name in the
probe.  Restored the method used in rev.1.6 and changed it to print
the same strings as the previous revision.

Reviewed by:	Paul Richards
1996-09-14 01:26:16 +00:00
Bruce Evans
d966b8d1c4 Fixed Id. 1996-09-14 01:04:18 +00:00
Paul Traina
561c2ad31c Move TCPCTL_KEEPINIT to end of MIB list (sigh) 1996-09-13 23:54:03 +00:00
Paul Traina
7b40aa327d Make the misnamed tcp initial keepalive timer value (which is really the
time, in seconds, that state for non-established TCP sessions stays about)
a sysctl modifyable variable.

[part 1 of two commits, I just realized I can't play with the indices as
 I was typing this commit message.]
1996-09-13 23:51:44 +00:00
Paul Traina
7ff19458de Receipt of two SYN's are sufficient to set the t_timer[TCPT_KEEP]
to "keepidle".  this should not occur unless the connection has
been established via the 3-way handshake which requires an ACK

Submitted by:	jmb
Obtained from:	problem discussed in Stevens vol. 3
1996-09-13 18:47:03 +00:00
Bruce Evans
fc0b1dbf68 Don't use __dead in the kernel. It was an obfuscation for gcc >= 2.5
and a no-op for gcc >= 2.6.
1996-09-13 09:20:15 +00:00
Bruce Evans
c254b6e8db Made debugging code (pmap_pvdump()) compile again so that I can test LINT.
I don't know if it actually works.
1996-09-13 07:10:00 +00:00
Bruce Evans
fddbd6ddb8 Removed another devconf leftover.
Fixed a new #include style bug.
Removed an unused #include.
1996-09-13 06:48:21 +00:00
Bruce Evans
5a175c1c5d Don't compile a 256-byte unused table in the pca driver.
The other 256-byte table in ulaw.h still gets duplicated if both
pca and snd are configured.
1996-09-13 06:29:30 +00:00