Commit Graph

260 Commits

Author SHA1 Message Date
David Greenman
d079690c14 Made bzero a function vector and added a 586/686 optimized version of
bzero.
Deprecated blkclr (removed it).
Removed some old cruft from cpufunc.h.

The optimized bzero was submitted by Torbjorn Granlund <tege@matematik.su.se>
The kernel adaption and other changes by me.
1995-12-28 23:34:30 +00:00
Mark Murray
6a9bf141bd Clean up and make more universal. Next version of random device. 1995-12-27 11:19:41 +00:00
Bruce Evans
c6bbb6d152 Fixed staticizing. Some functions aren't static but depend on
the undocumented previously unLINTed option `APM_SLOWSTART'.
1995-12-25 07:38:47 +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
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
Bruce Evans
927c0b1131 Cleaned up prototypes in pmap headers: removed ones for nonexistent
functions; moved misplaced ones; restored most of KNFish formatting
from 4.4lite version; removed bogus __BEGIN/END_DECLS.
1995-12-17 07:39:05 +00:00
Poul-Henning Kamp
5e46340891 Make math_emulators LKMable. 1995-12-14 08:21:33 +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
Poul-Henning Kamp
6f4e0beb7e Staticize and cleanup. 1995-12-10 13:40:44 +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
Bruce Evans
ef6f4fab97 Moved some prototypes to a better place.
Removed stale prototypes.

Added prototypes.

Added empty lines.
1995-12-05 20:10:41 +00:00
Bruce Evans
d71f232008 __purified pmap_pte(). This seems to make no difference. 1995-12-03 18:37:44 +00:00
Bruce Evans
1630f073cf Moved inline functions for insque() and remque() to <sys/queue.h>.
Protected them with `#ifdef KERNEL' so that <sys/queue.h> is valid C++.
Added the necessary #includes of <sys/queue.h>.

These functions are bogus and should be replaced by the queue macros.
1995-12-03 13:45:34 +00:00
Bruce Evans
b667af1da9 Removed unused thread support (partly to get rid of its incomplete
function declarations).

Removed unused #includes (lots of vm ones).
1995-12-03 10:40:16 +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
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
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
Bruce Evans
512fef80a9 Completed function declarations and/or added prototypes. 1995-11-21 12:55:26 +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
708a8f9633 Removed:
#include <i386/isa/isa_device.h>
 #include <i386/eisa/eisaconf.h>
 #include <pci/pcireg.h>
 #include <pci/pcivar.h>
 #include <scsi/scsi_all.h>
 #include <scsi/scsiconf.h>
