Commit Graph

349 Commits

Author SHA1 Message Date
benno
fbb3ffd56a Replace inline asm with it's inline function wrapper. 2002-04-20 10:06:22 +00:00
benno
2a838a2aff Correct a comment. 2002-04-16 12:15:17 +00:00
benno
10462ad477 Implement the following functions:
- pmap_kextract
	- pmap_object_init_pt
	- pmap_protect
	- pmap_remove_pages

I'm pretty sure pmap_remove_pages is at least somewhat bogus.
2002-04-16 12:13:10 +00:00
benno
ed687f83ff Remove some dead code. 2002-04-16 12:10:04 +00:00
benno
f2d443a680 Use mtsrin() instead of inline asm. 2002-04-16 12:07:41 +00:00
benno
327177ba2e Change the value of PMAP_BOOTSTRAP so we don't stomp on the PTE index value. 2002-04-16 12:00:43 +00:00
benno
6ea8f0587f Add inlines for mtsrin and mfsrin. 2002-04-16 11:45:09 +00:00
peter
3d8c7d4cab Pass vm_page_t instead of physical addresses to pmap_zero_page[_area]()
and pmap_copy_page().  This gets rid of a couple more physical addresses
in upper layers, with the eventual aim of supporting PAE and dealing with
the physical addressing mostly within pmap.  (We will need either 64 bit
physical addresses or page indexes, possibly both depending on the
circumstances.  Leaving this to pmap itself gives more flexibilitly.)

Reviewed by:	jake
Tested on:	i386, ia64 and (I believe) sparc64. (my alpha was hosed)
2002-04-15 16:00:03 +00:00
benno
813f104cc8 Add ofwd to the GENERIC config for powerpc. 2002-04-15 12:30:18 +00:00
benno
a7de23a1ad Add a nexus device.
Copied from:	sparc64
2002-04-15 12:29:18 +00:00
benno
3bc1e338fc Turn some CTR's into CTR0's. 2002-04-15 12:11:18 +00:00
benno
acd63b074d GC an extraneous prototype of delay(). 2002-04-15 12:02:43 +00:00
mike
c3c6b2e7be Include <sys/cdefs.h> for definition of __BSD_VISIBLE.
Pointy hat to:	mike
2002-04-12 15:56:45 +00:00
mike
24420c8af5 Remove the hack for segsz_t from <sys/types.h>; use the normal
_BSD_FOO_T_ method for defining segsz_t.
2002-04-10 15:58:13 +00:00
mike
7fb662578d Add manifest constants: _LITTLE_ENDIAN, _BIG_ENDIAN, _PDP_ENDIAN, and
_BYTE_ORDER.  These are far more useful than their non-underscored
equivalents as these can be used in restricted namespace environments.
Mark the non-underscored variants as deprecated.
2002-04-10 14:39:14 +00:00
phk
77e3582887 GC various bits and pieces of USERCONFIG from all over the place. 2002-04-09 11:18:46 +00:00
phk
3234f33800 GC the "dumplo" variable, which is no longer used.
A lot of sys/*/*/machdep.c seems not to be.
2002-04-07 21:01:37 +00:00
jhb
9d3d63fcbc - Move the MI mutexes sched_lock and Giant from being declared in the
various machdep.c's to being declared in kern_mutex.c.
- Add a new function mutex_init() used to perform early initialization
  needed for mutexes such as setting up thread0's contested lock list
  and initializing MI mutexes.  Change the various MD startup routines
  to call this function instead of duplicating all the code themselves.

Tested on:	alpha, i386
2002-04-02 22:19:16 +00:00
dillon
3ad295d416 Stage-2 commit of the critical*() code. This re-inlines cpu_critical_enter()
and cpu_critical_exit() and moves associated critical prototypes into their
own header file, <arch>/<arch>/critical.h, which is only included by the
three MI source files that need it.

