Commit Graph

676 Commits

Author SHA1 Message Date
Bruce Evans
8c4a6d7452 Support compiling with `gcc-pedantic' (don't use hard newlines in
(asm) string constants or trailing commas in enum declarations).
1998-04-19 15:28:30 +00:00
Peter Wemm
514bc6cb56 Fix VM86 compiles. a #include "opt_vm86.h" was missing, and the my_tr
variable was needed in the non-SMP case.

Submitted by:  Jonathan Lemon <jlemon@americantv.com>
1998-04-06 18:59:15 +00:00
Peter Wemm
cf34ef61ee Use real types for the SMP pages being allocated rather than arrays of
ints.  Remove some no longer needed casts.  Initialize the per-cpu
global data area using the structs rather than knowing too much about
layout, alignment, etc.
1998-04-06 15:48:30 +00:00
Peter Wemm
937288c5bb A pair of C structures used for laying out the SMP per-cpu data space. 1998-04-06 15:37:21 +00:00
Peter Wemm
5d0ef2fd65 some missing symbols 1998-04-06 15:33:02 +00:00
Poul-Henning Kamp
8184a0a4d1 Remove stuff related to microtime.s, which is gone. 1998-04-06 11:38:18 +00:00
Poul-Henning Kamp
2eeb0e2ea0 Make read_random() take a (void *) argument instead of (char *) 1998-04-06 09:30:42 +00:00
Poul-Henning Kamp
4cf41af3d4 Make a kernel version of the timer* functions called timerval* to be
more consistent.

OK'ed by:	bde
1998-04-06 08:26:08 +00:00
Poul-Henning Kamp
00af9731c9 Time changes mark 2:
* Figure out UTC relative to boottime.  Four new functions provide
      time relative to boottime.

    * move "runtime" into struct proc.  This helps fix the calcru()
      problem in SMP.

    * kill mono_time.

    * add timespec{add|sub|cmp} macros to time.h.  (XXX: These may change!)

    * nanosleep, select & poll takes long sleeps one day at a time

Reviewed by:    bde
Tested by:      ache and others
1998-04-04 13:26:20 +00:00
Tor Egge
5758c2de94 Add two workarounds for broken MP tables:
- Attempt to handle PCI devices where the interrupt is
	  an ISA/EISA interrupt according to the mp table.

	- Attempt to handle multiple IO APIC pins connected to
	  the same PCI or ISA/EISA interrupt source.  Print a
	  warning if this happens, since performance is suboptimal.
	  This workaround is only used for PCI devices.

With these two workarounds, the -SMP kernel is capable of running on
my Asus P/I-P65UP5 motherboard when version 1.4 of the MP table is disabled.
1998-04-01 21:07:37 +00:00
Tor Egge
300e9a7696 Declare some variables modified by interrupt handlers as volatile. 1998-04-01 20:38:28 +00:00
Jonathan Lemon
640c4313af Add the ability to make real-mode BIOS calls from the kernel. Currently,
everything is contained inside #ifdef VM86, so this option must be
present in the config file to use this functionality.

Thanks to Tor Egge, these changes should work on SMP machines.  However,
it may not be throughly SMP-safe.

Currently, the only BIOS calls made are memory-sizing routines at bootup,
these replace reading the RTC values.
1998-03-23 19:52:59 +00:00
Peter Wemm
e93eb8a353 Several changes:
- Implement proper EISA probing.
 - Better support for the new transputer based host cards.
 - use standard termios settings, one can use the intial/lock devices.
 - use a simple bcopy since some cards/systems apparently don't support
   32 bit accesses.
 - hard reset and halt host card CPU prior to download in case of a soft
   restart.
 - recognize new remote module types (ASIC vs. CD1400 based)
 - a number of cosmetic changes (my fault, not Nick's)

Submitted by:  Nick Sayer <nsayer@quack.kfu.com>
1998-03-23 16:27:43 +00:00
Peter Wemm
d53b8e5f34 merge from 2.2 1998-03-21 06:17:14 +00:00
John Dyson
8f9110f6a1 This mega-commit is meant to fix numerous interrelated problems. There
has been some bitrot and incorrect assumptions in the vfs_bio code.  These
problems have manifest themselves worse on NFS type filesystems, but can
still affect local filesystems under certain circumstances.  Most of
the problems have involved mmap consistancy, and as a side-effect broke
the vfs.ioopt code.  This code might have been committed seperately, but
almost everything is interrelated.

1)	Allow (pmap_object_init_pt) prefaulting of buffer-busy pages that
	are fully valid.
2)	Rather than deactivating erroneously read initial (header) pages in
	kern_exec, we now free them.
3)	Fix the rundown of non-VMIO buffers that are in an inconsistent
	(missing vp) state.
4)	Fix the disassociation of pages from buffers in brelse.  The previous
	code had rotted and was faulty in a couple of important circumstances.
5)	Remove a gratuitious buffer wakeup in vfs_vmio_release.
6)	Remove a crufty and currently unused cluster mechanism for VBLK
	files in vfs_bio_awrite.  When the code is functional, I'll add back
	a cleaner version.
7)	The page busy count wakeups assocated with the buffer cache usage were
	incorrectly cleaned up in a previous commit by me.  Revert to the
	original, correct version, but with a cleaner implementation.
8)	The cluster read code now tries to keep data associated with buffers
	more aggressively (without breaking the heuristics) when it is presumed
	that the read data (buffers) will be soon needed.
9)	Change to filesystem lockmgr locks so that they use LK_NOPAUSE.  The
	delay loop waiting is not useful for filesystem locks, due to the
	length of the time intervals.
10)	Correct and clean-up spec_getpages.
11)	Implement a fully functional nfs_getpages, nfs_putpages.
12)	Fix nfs_write so that modifications are coherent with the NFS data on
	the server disk (at least as well as NFS seems to allow.)
13)	Properly support MS_INVALIDATE on NFS.
14)	Properly pass down MS_INVALIDATE to lower levels of the VM code from
	vm_map_clean.
15)	Better support the notion of pages being busy but valid, so that
	fewer in-transit waits occur.  (use p->busy more for pageouts instead
	of PG_BUSY.)  Since the page is fully valid, it is still usable for
	reads.
16)	It is possible (in error) for cached pages to be busy.  Make the
	page allocation code handle that case correctly.  (It should probably
	be a printf or panic, but I want the system to handle coding errors
	robustly.  I'll probably add a printf.)
17)	Correct the design and usage of vm_page_sleep.  It didn't handle
	consistancy problems very well, so make the design a little less
	lofty.  After vm_page_sleep, if it ever blocked, it is still important
	to relookup the page (if the object generation count changed), and
	verify it's status (always.)
18)	In vm_pageout.c, vm_pageout_clean had rotted, so clean that up.
19)	Push the page busy for writes and VM_PROT_READ into vm_pageout_flush.
20)	Fix vm_pager_put_pages and it's descendents to support an int flag
	instead of a boolean, so that we can pass down the invalidate bit.
1998-03-07 21:37:31 +00:00
Tor Egge
1516126e28 Reenable redirection of clock interrupt to a higher priority vector.
setidt() now knows about f00f_hack(), and the APs now use the same
interrupt descriptor table as the BSP.
1998-03-07 20:48:16 +00:00
Tor Egge
1146c3560f The APs now reload the interrupt descriptor table pointer after
f00f_hack has run.

Use the global r_idt descriptor in f00f_hack when in SMP mode,
so the APs find the relocated interrupt descriptor table.

Submitted by:	Partially from David A Adkins <adkin003@tc.umn.edu>
1998-03-07 20:16:49 +00:00
Tor Egge
5dd528cd4e Remove special handling for resuming clock interrupt when using APIC_IO.
The `generic' vector stubs do the right thing.
1998-03-05 21:45:53 +00:00
Tor Egge
540d82e3b4 Disable redirection of clock interrupt to a higher priority vector.
This does not work on most dual Pentium machines, due to setidt()
being neutralized by f00f_hack().
1998-03-04 23:45:12 +00:00
KATO Takenori
3a94cb7f7d Defined CCR6 and CCR7 (configuration registers of M2 CPU.) 1998-03-04 11:39:16 +00:00
Peter Wemm
f688ebc13a Fix recent breakage when compiling under elf.
_Xforward_irq         -> Xforward_irq
_apic_isrbit_location -> apic_isrbit_location
_cpu_num_to_apic_id   -> cpu_num_to_apic_id
_invltlb_ok           -> invltlb_ok
1998-03-04 09:55:13 +00:00
Tor Egge
02c1dc3bbc When entering the apic version of slow interrupt handler, level
interrupts are masked, and EOI is sent iff the corresponding ISR bit
is set in the local apic. If the CPU cannot obtain the interrupt
service lock (currently the global kernel lock) the interrupt is
forwarded to the CPU holding that lock.

