Commit Graph

259 Commits

Author SHA1 Message Date
David Greenman 5c06a7a368 Initialize eflags register - brought over from 1.1.5. 1994-09-04 00:33:00 +00:00
Andreas Schulz 3d76654d68 Reviewed by:
Submitted by:
1) if_ie.c:
	Changed a printf and put a space in it. Formerly the "<3C507>"
	confused the syslog. He tried to see that as the priority to
	log that message.

2) isa_device.h:
	Changed the iobase variable from short to u_short. EISA
	Adresses can go up to 0xf000 and the sign extension doesn't
	look good in the probe output. Example:
	ep1 at 0xffff8000-0xffff8000f is not good :-), i like more a
	ep1 at 0x8000-0x8000f.

3) isa.c:
	Changed a string constant from "probe" to "prob", it gets
	later already an "ed" tagged on the end.
1994-09-02 22:13:34 +00:00
David Greenman 35aee0800d Converted P_LINK -> P_FORW, P_RLINK -> P_BACK, minor optimization. 1994-09-02 05:58:51 +00:00
David Greenman 2c7a40c7ca Removed all vestiges of tlbflush(). Replaced them with calls to pmap_update().
Made pmap_update an inline assembly function.
1994-09-02 04:12:26 +00:00
David Greenman 9ee9202471 It's not necessary to make page tables write-through, so get rid of this
(this was an experimental change which probably shouldn't have been
committed). I/O pages are still marked non-cacheable, however.
1994-09-02 01:29:20 +00:00
David Greenman e8fb0b2c17 Realtime priority scheduling support.
Submitted by:	Henrik Vestergaard Draboel
1994-09-01 05:12:53 +00:00
David Greenman 431be400a7 Got rid of some old, unused junk. 1994-09-01 03:16:40 +00:00
Stefan Eßer 2b9fc9390f Reviewed by: Stefan Esser <se>
Submitted by:	Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
Added PCI support (call of pci_config(), if NPCI > 0).
1994-08-31 23:36:56 +00:00
David Greenman ac47fce534 Fixed bug that surfaced with last commit for NOBOUNCE -> BOUNCE_BUFFERS by
adding appropriate #ifdefs and changing some variables to externs (as they
should have always been).
1994-08-31 15:55:29 +00:00
David Greenman 9aba88bf29 Rather than exclude bounce buffers support with NOBOUNCE, include it
with BOUNCE_BUFFERS. This is more intuitive, and is better for future
multiplatform support. Added BOUNCE_BUFFERS option to the GENERIC and
LINT kernel config files.
1994-08-31 06:17:49 +00:00
Bruce Evans 8fdce837c3 Don't define LOCORE (as nothing) in sources. It is now defined
consistently (as 1) in Makefile.i386 for all assembler sources.
1994-08-30 17:19:10 +00:00
Andrey A. Chernov 0e91a83462 Fake floppy partition RAW_PART=2 now 1994-08-29 21:47:11 +00:00
Bruce Evans 406d45e059 Don't test if a u_int is < 0. The remaining test is sufficient and the
extra one caused a warning.
1994-08-28 16:16:33 +00:00
David Greenman 8a129caed5 1) Changed ddb into a option rather than a pseudo-device (use options DDB
in your kernel config now).
2) Added ps ddb function from 1.1.5. Cleaned it up a bit and moved into its
   own file.
3) Added \r handing in db_printf.
4) Added missing memory usage stats to statclock().
5) Added dummy function to pseudo_set so it will be emitted if there
   are no other pseudo declarations.
1994-08-27 16:14:39 +00:00
Søren Schmidt f3f0ca6051 Changes preparing for iBCS support
Reviewed by:
Submitted by:
1994-08-24 11:52:21 +00:00
Søren Schmidt 25ae122558 Changes preparing for iBCS2 support
Reviewed by:
Submitted by:
1994-08-24 11:45:19 +00:00
David Greenman 329b62ac1c Corrected some comments regarding ptes/pdes. 1994-08-23 16:27:15 +00:00
Paul Richards d184e84f7e Re-enabled inlining of inb.
Changed u_int_inb to just inb and deleted define.

The code generated is identical to that generated with the cast so
the problem was obviously fixed at some point after gcc 1.4

Reviewed by:
Submitted by:
1994-08-23 13:41:37 +00:00
Paul Richards bffa0592e2 I've disabled this piece of code since it's what's
hosing syscons. Doesn anyone know anything about this
or can we just delete it now?

/*
 * This roundabout method of returning a u_char helps stop gcc-1.40 from
 * generating unnecessary movzbl's.
 */
#ifdef disable_for_gcc-2_6_0
#define inb(port)       ((u_char) u_int_inb(port))
#endif

static inline u_int
u_int_inb(u_int port)
{
        u_char  data;
        /*
         * We use %%dx and not %1 here because i/o is done at %dx and
not at
         * %edx, while gcc-2.2.2 generates inferior code (movw instead
of movl)
         * if we tell it to load (u_short) port.
         */
        __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port));
        return data;
}