Backout and re-apply improperly comitted syntactical cleanups made to files
that were still under active development.  Backout improperly comitted program
structure changes that moved localized declarations to the top of two
procedures.  Partially re-apply one of the program structure changes to
move 'mask' into an intermediate block rather then in three separate
sub-blocks to make the code more readable.  Re-integrate bug fixes that Jake
made to the sparc64 code.

Note: In general, developers should not gratuitously move declarations out
of sub-blocks.  They are where they are for reasons of structure, grouping,
readability, compiler-localizability, and to avoid developer-introduced bugs
similar to several found in recent years in the VFS and VM code.

Reviewed by:	jake
2002-04-01 23:51:23 +00:00
phk
87273d930a Centralize the "bootdev" and "dumpdev" variables. They are still pretty
bogus all things considered, but at least now they don't camouflage as
being MD variables.
2002-03-31 07:15:28 +00:00
alc
34c6c68a2d Use the MI vm_map_growstack() instead of the MD grow_stack() in trap(). Remove
the MD grow_stack().
2002-03-30 20:44:31 +00:00
jeff
dff418f166 Add a new mtx_init option "MTX_DUPOK" which allows duplicate acquires of locks
with this flag.  Remove the dup_list and dup_ok code from subr_witness.  Now
we just check for the flag instead of doing string compares.

Also, switch the process lock, process group lock, and uma per cpu locks over
to this interface.  The original mechanism did not work well for uma because
per cpu lock names are unique to each zone.

Approved by:	jhb
2002-03-27 09:23:41 +00:00
dillon
dc5aafeb94 Compromise for critical*()/cpu_critical*() recommit. Cleanup the interrupt
disablement assumptions in kern_fork.c by adding another API call,
cpu_critical_fork_exit().  Cleanup the td_savecrit field by moving it
from MI to MD.  Temporarily move cpu_critical*() from <arch>/include/cpufunc.h
to <arch>/<arch>/critical.c (stage-2 will clean this up).

Implement interrupt deferral for i386 that allows interrupts to remain
enabled inside critical sections.  This also fixes an IPI interlock bug,
and requires uses of icu_lock to be enclosed in a true interrupt disablement.

This is the stage-1 commit.  Stage-2 will occur after stage-1 has stabilized,
and will move cpu_critical*() into its own header file(s) + other things.
This commit may break non-i386 architectures in trivial ways.  This should
be temporary.

Reviewed by:	core
Approved by:	core
2002-03-27 05:39:23 +00:00
obrien
8842976cdd Guard against redefining __gnuc_va_list. 2002-03-24 11:25:46 +00:00
obrien
4c2f517045 ASM versions of __FBSDID. 2002-03-23 02:01:27 +00:00
benno
d0f7d01438 Collect all functions for copying to and from userspace into the one file.
This allows me to reimplement [sf]u{byte,word} as separate functions and not
as calls to copy{in,out}.
2002-03-21 23:45:59 +00:00
benno
6932067f77 - Make all inlines for manipulating supervisor-level registers accept/return
register_t values.
- Implement an inline for isync.
2002-03-21 13:07:31 +00:00
benno
d99dec6eef GC some unused, bogus interrupt functions and replace them with proper
implementations of intr_disable and intr_restore.
2002-03-21 12:04:58 +00:00
jeff
ec342524a2 Remove references to vm_zone.h and switch over to the new uma API. 2002-03-21 01:11:31 +00:00
alfred
f1b2b9896d Remove __P.
Reveiwed by: benno
2002-03-20 23:17:50 +00:00
jhb
715dfdbcbe Change the way we ensure td_ucred is NULL if DIAGNOSTIC is defined.
Instead of caching the ucred reference, just go ahead and eat the
decerement and increment of the refcount.  Now that Giant is pushed down
into crfree(), we no longer have to get Giant in the common case.  In the
case when we are actually free'ing the ucred, we would normally free it on
the next kernel entry, so the cost there is not new, just in a different
place.  This also removse td_cache_ucred from struct thread.  This is
still only done #ifdef DIAGNOSTIC.