Clock interrupts now have higher priority than other slow interrupts.
1998-03-03 22:56:30 +00:00
Tor Egge
3163861c7b Forward the signal if the process runs on a different CPU. This reduces
the signal handling latency for cpu-bound processes that performs very
few system calls.

The IPI for forcing an additional software trap is no longer dependent upon
BETTER_CLOCK being defined.
1998-03-03 20:55:26 +00:00
Tor Egge
fe9cd27373 Reduce timeout before assuming that forwarding of hardclock or softclock
failed. Don't complain on forwarding failure, unless
BETTER_CLOCK_DIAGNOSTIC is defined.
1998-03-03 20:09:14 +00:00
Tor Egge
221e0c595b forward_statclock and forward_hardclock are located in mp_machdep.c. 1998-03-03 19:44:34 +00:00
John Dyson
ffc82b0a70 1) Use a more consistent page wait methodology.
2)	Do not unnecessarily force page blocking when paging
	pages out.
3)	Further improve swap pager performance and correctness,
	including fixing the paging in progress deadlock (except
	in severe I/O error conditions.)
4)	Enable vfs_ioopt=1 as a default.
5)	Fix and enable the page prezeroing in SMP mode.

All in all, SMP systems especially should show a significant
improvement in "snappyness."
1998-03-01 04:18:54 +00:00
Amancio Hasty
d7ef1f6051 Radio support for bt848 cards from Flemming Jacobsen <fj@trw.nl>
Amancio
1998-02-26 08:19:14 +00:00
John Dyson
660957521c Fix page prezeroing for SMP, and fix some potential paging-in-progress
hangs.  The paging-in-progress diagnosis was a result of Tor Egge's
excellent detective work.
Submitted by:	Partially from Tor Egge.
1998-02-25 03:56:15 +00:00
Bruce Evans
6aeb4f6474 Removed vestiges of previous microtime() implementation. 1998-02-25 02:20:30 +00:00
John Dyson
d9bed5bee1 Try to dynamically size the VM_KMEM_SIZE (but is still able to be overridden
in a way identically as before.)  I had problems with the system properly
handling the number of vnodes when there is alot of system memory, and the
default VM_KMEM_SIZE.  Two new options "VM_KMEM_SIZE_SCALE" and
"VM_KMEM_SIZE_MAX" have been added to support better auto-sizing for systems
with greater than 128MB.