Reviewed by:
Submitted by:
1994-08-23 11:57:19 +00:00
Bruce Evans 1353e8ff44 Pad `_cpu_vendor' to finish on a 32-bit boundary so that most of the
locore globals aren't misaligned.
1994-08-22 14:28:57 +00:00
Paul Richards 836dc83b6a Made idempotent.
Reviewed by:
Submitted by:
1994-08-21 04:55:31 +00:00
David Greenman e0e9c42112 Implemented filesystem clean bit via:
machdep.c:
	Changed printf's a little and call vfs_unmountall() if the sync was
	successful.

cd9660_vfsops.c, ffs_vfsops.c, nfs_vfsops.c, lfs_vfsops.c:
	Allow dismount of root FS. It is now disallowed at a higher level.

vfs_conf.c:
	Removed unused rootfs global.

vfs_subr.c:
	Added new routines vfs_unmountall and vfs_unmountroot. Filesystems
	are now dismounted if the machine is properly rebooted.

ffs_vfsops.c:
	Toggle clean bit at the appropriate places. Print warning if an
	unclean FS is mounted.

ffs_vfsops.c, lfs_vfsops.c:
	Fix bug in selecting proper flags for VOP_CLOSE().

vfs_syscalls.c:
	Disallow dismounting root FS via umount syscall.
1994-08-20 16:03:26 +00:00
David Greenman 27774cbbf4 Removed bogus save of CMAP2. 1994-08-19 22:49:42 +00:00
David Greenman 3edb235c09 Terry Lambert's loadable kernel module support w/improvements from the
NetBSD group.
1994-08-19 11:45:29 +00:00
Jordan K. Hubbard 6605d9f3db 1. Make this idempotent.
2. Hack.

	Hack is to define RCSID() to null macro so that new msun stuff
	will compile.  This does NOT belong here, and I DON'T want it to
	stay, I just need to put this here for now to enable msun and we need
	to talk about what our RCSID story is supposed to be.  We talked about
	supporting RCSID() one day, and everyone seemed to like the idea
	reasonably well of making it a macro you could just no-op this way,
	but we never did anything.  Now I see that JTCs code has it and I'm
	loath to remove it or do anything until we've discussed it some more.

	Well, so how about it?  What's our story vis-a-vis RCSID() going to
	be?

Submitted by:	jkh
1994-08-19 11:20:11 +00:00
Garrett Wollman f23b4c91c4 Fix up some sloppy coding practices:
- Delete redundant declarations.
- Add -Wredundant-declarations to Makefile.i386 so they don't come back.
- Delete sloppy COMMON-style declarations of uninitialized data in
  header files.
- Add a few prototypes.
- Clean up warnings resulting from the above.

NB: ioconf.c will still generate a redundant-declaration warning, which
is unavoidable unless somebody volunteers to make `config' smarter.
1994-08-18 22:36:09 +00:00
David Greenman 8912c0ed61 Bruce Evans' dynamic interrupt support.
/usr/src/sys/i386/isa/clock.c:
	o Garrett's statclock changes.
	o Wire xxxintr, not Vclk.
	o Wire using register_intr(), not setidt().

/usr/src/sys/i386/isa/icu.s:
	o Garrett's statclock changes.
	o Removed unused variable high_imask.
	o Fake int 8 for rtc as well as int 0 for clk.  Required for kernel
	  profiling with statclock, harmless otherwise.

/usr/src/sys/i386/isa/isa.c:
	o Allow isdp->id_irq and other things in *isdp to be changed by
	  probes.  Changing interrupts later requires direct calls to
	  register_intr() and unregister_intr() and more care.
	  ALLOW_CONFLICT_* is brought over from 1.1.5, except
	  ALLOW_CONFLICT_IRQ is not supported.  IRQ conflict checking is
	  delayed until after probing so that drivers can change the IRQ
	  to a free one; real conflicts require more cooperation between
	  drivers to handle.
	o Too many details to list.
	o This file requires splitting and a lot more work.

/usr/src/sys/i386/isa/isa_device.h:
	o Declare more things more completely.

/usr/src/sys/i386/isa/sio.c:
	o Prepare to register interrupt handlers as fast.

