Commit Graph

183 Commits

Author SHA1 Message Date
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