they are not needed, and slows down compilation.
1995-11-14 20:52:14 +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
Justin T. Gibbs
869ed2435b Modifications for the new eisaconf. 1995-11-05 04:43:22 +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
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
Bruce Evans
7788eaeb2f Mask netisrs during softtty isrs. This may fix PR 798. SLIP and PPP
line discipline interrupt handlers more or less expect to be called at
spltty() == splimp(), although they have internal splimp()s that are
bogus if this expectation is satisfied.  They are called at splsoftty()
from many tty drivers, so they were not protected from being reentered
from their own netisrs.  They certainly don't expect that but are
apparently remarkably robust if it occurs.  The problem in PR 798 seems
to be caused by pppstart() being reentered and finishing off the output
in progress by following the (stale) sc->sc_outm pointer.  Then the
original pppstart() finds garbage in m2 after MFREE(m, m2).  slstart()
doesn't have internal state like sc_outm so reentry of it probably only
causes out of order and dropped packets.
1995-10-30 17:01:37 +00:00
Mark Murray
1bb2d3142b Theodore Ts'po's random number gernerator for Linux, ported by me.
This code will only be included in your kernel if you have
'options DEVRANDOM', but that will fall away in a couple of days.
Obtained from: Theodore Ts'o, Linux
1995-10-28 16:58:05 +00:00
Garrett Wollman
e2d4b1f051 Reduce jitter of Pentium microtime() implementation by letting the counter
free-run and doing a subtract in microtime() rather than resetting the
counter to zero at every clock tick.  In combination with the changes to
kern_clock.c, this should eliminate all the immediately obvious sources
of systematic jitter in timekeeping on Pentium machines.
1995-10-12 20:39:49 +00:00
Poul-Henning Kamp
92a69bc337 remove GCC divsi3 routines which are never used. 1995-10-05 10:32:47 +00:00
Jordan K. Hubbard
9e8433e6e0 This upgrades the driver for Cronyx-Sigma multiplexor boards
from version 1.2 to version 1.9.
Submitted by:	Serge Vakulenko, <vak@cronyx.ru>
1995-10-04 22:24:16 +00:00
Bruce Evans
2e69f359d1 Fix benign type mismatches in isa interrupt handlers. Many returned int
instead of void.
1995-09-19 18:55:37 +00:00
Peter Wemm
fbb8b7bb60 Move some kernel-only stuff to a kernel-only file.
Submitted by:	bde
1995-09-13 08:39:28 +00:00
Julian Elischer
c1ab55a72e Submitted by: Luigi Rizzo
Obtained from: Luigi and gunther
yeah I forgot this one....
1995-09-08 03:22:00 +00:00
Julian Elischer
8af5d536ff devfs changes..
changes to allow devices that don't probe (e.g. /dev/mem)
to create devfs entries
this required giving 'configure' its own SYSINIT entry
so we could duck in just before it with a DEVFS init
and some device inits..
my devfs now looks like:
./misc
./misc/speaker
./misc/mem
./misc/kmem
./misc/null
./misc/zero
./misc/io
./misc/console
./misc/pcaudio
./misc/pcaudioctl
./disks
./disks/rfloppy
./disks/rfloppy/fd0.1440
./disks/rfloppy/fd1.1200
./disks/floppy
./disks/floppy/fd0.1440
./disks/floppy/fd1.1200
also some sligt cleanups.. DEVFS needs a lot of work
but I'm getting back to it..
1995-09-03 05:43:50 +00:00
Jordan K. Hubbard
49148d6390 Jim's latest fixes.
Submitted by:	james
1995-09-01 00:25:18 +00:00
Jordan K. Hubbard
1d86961e14 Kernel components of Matrox Meteor driver.
Submitted by:	Mark Tinguely <tinguely@plains.nodak.edu> and Jim Lowe <james>
1995-08-28 17:03:18 +00:00
Bruce Evans
512644a44d Don't declare a nonexistent function.
Fix formatting of recent changes.
1995-08-26 20:46:43 +00:00
Bruce Evans
fadc51bdc6 Remove "memory" clobber statement from enable_intr(). Enabling interrupts
doesn't invalidate loaded variables.

Fix formatting of recent changes.
1995-08-26 20:45:59 +00:00
Peter Wemm
d3497bc8de add a new Debug mode.. "DBG_OPTIM" - for observing the L_RINT bypass 1995-08-22 00:42:07 +00:00
David Greenman
d0d1c65888 Killed some unused stuff inherited from Bill Jolitz. Note that since
this changes the size of the pcb struct, gdb will need to be rebuilt
or debugging won't work correctly.

Reviewed by:	Bruce Evans
1995-08-17 11:30:03 +00:00
Peter Wemm
bb65956af3 Next round of cleanups. Some more debugging hooks added, si_softc definition
moved to the driver proper, so that <machine/si.h> can be #included by user
programs without needing to include stuff from /sys/i386/isa..
Various (now) redundant features removed, eg: the locks on IXANY and HWFLOW
as these are now done with the "initial" and "lock" termios devices.
Note that it still (for reasons unknown) appears to be masking data to
7-bit with ppp - hence the cleanup to support the debugging via 'sicontrol'
1995-08-13 15:18:05 +00:00
Peter Wemm
b77990be3e Bring in my long-overdue version of the Specialix driver.
This was originally ported to BSDI by Andy Rutter <andy@acronym.co.uk>.
At the end of the day, this code has very little in common with Andy's
version, or the Specialix SYSV version.  Essentially it has been gradually
and almost completely rewritten, with LOTS of advice and inspiration from
Bruce Evans.  There are a couple of missing bits still, but they are minor.

The user-mode "sicontrol" program is in sad shape and will come in soon.
Transparent printing died a timely death.. Maybe later..