/usr/src/sys/i386/isa/vector.s:
	o Generate entry code for 16 fast interrupt handlers and 16 normal
	  interrupt handlers.  Changed some constants to variables:
	  # $unit is now intr_unit[intr].  Type is int.  Someday it should
	    be a cookie suitable for the handler (e.g., a struct com_s for
	    sio).
	  # $handler is now intr_handler[intr].
	  # intrcnt_actv[id_num] is now *intr_countp[intr].  The indirection
	    is required to get a contiguous range of counters for vmstat
	    and so that the drivers depend more in the driver than on the
	    interrupt number (drivers could take turns using an interrupt
	    and the counts would remain correct).  There is a separate
	    counter for each device and for each stray interrupt.  In
	    1.1.5, stray interrupt 7 clobbers the count for device 7 or
	    something worse if there is no device 7 :-(.
	  # mask is now intr_mask[intr] (was already indirect).
	 o Entry points are now _XintrI and _XfastintrI (I = intr = 0-15),
	   not _VdevU (U = unit).
	 o Removed BUILD_VECTORS stuff.  There's a trace of it left for
	   the string table for vmstat but config now generates the
	   string in one piece because nothing more is required.
	 o Removed old handling of stray interrupts and older comments
	   about it.

Submitted by:	 Bruce Evans
1994-08-18 05:09:36 +00:00
Garrett Wollman 8ea838500f Enable use of the RTC chip for the statistical clock. While this does
not provide the full accuracy of a randomized statistical clock, it does
provide greater accuracy than the previous method, while not significantly
increasing overhead.  It also provides profiling support at 1024 Hz.

You must re-compile config before making a new kernel, or you will end
up with unresolved symbols.

Reviewed uy:	Bruce evans said it worked for him.
1994-08-15 03:15:20 +00:00
Andreas Schulz 021d975d03 Submitted by: Bruce Evans
Delete the ifdef GPL_EMULATE case here and made the padding work for
both types of emulators so that there is no longer a need to compile
ps and friends new if you are using the GPL math emulator instead the
normal one.
1994-08-14 23:32:45 +00:00
David Greenman 0e42760866 Made the kernel compile cleanly with gcc 2.6.0. Thanks go to Bruce
Evans for suggesting a method to detect various versions of gcc.
1994-08-13 14:21:58 +00:00
Garrett Wollman f540b1065a Change all #includes to follow the current Berkeley style. Some of these
``changes'' are actually not changes at all, but CVS sometimes has trouble
telling the difference.

This also includes support for second-directory compiles.  This is not
quite complete yet, as `config' doesn't yet do the right thing.  You can
still make it work trivially, however, by doing the following:

rm /sys/compile
mkdir /usr/obj/sys/compile
ln -s M-. /sys/compile
cd /sys/i386/conf
config MYKERNEL
cd ../../compile/MYKERNEL
ln -s /sys @
rm machine
ln -s @/i386/include machine
make depend
make
1994-08-13 03:50:34 +00:00
Jordan K. Hubbard f9f0c18d31 Change outb() as per Bruce's instructions so that it doesn't explicitly
try to pass its argument in the ax register.
Reviewed by:
Submitted by:
1994-08-11 02:26:08 +00:00
Garrett Wollman fba73571bd For Pentium machines, use a faster version of microtime with 8 usec
resolution (can probably be improved somewhat).  Other machines take
a three-instruction hit if I586_CPU is defined, none otherwise.
1994-08-11 00:28:24 +00:00
Garrett Wollman a4f90f4d45 Tell Pentium users their CPU speed. (More changes to make use of this
to come later.)
1994-08-10 23:28:33 +00:00
Garrett Wollman 5c8b38d41d Handle NMI's in accordance with data in van Gilluwe book. 1994-08-10 04:39:52 +00:00
Garrett Wollman 2e0cc1821d Some programs (like GNU configure programs) depend on the output of
`uname -s' to be something reasonable (traditionally, `i386') rather
than `PC-Class'.  Make it so.
1994-08-10 03:53:33 +00:00
Garrett Wollman 29c0a86011 Add back in CPU detection copde from 1.1.5. As an added bonus, the
hw.model MIB variable is now declared correctly.
1994-08-10 03:51:18 +00:00
Jordan K. Hubbard 52cd438439 Merge in the necessary bits from 1.1.5.1 to make exec.h and reloc.h
happy campers again (e.g. match our own exec format).  This should
make ld happy.
Submitted by:	jkh
1994-08-09 14:39:57 +00:00
David Greenman 95b671fc95 Removed ntohl and ntohs functions. These were already inlined assembly in
endian.h.
1994-08-09 11:21:44 +00:00
David Greenman 8339815ff9 Made pmap_kenter "TLB safe". ...and then removed all the pmap_updates that
are no longer needed because of this.
1994-08-07 14:53:27 +00:00
David Greenman a481f20029 Provide support for upcoming merged VM/buffer cache, and fixed a few bugs
that haven't appeared to manifest themselves (yet).

Submitted by:	John Dyson
1994-08-07 13:10:43 +00:00
David Greenman c564966bf0 Don't kremove process VM pages (oops!). This was the cause of the instability
that was introduced last night.

Submitted by:	 John Dyson
1994-08-07 03:31:52 +00:00
David Greenman c87801fe54 Fixed various prototype problems with the pmap functions and the subsequent
problems that fixing them caused.
1994-08-06 10:25:50 +00:00
David Greenman ae92ea446f Incorporated 1.1.5 improvements to the bounce buffer code (i.e. make it
actually work), and additionally improved it's performance via new pmap
routines and "pbuf" allocation policy.

Submitted by:	John Dyson
1994-08-06 09:20:56 +00:00
David Greenman ed3f895438 Made the tmpstk start at tmpstk. Not doing so causes problems for the
debugger.

Submitted by:	John Dyson
1994-08-06 09:17:44 +00:00
David Greenman 16f62314cd Incorporated post 1.1.5 work from John Dyson. This includes performance
improvements via the new routines pmap_qenter/pmap_qremove and pmap_kenter/
pmap_kremove. These routine allow fast mapping of pages for those
architectures that have "normal" MMUs. Also included is a fix to the
pageout daemon to properly check a queue end condition.

Submitted by:	John Dyson
1994-08-06 09:15:42 +00:00
Garrett Wollman f5c789f5a9 Delete redundant #ifdef __i386__, be consistent about idempotency
protection.

Submitted by:	Bruce Evans
1994-08-05 14:36:04 +00:00
David Greenman 86cadec5dc Added assembly versions of ffs() and bcmp(). 1994-08-04 19:51:01 +00:00
David Greenman ee06dc6013 Inlined insque and remque. 1994-08-04 19:46:57 +00:00
Garrett Wollman 50f44fa07d Move ieeefp.h over, and put it in the correct subdirectory this time.
Submitted by:	Andrew Moore
1994-08-04 19:16:37 +00:00
David Greenman 15e1ca20e4 Nuked #if 0'd _insque and _remque routines - they are now inlined in
cpufunc.h.
1994-08-04 06:10:27 +00:00
David Greenman d23d07ef95 Merged in post-1.1.5 work done by myself and John Dyson. This includes:
me:
1) TLB flush optimization that effectively eliminates half of all of the
   TLB flushes. This works by only flushing the TLB when a page is "present"
   in memory (i.e. the valid bit is set in the page table entry). See section
   5.3.5 of the Intel 386 Programmer's Reference Manual.
2) The handling of "CMAP" has been improved to catch attempts at multiple
   simultaneous use.

John:
1) Added pmap_qenter/pmap_qremove functions for fast mapping of pages into
   the kernel. This is for future optimizations and support for the upcoming
   merged VM/buffer cache.

Reviewed by:	John Dyson
1994-08-03 02:45:30 +00:00
David Greenman 3c4dd3568f Added $Id$ 1994-08-02 07:55:43 +00:00
David Greenman 03e6c2532f Removed all code related to the pagescan daemon, and changed 'act_count'
adjustments to compensate for a world without the pagescan daemon.
1994-08-01 11:25:45 +00:00
David Greenman 600f527fc6 Fix from Bruce Evans:
Set npx_exists = 0 in the case of broken error reporting.
1994-06-11 05:17:15 +00:00
David Greenman 8c481329f7 Fixed minor spelling error. 1994-06-11 05:13:33 +00:00
David Greenman e2a2a04ad3 Bruce found a bug in my changes to stop using the gs selector.
From Bruce Evans:

fu[i]byte() checked the wrong register.  This caused interesting behaviour
in the GPL math emulator.  The emulator does not check the values returned
by fu*() or su*() (:-() and it interpreted the address of -12(%ebp) as
-1(%ebp).  The same probably occurs for all signed 8-bit offsets from
registers.

I cleaned up the new bzero() a bit.
1994-06-11 05:12:15 +00:00
David Greenman 667f0edb2b Added some missing cld's (OOPS!) and changed the position of some of
the others to make them easier to spot.
1994-06-06 15:08:51 +00:00
David Greenman 3c256f5395 trap.c:
Vastly improved trap.c from me. This rewritten version has a variety of
features, amoung them: higher performance and much higher code quality.

support.s, cpufunc.h:
No longer use gs override to enforce range limits - compare directly
against VM_MAXUSER_ADDRESS instead. The old way caused problems in
preserving the gs selector...and this method is just as fast or faster.
1994-06-06 14:54:41 +00:00
David Greenman 2e4fabc7c7 Back out previous change for the moment - I need to commit some other
changes first.
1994-06-06 14:23:49 +00:00
David Greenman baa2452312 Added some missing cld's (OOPS!) and changed the position of some of
the others to make them easier to spot.
1994-06-06 14:12:50 +00:00
David Greenman 8b7da9b52b Removed extra (bogus) declaration of Xrsvd14 that was confusing me. 1994-06-04 11:01:15 +00:00
Rodney W. Grimes 26f9a76710 The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.
Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman
1994-05-25 09:21:21 +00:00
Rodney W. Grimes 6cda32c071 BSD 4.4 Lite Kernel Sources 1994-05-25 01:34:38 +00:00
Andreas Schulz 61f969e858 Add two routines insl and outsl, that should do 32bit string ins and outs.
Both are completely untested in the moment. They are used from the
if_ep.c driver for the EISA card.
1994-05-03 00:00:53 +00:00
Søren Schmidt bc36c8064b Update the reprogram timer stuff, now the frequency of timer 0
can only be changed at the "right" times. Accuracy should be
assured.
1994-05-02 09:41:24 +00:00
David Greenman bb50891974 Removed some tlbflush optimizations as some of them were bogus and lead
to some strange behavior.
1994-05-02 05:31:03 +00:00
Gary Clark II 1099e6c189 Deleted on ifdef dontdef
Added ifdef for GPL_MATH_EMULATE so we get the extra padding that is needed
in the save87 struct.
1994-04-29 21:44:23 +00:00
Gary Clark II 9f82ad3dfb Added ifdef for GPL_MATH_EMULATE to keep the sytem from panicing when
using it.
1994-04-29 21:39:55 +00:00
David Greenman a4f7a4c990 From John Dyson:
Fixed physio in the 386 case - write faults weren't properly implemented.
1994-04-25 23:48:20 +00:00
Garrett Wollman 9ad380ab4c Define new option, INACCURATE_MICROTIME_IS_OK. When this is defined,
the NTP kernel PLL is disabled, and acquire_timer0() is enabled, thus
opening the door for microtime() (and hence gettimeofday()) to return
bogus timestamps.  This option is necessary for the `pca' driver to
work, but is implemented to underscore the fact that accurate timekeeping
and the `pca' driver are incompatible at present.  If someone writes a version
of microtime() that works when the `pca' driver is being used, this can get
junked.
1994-04-23 21:39:18 +00:00
Søren Schmidt 57d26a14e9 Added IO_PPI define, pulled timer related stuff 1994-04-21 14:20:54 +00:00
Søren Schmidt f1106e3848 Pulled out timer related functions -> now in clock.c 1994-04-21 14:20:07 +00:00
Søren Schmidt 5194771d25 New support for sharing the timers
acquire_timer / release_timer

