Commit graph

2747 commits

Author SHA1 Message Date
Julian Elischer 0b1ae8097d A set of changes to reduce the number of include files the kernel
takes from /usr/include. I cannot check them on alpha.. (will try beast)

Briefly looked at by: Warner Losh <imp@harmony.village.org>
2001-07-08 04:56:07 +00:00
Matthew Dillon 7197571105 Move vm_page_zero_idle() from machine-dependant sections to a
machine-independant source file, vm/vm_zeroidle.c.  It was exactly the
same for all platforms and updating them all was getting annoying.
2001-07-05 01:32:42 +00:00
Matthew Dillon 6d03d577a5 Reorg vm_page.c into vm_page.c, vm_pageq.c, and vm_contig.c (for contigmalloc).
Also removed some spl's and added some VM mutexes, but they are not actually
used yet, so this commit does not really make any operational changes
to the system.

vm_page.c relates to vm_page_t manipulation, including high level deactivation,
activation, etc...  vm_pageq.c relates to finding free pages and aquiring
exclusive access to a page queue (exclusivity part not yet implemented).
And the world still builds... :-)
2001-07-04 23:27:09 +00:00
Matthew Dillon 0cddd8f023 With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage).  Also add various GIANT_ macros to
formalize the removal of Giant, making it easy to test in a more piecemeal
fashion. These macros will allow us to test fine-grained locks to a degree
before removing Giant, and also after, and to remove Giant in a piecemeal
fashion via sysctl's on those subsystems which the authors believe can
operate without Giant.
2001-07-04 16:20:28 +00:00
Thomas Moestl 948d3d9484 Make the code to read the kernel message buffer via sysctl machine-
independent and rename the corresponding sysctls from machdep.msgbuf and
machdep.msgbuf_clear (i386 only) to kern.msgbuf and kern.msgbuf_clear.
2001-07-03 19:44:07 +00:00
Mitsuru IWASAKI 6cee406625 Add Transmeta Crusoe LongRun support.
Submitted by:	Tamotsu HATTORI <athlete@kta.att.ne.jp>
Reviewed by:	arch@ folks
MFC after:	1 week
2001-07-03 10:03:24 +00:00
John Baldwin aa5d2a75d8 Quiet warning by removing ast() prototype.
Forgotten by:	jhb (me)
2001-07-03 05:11:55 +00:00
John Baldwin d2a5bcc3d3 Allow Giant to be recursed when a process terminates. 2001-07-03 05:09:48 +00:00
Brooks Davis 53dab5fe7b gif(4) and stf(4) modernization:
- Remove gif dependencies from stf.
 - Make gif and stf into modules
 - Make gif cloneable.

PR:		kern/27983
Reviewed by:	ru, ume
Obtained from:	NetBSD
MFC after:	1 week
2001-07-02 21:02:09 +00:00
Warner Losh 1b0a8621e6 Repo copy i8237.h to dev/ic so we can get rid of some of the final vestiges
of includes of i386 files from non-i386 ports.
2001-06-30 05:29:11 +00:00
John Baldwin 7aa7260e4a Move ast() and userret() to sys/kern/subr_trap.c now that they are MI. 2001-06-29 19:51:37 +00:00
Warner Losh 9a44bb7681 Remove cruft from old bus. 2001-06-29 18:13:30 +00:00
John Baldwin 6be523bca7 Add a new MI pointer to the process' trapframe p_frame instead of using
various differently named pointers buried under p_md.

Reviewed by:	jake (in principle)
2001-06-29 11:10:41 +00:00
John Baldwin 92809bc001 Grab Giant around trap_pfault() for now. 2001-06-29 04:18:10 +00:00
John Baldwin 25142c5ea1 Get kernel profiling on SMP systems closer to working by replacing the
mcount spin mutex with a very simple non-recursive spinlock implemented
using atomic operations.
2001-06-28 04:03:29 +00:00
Brian S. Dean 6eda157eaa Provide access to the IA32 hardware debug registers from the ddb
kernel debugger.  Proper use of these registers allows setting
hardware watchpoints for use in kernel debugging.

MFC after: 2 weeks
2001-06-28 02:08:13 +00:00
KATO Takenori 5d2f190a3b Recognize FC-PGA2 Pentium III (Tualatin). 2001-06-26 03:02:30 +00:00
Doug Rabson b5da4ce935 Add code to detect Transmeta Crusoe cpus. 2001-06-25 15:11:33 +00:00
John Baldwin 06c836bbca - Grab the proc lock around CURSIG and postsig(). Don't release the proc
lock until after grabbing the sched_lock to avoid CURSIG racing with
  psignal.