Jeremy Rolls @ Specialix (Development directory) has confirmed this is OK
to distribute, and Andy personally sent me his version that I started from.

Although this driver stood up to a nasty stress-test in this form, I am not
confident that there are no nasty bugs lurking.

People are welcome to try it, but dont go out and buy one just yet.. :-)
And *DONT* use it on a mission-critical machine... This is ALPHA QUALITY!
1995-08-09 13:13:47 +00:00
John Dyson
a4353b3b5e Fixed my usage of "asm" instead of "__asm" and "volatile" instead
of "__volatile".  Note also that the original mods that were submitted
by me were as a result of a discussion between various FreeBSD contributors.

Submitted by:	peter@haywire.dialix.com (Peter Wemm)
1995-08-09 02:39:32 +00:00
John Dyson
8966b85c8f Make the spl oriented inline functions less likely to allow
potentially volatile memory to be kept in registers during
the "call" (inline expansion.)  Do the same for pmap_update.
1995-08-08 04:50:52 +00:00
Jordan K. Hubbard
8bdcfa2a8b Merge in changes for VOXWARE 3.05
Submitted by:	Amancio Hasty and Jim Lowe
1995-07-28 22:30:53 +00:00
Bruce Evans
8089a0432e Fix bogus constraint "i" that only worked with -O. The cases where it
didn't work are somewhat bogusly optimized away before the constraint
is checked.  We still expect constants passed to inline functions to
remain constant, but if the compiler ever decides that they aren't
constant then it will just generate slightly slower code instead of
an error.
1995-07-25 21:28:47 +00:00
David Greenman
e9857eee2b Rewrote memory sizing code to generally deal with holes in extended memory.
This code change should allow certain Compaq machines with a 128K hole
at 16MB to work.
1995-07-19 06:37:12 +00:00
Poul-Henning Kamp
7a2dada545 Make the bootinfo structure visible from sysctl.
This can be used in libdisk to guess a better bios-geometry.
1995-07-16 10:33:38 +00:00
David Greenman
24a1cce34f NOTE: libkvm, w, ps, 'top', and any other utility which depends on struct
proc or any VM system structure will have to be rebuilt!!!

Much needed overhaul of the VM system. Included in this first round of
changes:

1) Improved pager interfaces: init, alloc, dealloc, getpages, putpages,
   haspage, and sync operations are supported. The haspage interface now
   provides information about clusterability. All pager routines now take
   struct vm_object's instead of "pagers".

2) Improved data structures. In the previous paradigm, there is constant
   confusion caused by pagers being both a data structure ("allocate a
   pager") and a collection of routines. The idea of a pager structure has
   escentially been eliminated. Objects now have types, and this type is
   used to index the appropriate pager. In most cases, items in the pager
   structure were duplicated in the object data structure and thus were
   unnecessary. In the few cases that remained, a un_pager structure union
   was created in the object to contain these items.

3) Because of the cleanup of #1 & #2, a lot of unnecessary layering can now
   be removed. For instance, vm_object_enter(), vm_object_lookup(),
   vm_object_remove(), and the associated object hash list were some of the
   things that were removed.

4) simple_lock's removed. Discussion with several people reveals that the
   SMP locking primitives used in the VM system aren't likely the mechanism
   that we'll be adopting. Even if it were, the locking that was in the code
   was very inadequate and would have to be mostly re-done anyway. The
   locking in a uni-processor kernel was a no-op but went a long way toward
   making the code difficult to read and debug.

5) Places that attempted to kludge-up the fact that we don't have kernel
   thread support have been fixed to reflect the reality that we are really
   dealing with processes, not threads. The VM system didn't have complete
   thread support, so the comments and mis-named routines were just wrong.
   We now use tsleep and wakeup directly in the lock routines, for instance.

6) Where appropriate, the pagers have been improved, especially in the
   pager_alloc routines. Most of the pager_allocs have been rewritten and
   are now faster and easier to maintain.

7) The pagedaemon pageout clustering algorithm has been rewritten and
   now tries harder to output an even number of pages before and after
   the requested page. This is sort of the reverse of the ideal pagein
   algorithm and should provide better overall performance.