Pulled in timer related functions from isa.c
1994-04-21 14:19:16 +00:00
David Greenman 0e195446b7 Bug fixes and performance improvements from John Dyson and myself:
1) check va before clearing the page clean flag. Not doing so was
	causing the vnode pager error 5 messages when paging from
	NFS. (pmap.c)
2) put back interrupt protection in idle_loop. Bruce didn't think
	it was necessary, John insists that it is (and I agree). (swtch.s)
3) various improvements to the clustering code (vm_machdep.c). It's
	now enabled/used by default.
4) bad disk blocks are now handled properly when doing clustered IOs.
	(wd.c, vm_machdep.c)
5) bogus bad block handling fixed in wd.c.
6) algorithm improvements to the pageout/pagescan daemons. It's amazing
	how well 4MB machines work now.
1994-04-20 07:06:57 +00:00
David Greenman f690bbace7 Changes from John Dyson and myself:
1) Removed all instances of disable_intr()/enable_intr() and changed
	them back to splimp/splx. The previous method was done to improve
	the performance, but Bruces recent changes to inline spl* have
	made this unnecessary.
2) Cleaned up vm_machdep.c considerably. Probably fixed a few bugs, too.
3) Added a new mechanism for collecting page statistics - now done by
	a new system process "pagescan". Previously this was done by the
	pageout daemon, but this proved to be impractical.