- Don't grab Giant for addupc_task() as it isn't needed.

Reported by:	tegge (signal race), bde (addupc_task a while back)
2001-06-22 23:05:11 +00:00
Peter Wemm 1a6d55cecd Make the hw.physmem and hw.usermem variables unsigned so that they dont
come up as negative on machines with >2GB ram.
2001-06-22 22:07:01 +00:00
John Baldwin ce1a1f42fb Initialize mutexes needed early on all in the same place so that the
startup routine more closely matches that of alpha and ia64.  At some
point the common mutexes shared across all platforms probably should move
into sys/kern_mutex.c.
2001-06-18 19:19:38 +00:00
John Baldwin 0865563a93 - Add support for decoding syscall names. (Brought over from the new alpha
trace code that was brought over from NetBSD.)
- Check for "syscall_with_err_pushed" as the label prior to a syscall trap
  frame rather than "Xlcall_syscall" and "Xint0x80_syscall".  We don't
  have a valid trapframe during the short range of code that those two
  symbols now cover.
- Simplify db_next_frame() to avoid duplicating the code for the different
  trap frame types.
- Don't try to trace a swapped-out process.  (Brought over from NetBSD via
  the new alpha trace code.)
2001-06-18 19:17:30 +00:00
John Baldwin 3128cdd847 Include sys/pcpu.h to get the prototype for globaldata_register() to quiet
a warning.
2001-06-18 19:06:14 +00:00
Yoshihiro Takahashi 6c551e8d24 Don't assume that resource type is ioport and rid equal 0. 2001-06-17 13:33:59 +00:00
Alexander Langer 90f76f2df0 Fix "alignemnt" typo. 2001-06-16 15:28:28 +00:00
Peter Wemm 17e904e08d Fix warnings:
908: warning: long unsigned int format, unsigned int arg (arg 3)
887: warning: `timezero' defined but not used
2001-06-15 07:53:20 +00:00
Peter Wemm 2398f0cd1d Hints overhaul:
- Replace some very poorly thought out API hacks that should have been
  fixed a long while ago.
- Provide some much more flexible search functions (resource_find_*())
- Use strings for storage instead of an outgrowth of the rather
  inconvenient temporary ioconf table from config().  We already had a
  fallback to using strings before malloc/vm was running anyway.
2001-06-12 09:40:04 +00:00
David E. O'Brien f9b58b41a3 Fix style of defines. 2001-06-09 05:21:17 +00:00
John Baldwin 262c9f8a3b Don't hold sched_lock across addupc_task().
Reported by:	David Taylor <davidt@yadt.co.uk>
Submitted by:	bde
2001-06-06 00:57:24 +00:00
Poul-Henning Kamp 0d31cbfab7 Properly wrap mtx_intr_enable() macro in "do $bla while (0)" 2001-06-02 08:17:42 +00:00
Thomas Moestl d279178df7 Clean up the code exporting interrupt statistics via sysctl a bit:
- move the sysctl code to kern_intr.c
- do not use INTRCNT_COUNT, but rather eintrcnt - intrcnt to determine
  the length of the intrcnt array
- move the declarations of intrnames, eintrnames, intrcnt and eintrcnt
  from machine-dependent include files to sys/interrupt.h
- remove the hw.nintr sysctl, it is not needed.
- fix various style bugs

Requested by:	bde
Reviewed by:	bde (some time ago)
2001-06-01 13:23:28 +00:00
John Baldwin 5eb6e27905 Quiet warnings by adding a prototype for set_user_ldt_rv() and making it
conditional on #ifdef SMP.
2001-05-30 21:57:52 +00:00
John Baldwin 1acf256d96 We can't grab the sched_lock in set_user_ldt() because when it is called
from cpu_switch(), curproc has been changed, but the sched_lock owner will
not be updated until we return to mi_switch(), thus we deadlock against
ourselves.  As a workaround, push the acquire and release of sched_lock out
to the callers of set_user_ldt().  Note that we can't use a mtx_assert() in
set_user_ldt for the same reason.

Sleuting by:	tmm
Tested by:	tmm, dougb
2001-05-30 14:35:22 +00:00
Matt Jacob ecf33dd4c4 move wx to be part of miibus requiring chipsets 2001-05-30 03:20:52 +00:00
Poul-Henning Kamp 888a8e3567 Remove MFS options from all example kernel configs. 2001-05-29 18:49:06 +00:00
Jordan K. Hubbard caff01c276 Remove pcm hints here now that it's gone from GENERIC.
Reminded-by:	bde
2001-05-26 08:04:34 +00:00
Jordan K. Hubbard 62d1937cec Take pcm (audio) back out of GENERIC; there appears to be some
concensus, most notably among the maintainers, that it's better
loaded as a module.

Finally-pushed-over-the-edge-by-the-anguished-cries-of:	rwatson
2001-05-25 17:55:39 +00:00
John Baldwin 0dfefe6829 Don't acquire Giant just to call trap_fatal(), we are about to panic
anyway so we'd rather see the printf's then block if the system is
hosed.
2001-05-23 22:58:09 +00:00
Alfred Perlstein 1f50e112b6 pmap_mapdev needs the vm_mtx, aquire it if not already locked 2001-05-23 22:17:28 +00:00
Alfred Perlstein b99c886a7f lock vm while playing with pmap 2001-05-23 22:13:58 +00:00
Bruce Evans 1c1771cb5b Convert npx interrupts into traps instead of vice versa. This is much
simpler for npx exceptions that start as traps (no assembly required...)
and works better for npx exceptions that start as interrupts (there is
no longer a problem for nested interrupts).

Submitted by:	original (pre-SMPng) version by luoqi
2001-05-22 21:20:49 +00:00
John Baldwin c4f96c5f83 Remove a few more spl's I missed earlier.
Reported by:	Michael Harnois <mdharnois@home.com>
Pointy hat:	me
2001-05-22 00:09:26 +00:00
John Baldwin 9dceb26b23 Sort includes. 2001-05-21 18:52:02 +00:00
John Baldwin d8aad40c88 Axe unneeded spl()'s. 2001-05-21 18:30:50 +00:00
Bruce Evans 17008f5343 Throw away the complications in npxsave() and their infrastructure.
npxsave() went to great lengths to excecute fnsave with interrupts
enabled in case executing it froze the CPU.  This case can't happen,
at least for Intel CPU/NPX's.  Spurious IRQ13's don't imply spurious
freezes.  Anyway, the complications were usually no-ops because IRQ13
is not used on i486's and newer CPUs, and because SMPng broke them in
rev.1.84.  Forcible enabling of interrupts was changed to
write_eflags(old_eflags), but since SMPng usually calls npxsave() from
cpu_switch() with interrupts disabled, write_eflags() usually just
kept interrupts disabled.
2001-05-20 20:04:40 +00:00
Bruce Evans 7010278935 Use a critical region to protect almost everything in npxinit().
npxinit() didn't have the usual race because it doesn't save to curpcb,
but it may have had a worse form of it since it uses the npx when it
doesn't "own" it.  I'm not sure if locking prevented this.  npxinit()
is normally caled with the proc lock but not sched_lock.

Use a critical region to protect pushing of curproc's npx state to
curpcb in npxexit().  Not doing so was harmless since it at worst
saved a wrong state to a dieing pcb.
2001-05-20 18:05:44 +00:00
Bruce Evans c2b095ab72 Use a critical region to protect saving of the npx state in savectx().
Not doing this was fairly harmless because savectx() is only called
for panic dumps and the bug could at worse reset the state.

savectx() is still missing saving of (volatile) debug registers, and
still isn't called for core dumps.
2001-05-20 16:51:08 +00:00
Alfred Perlstein 2395531439 Introduce a global lock for the vm subsystem (vm_mtx).
vm_mtx does not recurse and is required for most low level
vm operations.

faults can not be taken without holding Giant.

Memory subsystems can now call the base page allocators safely.

Almost all atomic ops were removed as they are covered under the
vm mutex.

Alpha and ia64 now need to catch up to i386's trap handlers.

FFS and NFS have been tested, other filesystems will need minor
changes (grabbing the vm lock when twiddling page properties).

Reviewed (partially) by: jake, jhb
2001-05-19 01:28:09 +00:00
John Baldwin 7a08bae6ec - Move the setting of bootverbose to a MI SI_SUB_TUNABLES SYSINIT.
- Attach a writable sysctl to bootverbose (debug.bootverbose) so it can be
  toggled after boot.
- Move the printf of the version string to a SI_SUB_COPYRIGHT SYSINIT just
  afer the display of the copyright message instead of doing it by hand in
  three MD places.
2001-05-17 22:28:46 +00:00
John Baldwin ddfbf9d259 - Axe the IMEN_BITS and APIC_IMEN_BITS constants.
- Add back in a definition of NHWI which is preferred over ICU_LEN.

Submitted by:	bde
2001-05-17 22:24:17 +00:00