8) Unnecessary (incorrect) casts to caddr_t in calls to tsleep & wakeup
   have been removed. Some other unnecessary casts have also been removed.

9) Some almost useless debugging code removed.

10) Terminology of shadow objects vs. backing objects straightened out.
    The fact that the vm_object data structure escentially had this
    backwards really confused things. The use of "shadow" and "backing
    object" throughout the code is now internally consistent and correct
    in the Mach terminology.

11) Several minor bug fixes, including one in the vm daemon that caused
    0 RSS objects to not get purged as intended.

12) A "default pager" has now been created which cleans up the transition
    of objects to the "swap" type. The previous checks throughout the code
    for swp->pg_data != NULL were really ugly. This change also provides
    the rudiments for future backing of "anonymous" memory by something
    other than the swap pager (via the vnode pager, for example), and it
    allows the decision about which of these pagers to use to be made
    dynamically (although will need some additional decision code to do
    this, of course).

13) (dyson) MAP_COPY has been deprecated and the corresponding "copy
    object" code has been removed. MAP_COPY was undocumented and non-
    standard. It was furthermore broken in several ways which caused its
    behavior to degrade to MAP_PRIVATE. Binaries that use MAP_COPY will
    continue to work correctly, but via the slightly different semantics
    of MAP_PRIVATE.

14) (dyson) Sharing maps have been removed. It's marginal usefulness in a
    threads design can be worked around in other ways. Both #12 and #13
    were done to simplify the code and improve readability and maintain-
    ability. (As were most all of these changes)

TODO:

1) Rewrite most of the vnode pager to use VOP_GETPAGES/PUTPAGES. Doing
   this will reduce the vnode pager to a mere fraction of its current size.

2) Rewrite vm_fault and the swap/vnode pagers to use the clustering
   information provided by the new haspage pager interface. This will
   substantially reduce the overhead by eliminating a large number of
   VOP_BMAP() calls. The VOP_BMAP() filesystem interface should be
   improved to provide both a "behind" and "ahead" indication of
   contiguousness.

3) Implement the extended features of pager_haspage in swap_pager_haspage().
   It currently just says 0 pages ahead/behind.

4) Re-implement the swap device (swstrategy) in a more elegant way, perhaps
   via a much more general mechanism that could also be used for disk
   striping of regular filesystems.

5) Do something to improve the architecture of vm_object_collapse(). The
   fact that it makes calls into the swap pager and knows too much about
   how the swap pager operates really bothers me. It also doesn't allow
   for collapsing of non-swap pager objects ("unnamed" objects backed by
   other pagers).
1995-07-13 08:48:48 +00:00
Bruce Evans
943c18018b Fix standards conformance bugs in <signal.h>:
include/signal.h:
There was massive namespace pollution from including <sys/types.h>.
POSIX functions were declared even when _ANSI_SOURCE is defined.

sys.sys/signal.h:
NSIG was declared even if _ANSI_SOURCE or _POSIX_SOURCE is defined.
sig_atomic_t wasn't declared if _POSIX_SOURCE is defined.
Declare a typedef for signal handling functions and use it to
unobfuscate declarations and to avoid half-baked function types
that cause unwanted compiler warnings at certain warning levels.
Fix confusing comment about SA_RESTART.

sys/i386/include/signal.h:
This has to be included to get the declaration of sig_atomic_t even
when _ANSI_SOURCE is defined, so be more careful about polluting
the ANSI namespace.

Uniformize idempotency ifdefs.
1995-06-28 02:14:13 +00:00
Bruce Evans
e9c2b07f51 Define macros _BSD_OFF_T_ and _BSD_PID_T_ suitable for use instead
of the typedefs off_t and pid_t when use of the latter would cause
namespace pollution.  These macros are used like _BSD_VA_LIST_ and
aren't #undef'ed when the corresponding typedef is declared.
off_t is very machine-dependent and should never have been decided
in <sys/types.h> (its declaration is compiler-dependent).  pid_t
isn't very machine-dependent, but this might change.  `long' is
a wasteful type for it if longs are longer than ints.

Move the definition of _BSD_VA_LIST_ away from the comment that
suggests that it is #undefed when va_list is declared.
1995-06-28 01:39:26 +00:00