4) Improved the page usage statistics gathering mechanism - performance is
	much improved in small memory machines.
5) Modified mbuf.h to enable the support for an external free routine when
	using mbuf clusters. Added appropriate glue in various places to
	allow this to work.
6) Adapted a suggested change to the NFS code from Yuval Yurom to take
	advantage of #5.
7) Added fault/swap statistics support.
1994-04-14 07:49:40 +00:00
David Greenman 2862674874 Make Bruce happy: silently enter ddb on a BPT or trace trap if ddb is
configured in the kernel.
1994-04-07 10:51:00 +00:00
David Greenman 1561d038b1 from John Dyson:
1) fixed some bugs related to the bounce buffer code
2) vnode pager now supports clustered pageouts
3) experimental code for clustering all I/O via a new "cldisksort"
4) added >16MB check to Bustek driver
5) made some experimental algorithmic changes to the pageout daemon
6) fixed bugs in truncating mapped files (esp when mapped via NFS)
7) reorganized vnode pager I/O code
1994-04-05 03:23:32 +00:00
Andrey A. Chernov e42b7b4096 Change from Bruce:
isa_dmarangecheck() is off by one error.
> ISARAM_END should be >= ISARAM_END. Only the first page above 16M
was mishandled.
1994-04-02 20:43:25 +00:00
David Greenman d230622648 New interrupt code from Bruce Evans. In additional to Bruce's attached
list of changes, I've made the following additional changes:

1) i386/include/ipl.h renamed to spl.h as the name conflicts with the
   file of the same name in i386/isa/ipl.h.
2) changed all use of *mask (i.e. netmask, biomask, ttymask, etc) to
   *_imask (net_imask, etc).
3) changed vestige of splnet use in if_is to splimp.
4) got rid of "impmask" completely (Bruce had gotten rid of netmask),
   and are now using net_imask instead.
5) dozens of minor cruft to glue in Bruce's changes.

   These require changes I made to config(8) as well, and thus it must
be rebuilt.

-DG

from Bruce Evans:

sio:
	o No diff is supplied.  Remove the define of setsofttty().  I hope
	  that is enough.

*.s:
	o i386/isa/debug.h no longer exists.  The event counters became too
	  much trouble to maintain.  All function call entry and exception
	  entry counters can be recovered by using profiling kernel (the new
	  profiling supports all entry points; however, it is too slow to
	  leave enabled all the time; it also).  Only BDBTRAP() from debug.h
	  is now used.  That is moved to exception.s.  It might be worth
	  preserving SHOW_BITS() and calling it from _mcount() (if enabled).
	o T_ASTFLT is now only set just before calling trap().
	o All exception handlers set SWI_AST_MASK in cpl as soon as possible
	  after entry and arrange for _doreti to restore it atomically with
	  exiting.  It is not possible to set it atomically with entering
	  the kernel, so it must be checked against the user mode bits in
	  the trap frame before committing to using it.  There is no place
	  to store the old value of cpl for syscalls or traps, so there are
	  some complications restoring it.

Profiling stuff (mostly in *.s):
	o Changes to kern/subr_mcount.c, gcc and gprof are not supplied yet.
	o All interesting labels `foo' are renamed `_foo' and all
	  uninteresting labels `_bar' are renamed `bar'.  A small change
	  to gprof allows ignoring labels not starting with underscores.
	o MCOUNT_LABEL() is to provide names for counters for times spent
	  in exception handlers.
	o FAKE_MCOUNT() is a version of MCOUNT() suitable for exception
	  handlers.  Its arg is the pc where the exception occurred.  The
	  new mcount() pretends that this was a call from that pc to a
	  suitable MCOUNT_LABEL().
	o MEXITCOUNT is to turn off any timer started by MCOUNT().

/usr/src/sys/i386/i386/exception.s:
	o The non-BDB BPTTRAP() macros were doing a sti even when interrupts
	  were disabled when the trap occurred.  The sti (fixed) sti is
	  actually a no-op unless you have my changes to machdep.c that make
	  the debugger trap gates interrupt gates, but fixing that would
	  make the ifdefs messier.  ddb seems to be unharmed by both
	  interrupts always disabled and always enabled (I had the branch in
	  the fix back to front for some time :-().
	o There is no known pushal bug.
	o tf_err can be left as garbage for syscalls.

/usr/src/sys/i386/i386/locore.s:
	o Fix and update BDE_DEBUGGER support.
	o ENTRY(btext) before initialization was dangerous.
	o Warm boot shot was longer than intended.

/usr/src/sys/i386/i386/machdep.c:
	o DON'T APPLY ALL OF THIS DIFF.  It's what I'm using, but may require
	  other changes.
	  Use the following:
		o Remove aston() and setsoftclock().
	  Maybe use the following:
		o No netisr.h.
		o Spelling fix.
		o Delay to read the Rebooting message.
		o Fix for vm system unmapping a reduced area of memory
		  after bounds_check_with_label() reduces the size of
		  a physical i/o for a partition boundary.  A similar
		  fix is required in kern_physio.c.
		o Correct use of __CONCAT.  It never worked here for non-
		  ANSI cpp's.  Is it time to drop support for non-ANSI?
		o gdt_segs init.  0xffffffffUL is bogus because ssd_limit
		  is not 32 bits.  The replacement may have the same
		  value :-), but is more natural.
		o physmem was one page too low.  Confusing variable names.
	  Don't use the following:
		o Better numbers of buffers.  Each 8K page requires up to
		  16 buffer headers.  On my system, this results in 5576
		  buffers containing [up to] 2854912 bytes of memory.
		  The usual allocation of about 384 buffers only holds
		  192K of disk if you use it on an fs with a block size
		  of 512.
		o gdt changes for bdb.
		o *TGT -> *IDT changes for bdb.
		o #ifdefed changes for bdb.

/usr/src/sys/i386/i386/microtime.s:
	o Use the correct asm macros.  I think asm.h was copied from Mach
	  just for microtime and isn't used now.  It certainly doesn't
	  belong in <sys>.  Various macros are also duplicated in
	  sys/i386/boot.h and libc/i386/*.h.
	o Don't switch to and from the IRR; it is guaranteed to be selected
	  (default after ICU init and explicitly selected in isa.c too, and
	  never changed until the old microtime clobbered it).

/usr/src/sys/i386/i386/support.s:
	o Non-essential changes (none related to spls or profiling).
	o Removed slow loads of %gs again.  The LDT support may require
	  not relying on %gs, but loading it is not the way to fix it!
	  Some places (copyin ...) forgot to load it.  Loading it clobbers
	  the user %gs.  trap() still loads it after certain types of
	  faults so that fuword() etc can rely on it without loading it
	  explicitly.  Exception handlers don't restore it.  If we want
	  to preserve the user %gs, then the fastest method is to not
	  touch it except for context switches.  Comparing with
	  VM_MAXUSER_ADDRESS and branching takes only 2 or 4 cycles on
	  a 486, while loading %gs takes 9 cycles and using it takes
	  another.
	o Fixed a signed branch to unsigned.

/usr/src/sys/i386/i386/swtch.s:
	o Move spl0() outside of idle loop.
	o Remove cli/sti from idle loop.  sw1 does a cli, and in the
	  unlikely event of an interrupt occurring and whichqs becoming
	  zero, sw1 will just jump back to _idle.
	o There's no spl0() function in asm any more, so use splz().
	o swtch() doesn't need to be superaligned, at least with the
	  new mcounting.
	o Fixed a signed branch to unsigned.
	o Removed astoff().

/usr/src/sys/i386/i386/trap.c:
	o The decentralized extern decls were inconsistent, of course.
	o Fixed typo MATH_EMULTATE in comments. */
	o Removed unused variables.
	o Old netmask is now impmask; print it instead.  Perhaps we
	  should print some of the new masks.
	o BTW, trap() should not print anything for normal debugger
	  traps.