Tested on:	i386, alpha
2002-03-20 21:09:09 +00:00
benno
95b805ab3b Increment pmap_pvo_count in the right place. 2002-03-20 05:25:33 +00:00
jeff
2923687da3 This is the first part of the new kernel memory allocator. This replaces
malloc(9) and vm_zone with a slab like allocator.

Reviewed by:	arch@
2002-03-19 09:11:49 +00:00
benno
d2e1ce9477 Changes and fixes in preparation for UMA:
- Bootstrap pvo entries are now allocated by stealing pages.
- Just return if we're pmap_enter'ing a mapping that's already there.  Don't
  remove it and re-enter it.
2002-03-17 23:58:12 +00:00
benno
1a9cabc484 Lowercase all of the trap names. 2002-03-17 23:55:11 +00:00
benno
15a0342057 Clean up and fix up copyin and copyout. 2002-03-17 23:54:55 +00:00
des
a032109782 Move the definition of PT_[GS]ET{,DB,FP}REGS from the MD ptrace.h to the
MI ptrace.h, since all platforms define them.  Keep the MD ptrace.h around
for FIX_SSTEP (which is currently only needed on Alpha).
2002-03-16 00:25:53 +00:00
benno
a16c1fce78 Correct a typo. (* that should've been &) 2002-03-11 07:09:42 +00:00
mike
b8cc0d1207 o Don't require long long support in bswap64() functions.
o In i386's <machine/endian.h>, macros have some advantages over
  inlines, so change some inlines to macros.
o In i386's <machine/endian.h>, ungarbage collect word_swap_int()
  (previously __uint16_swap_uint32), it has some uses on i386's with
  PDP endianness.

Submitted by:	bde

o Move a comment up in <machine/endian.h> that was accidentially moved
  down a few revisions ago.
o Reenable userland's use of optimized inline-asm versions of
  byteorder(3) functions.
o Fix ordering of prototypes vs. redefinition of byteorder(3)
  functions, so that the non-GCC (libc asm) case has proper
  prototypes.
o Add proper prototypes for byteorder(3) functions in <sys/param.h>.
o Prevent redundant duplicate prototypes by making use of the
  _BYTEORDER_PROTOTYPED define.
o Move the bswap16(), bswap32(), bswap64() C functions into MD space
  for platforms in which asm versions don't exist.  This significantly
  reduces the complexity of some things at the cost of duplicate code.

Reviewed by:	bde
2002-03-09 21:02:16 +00:00
benno
65393002bd Install the DSI and ISI trap handlers and their appropriate locations. 2002-03-07 12:22:44 +00:00
benno
5784524774 Copy the "implementation" of pmap_prefault from sparc64. 2002-03-07 12:22:08 +00:00
benno
2ee5d124d0 Move tunable initialisation so it can get access to physmem. 2002-03-07 10:15:17 +00:00
benno
a4f95150fb Calculate physmem. 2002-03-07 10:09:24 +00:00
arr
ed36876e15 - Move a comment from being on the same line as a #ifdef to the line
following it.  This should have gone in the previous commit, but
  misviewed Bruce's patch.

Requested by: bde
2002-02-28 21:52:08 +00:00
benno
e2a5a67db8 cpu_switch now works, for kthreads at least. 2002-02-28 12:06:49 +00:00
benno
9ed9d1965d Various cleanups. 2002-02-28 12:00:24 +00:00
benno
63f5bcde8c - Prevent the decrementer interrupt handler from nesting.
- Catch some more cases of PSL_EE and PSL_RI getting out of sync.
2002-02-28 11:57:47 +00:00
benno
2f6cdd2140 - Modify pmap_activate so it only marks the pmap as active.
- Add a pmap_deactivate function.
2002-02-28 11:55:44 +00:00
benno
77973ba896 GC an unused variable in cpu_fork(). 2002-02-28 08:48:58 +00:00
arr
0aaddb66e9 - Fix panic() message and a couple style nits that snuck in from the
recent diagnostics commit (rev. 1.84).
2002-02-28 08:28:14 +00:00