Add some accouting for vm_zone memory allocations, and provide properly
for vm_zone allocations out of the kmem_map.  Also move the vm_zone
allocation stats to the VM OID tree from the KERN OID tree.
1998-02-23 07:42:43 +00:00
Poul-Henning Kamp
7ec73f6417 Replace TOD clock code with more systematic approach.
Highlights:
    * Simple model for underlying hardware.
    * Hardware basis for timekeeping can be changed on the fly.
    * Only one hardware clock responsible for TOD keeping.
    * Provides a real nanotime() function.
    * Time granularity: .232E-18 seconds.
    * Frequency granularity:  .238E-12 s/s
    * Frequency adjustment is continuous in time.
    * Less overhead for frequency adjustment.
    * Improves xntpd performance.

Reviewed by:    bde, bde, bde
1998-02-20 16:36:17 +00:00
Mike Smith
1f98b2eb0f Remove the 'qcam' driver. Development has ceased, and the driver is
nonfunctional.
Submitted by:	pst (conversation some time ago)
1998-02-18 13:43:59 +00:00
Marc G. Fournier
a7b4a3794c soundcard.h wasn't upgraded when i386/isa/snd was 1998-02-18 02:27:00 +00:00
Marc G. Fournier
eebeedcca7 Upgrade Luigi's audio driver to Jan/23 version... will bring in Feb/15th
version as soon as I've tested it...

Installed/tested on my home machine...any problems, please report directly
to me.
1998-02-17 14:03:10 +00:00
KATO Takenori
9dca5248c5 Enable NEC 86 sound card when PC98 is defined.
Submitted by:	Takahashi Yoshihiro <nyan@wyvern.cc.kogakuin.ac.jp>
1998-02-17 03:15:30 +00:00
Peter Wemm
a397086e61 Update to support SI/XIO PCI host cards (Z280 based) and the enhanced
SXISA and SXPCI host cards (Transputer based).