/usr/src/sys/i386/include/asmacros.h:
	o DON'T APPLY ALL OF THIS DIFF.  Just use some of the null macros
	  as necessary.

/usr/src/sys/i386/include/cpu.h:
	o CLKF_BASEPRI() changes since cpl == SWI_AST_MASK is now normal
	  while the kernel is running.
	o Don't use var++ to set boolean variables.  It fails after a mere
	  4G times :-) and is slower than storing a constant on [3-4]86s.

/usr/src/sys/i386/include/cpufunc.h:
	o DON'T APPLY ALL OF THIS DIFF.  You need mainly the include of
	  <machine/ipl.h>.  Unfortunately, <machine/ipl.h> is needed by
	  almost everything for the inlines.

/usr/src/sys/i386/include/ipl.h:
	o New file.  Defines spl inlines and SWI macros and declares most
	  variables related to hard and soft interrupt masks.

/usr/src/sys/i386/isa/icu.h:
	o Moved definitions to <machine/ipl.h>

/usr/src/sys/i386/isa/icu.s:
	o Software interrupts (SWIs) and delayed hardware interrupts (HWIs)
	  are now handled uniformally, and dispatching them from splx() is
	  more like dispatching them from _doreti.  The dispatcher is
	  essentially *(handler[ffs(ipending & ~cpl)]().
	o More care (not quite enough) is taken to avoid unbounded nesting
	  of interrupts.
	o The interface to softclock() is changed so that a trap frame is
	  not required.
	o Fast interrupt handlers are now handled more uniformally.
	  Configuration is still too early (new handlers would require
	  bits in <machine/ipl.h> and functions to vector.s).
	o splnnn() and splx() are no longer here; they are inline functions
	  (could be macros for other compilers).  splz() is the nontrivial
	  part of the old splx().

/usr/src/sys/i386/isa/ipl.h
	o New file.  Supposed to have only bus-dependent stuff.  Perhaps
	  the h/w masks should be declared here.

/usr/src/sys/i386/isa/isa.c:
	o DON'T APPLY ALL OF THIS DIFF.  You need only things involving
	  *mask and *MASK and comments about them.  netmask is now a pure
	  software mask.  It works like the softclock mask.

/usr/src/sys/i386/isa/vector.s:
	o Reorganize AUTO_EOI* macros.
	o Option FAST_INTR_HANDLER_USERS_ES for people who don't trust
	  fastintr handlers.
	o fastintr handlers need to metamorphose into ordinary interrupt
	  handlers if their SWI bit has become set.  Previously, sio had
	  unintended latency for handling output completions and input
	  of SLIP framing characters because this was not done.

/usr/src/sys/net/netisr.h:
	o The machine-dependent stuff is now imported from <machine/ipl.h>.

/usr/src/sys/sys/systm.h
	o DON'T APPLY ALL OF THIS DIFF.  You need mainly the different
	  splx() prototype.  The spl*() prototypes are duplicated as
	  inlines in <machine/ipl.h> but they need to be duplicated here
	  in case there are no inlines.  I sent systm.h and cpufunc.h
	  to Garrett.  We agree that spl0 should be replaced by splnone
	  and not the other way around like I've done.

/usr/src/sys/kern/kern_clock.c
	o splsoftclock() now lowers cpl so the direct call to softclock()
	  works as intended.
	o softclock() interface changed to avoid passing the whole frame
	  (some machines may need another change for profile_tick()).
	o profiling renamed _profiling to avoid ANSI namespace pollution.
	  (I had to improve the mcount() interface and may as well fix it.)
	  The GUPROF variant doesn't actually reference profiling here,
	  but the 'U' in GUPROF should mean to select the microtimer
	  mcount() and not change the interface.
1994-04-02 07:00:53 +00:00
David Greenman ac322158f5 Eliminated the "physstrat" wart and merged it into kern_physio.c. This
patch also fixes a bug which causes a kernel VM leak.
1994-03-30 02:47:13 +00:00
David Greenman 4a490e4c21 Eliminated the "physstrat" wart and merged it into kern_physio.c. This
patch also fixes a bug which causes a kernel VM leak.
1994-03-30 02:31:11 +00:00
David Greenman 6b4ac811ca New routine "pmap_kenter", designed to take advantage of the special
case of the kernel pmap.
1994-03-30 02:17:47 +00:00
David Greenman dad5c5fe90 ifdef KERNEL the pmap_kextract inline function; ps is unhappy otherwise.
Pointed out by Frank Terhaar-Yonkers <fty@vislab.epa.gov>.
1994-03-25 22:08:59 +00:00
David Greenman ed7fcbd079 From John Dyson: performance improvements to the new bounce buffer
code.
1994-03-24 23:12:48 +00:00
David Greenman d5e26ef0ef Bounce buffers. From John Dyson with help from me. 1994-03-23 09:16:04 +00:00
Andrey A. Chernov 6ec145713c Now printf("changing root... indicates raw partition for floppy
f.e. fd1d
1994-03-21 15:02:47 +00:00
Andrey A. Chernov 3f0afdd835 Fix printf for root system mounted on second floppy 1994-03-21 14:53:08 +00:00
Andrey A. Chernov 10c7408ae0 Fix for root system mounted on second floppy 1994-03-21 14:37:01 +00:00
David Greenman 29360eb099 Changed dynamic stack grow code to grow by "SGROWSIZ" amount. Initially
allocate SGROWSIZ amount of stack. Also set vm_ssize to the initial
stack VM size. Increased DFLSSIZ stack rlimit default to 8MB.
1994-03-21 09:35:24 +00:00
Garrett Wollman f0e96ca631 Added cpu_model and machine variables. 1994-03-19 23:58:58 +00:00
David Greenman 943a66f340 Performance improvements from John Dyson.
1) A new mechanism has been added to prevent pages from being paged
	out called "vm_page_hold". Similar to vm_page_wire, but
	much lower overhead.
2) Scheduling algorithm has been changed to improve interactive
	performance.