PR: 4836, 5021, 5654
Submitted by:  Nick Sayer <nick@specialix.com>
1998-02-15 14:42:33 +00:00
Poul-Henning Kamp
befeeb59cb Add display of type KD_PIXEL. 1998-02-12 20:47:39 +00:00
Eivind Eklund
303b270b0a Staticize. 1998-02-09 06:11:36 +00:00
John Dyson
95461b450d 1) Start using a cleaner and more consistant page allocator instead
of the various ad-hoc schemes.
2)	When bringing in UPAGES, the pmap code needs to do another vm_page_lookup.
3)	When appropriate, set the PG_A or PG_M bits a-priori to both avoid some
	processor errata, and to minimize redundant processor updating of page
	tables.
4)	Modify pmap_protect so that it can only remove permissions (as it
	originally supported.)  The additional capability is not needed.
5)	Streamline read-only to read-write page mappings.
6)	For pmap_copy_page, don't enable write mapping for source page.
7)	Correct and clean-up pmap_incore.
8)	Cluster initial kern_exec pagin.
9)	Removal of some minor lint from kern_malloc.
10)	Correct some ioopt code.
11)	Remove some dead code from the MI swapout routine.
12)	Correct vm_object_deallocate (to remove backing_object ref.)
13)	Fix dead object handling, that had problems under heavy memory load.
14)	Add minor vm_page_lookup improvements.
15)	Some pages are not in objects, and make sure that the vm_page.c can
	properly support such pages.
16)	Add some more page deficit handling.
17)	Some minor code readability improvements.
1998-02-05 03:32:49 +00:00
Bruce Evans
a8961a8284 Ifdefed some SMP and VM86 code. Note that although VM86 is not a global
option, the ifdef on it in a header works because only the name of the
VM86 extension is hidden.
1998-02-03 21:27:50 +00:00
Bruce Evans
318ed3ed7a Forward declare a union so that this file is self-sufficient.
Cleaned up ifdefs.
1998-02-03 20:46:18 +00:00
Bruce Evans
b9759fe4f9 Fixed a gratuitous ANSIism. 1998-02-03 20:37:29 +00:00
Bruce Evans
7a1a679ecb Ifdefed use of a GNU feature. 1998-02-03 20:32:38 +00:00
Bruce Evans
65fa467e59 Moved misplaced idempotency ifdef. Multiple inclusion was fatal since
there was a typedef outside the ifdef.

Fixed syntax error after the #endif for this ifdef.

Didn't fix the usual style bugs for this ifdef...
1998-02-03 20:24:13 +00:00
Bruce Evans
98a6e74553 Changed inline' to __inline' so that this file can be compiled by
`gcc -ansi'.

Changed NULL to 0 so that this file is more self-sufficient (now
only <sys/types.h> is a prerequisite).
1998-02-03 20:14:35 +00:00
Bruce Evans
eafe3040d4 Don't declare prototypes for driver functions unless KERNEL is defined. 1998-02-03 20:07:02 +00:00
Bruce Evans
919de96974 Fixed conflicts between <machine/console.h> and <machine/pcvt_ioctl.h>,
so that it is possible for kdump and truss to include them both.  Use
#defines from pcvt_ioctl.h in conflicting cases, since pcvt_ioctl.h
gives a hint about the bogus third arg to _IO().  Ifdef the common
typedefs.  Export `struct key_t' from pcvt_ioctl.h so pcvt_ioctl.h is
bug for bug compatible with console.h (now both are broken in C++
mode).
1998-02-03 19:57:46 +00:00
Amancio Hasty
2b1973e8ad Bugs/Enhancements:
1. Takeshi Ohashi <ohashi@atohasi.mickey.ai.kyutech.ac.jp> submitted
   code to support bktr_read . /usr/src/share/examples/rgb24.c now works 8)

2. Flemming Jacobsen <fj@schizo.dk.tfs.com> submitted code to support
   radio available with in some bt848 based cards;additionally, wrote
   code to correctly recognized his bt848 card.
3. Roger Hardiman <roger@cs.strath.ac.uk> submitted various fixes to smooth
   out the microcode and made all modes consistent.

4. Added supported for yuv12 so we know can capture raw streams and feed it
   to mpeg_encoder . The upshot is that we can now mpeg encode more and save
   nearly 100 percent of the disk requirements previously for programs such
   as fxtv first save the raw video image to disk then converted to a
   format suitable for mpeg_encode.
1998-02-02 13:09:12 +00:00
Bruce Evans
af3b301b36 Fixed disordering of busdma* and swi_vm. 1998-02-01 23:00:53 +00:00
Bruce Evans
e29b867bd6 Fixed a recently broken comment. 1998-02-01 22:45:23 +00:00