3) Paging algorithm improved.
4) Some vnode and swap pager bugs fixed.
1994-03-14 21:54:03 +00:00
David Greenman 5c09563e1e 1) enhanced in_cksum from Bruce Evans.
2) minor comment change in machdep.c
3) enhanced bzero from John Dyson (twice as fast on a 486DX/33)
1994-03-07 11:47:32 +00:00
David Greenman 04f1835605 1) "Pre-faulting" in of pages into process address space
Eliminates vm_fault overhead on process startup and
		mmap referenced data for in-memory pages.

		(process startup time using in-memory segments *much* faster)

	2)	Even more efficient pmap code.  Code partially cleaned up.
		More comments yet to follow.

		(generally more efficient pte management)

	3)	Pageout clustering ( in addition to the FreeBSD V1.1 pagein
		clustering.)

		(much faster paging performance on non-write behind disk
		subsystems, slightly faster performance on other systems.)

	4)	Slightly changed vm_pageout code for more efficiency and
		better statistics.  Also, resist swapout a little more.

		(less likely to pageout a recently used page)

	5)	Slight improvement to the page table page trap efficiency.

		(generally faster system VM fault performance)

	6)	Defer creation of unnamed anonymous regions pager until needed.

		(speeds up shared memory bss creation)

	7)	Remove possible deadlock from swap_pager initialization.

	8)	Enhanced procfs to provide "vminfo" about vm objects and user
		pmaps.

	9)	Increased MCLSHIFT/MCLBYTES from 2K to 4K to improve net &
		socket performance and to prepare for things to come.

John Dyson
dyson@implode.root.com
David Greenman
davidg@root.com
1994-03-07 11:38:49 +00:00
Jeffrey Hsu ffe25c427d Correct definitions of flags used by sigreturn to validate sigcontext. 1994-02-24 00:21:12 +00:00
Jeffrey Hsu 8d27e59b01 validate sigcontext before restoring it 1994-02-24 00:18:04 +00:00
David Greenman 2c194b2e93 Fixed bug in handling of COW - the original code was bogus and it was
only accidental that it worked. Also, don't cache non-managed pages.
1994-02-13 08:29:33 +00:00
David Greenman 43ef94a93a Patch from John Dyson:
a pv chain was being traversed while interrupts were
	fully enabled in pmap_remove_all ... this is bogus, and
	has been fixed in pmap.c. (sorry for adding the splimp)
1994-02-10 03:03:44 +00:00
David Greenman aae4685ae8 From: Dave Matthews <dave@prlng.co.uk>
Description:
The integer overflow instruction (into) and the interrupt instruction with
value 4 (int #4) both give rise to SIGBUS signals rather than SIGFPE.  The
problem is that overflow is a trap not a fault (unlike the BOUND instruction).
1994-02-08 12:58:44 +00:00
David Greenman b9d60b3f59 Fixed bugs in stack grow code, and moved it back into a seperate function
like it was originally. Also added back call to "grow" in sendsig now
that this routine actually works.
1994-02-08 09:26:04 +00:00