Commit Graph

137 Commits

Author SHA1 Message Date
jdolecek 089abdad44 Rearrange process exit path to avoid need to free resources from different
process context ('reaper').

From within the exiting process context:
* deactivate pmap and free vmspace while we can still block
* introduce MD cpu_lwp_free() - this cleans all MD-specific context (such
  as FPU state), and is the last potentially blocking operation;
  all of cpu_wait(), and most of cpu_exit(), is now folded into cpu_lwp_free()
* process is now immediatelly marked as zombie and made available for pickup
  by parent; the remaining last lwp continues the exit as fully detached
* MI (rather than MD) code bumps uvmexp.swtch, cpu_exit() is now same
  for both 'process' and 'lwp' exit

uvm_lwp_exit() is modified to never block; the u-area memory is now
always just linked to the list of available u-areas. Introduce (blocking)
uvm_uarea_drain(), which is called to release the excessive u-area memory;
this is called by parent within wait4(), or by pagedaemon on memory shortage.
uvm_uarea_free() is now private function within uvm_glue.c.

MD process/lwp exit code now always calls lwp_exit2() immediatelly after
switching away from the exiting lwp.

g/c now unneeded routines and variables, including the reaper kernel thread
2004-01-04 11:33:29 +00:00
pk 70f20a1217 Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes).  It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms.  Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.
2003-12-30 12:33:13 +00:00
jmc 695a2a2f9f Change reference at bottom from sys/dev/majors to sys/conf/majors to match
reality
2003-12-10 02:04:00 +00:00
he b4d0601326 Follow through with the removal of cpu_sysctl() here as well,
on the tail of the dynamic sysctl reorganization.
2003-12-05 23:56:20 +00:00
bjh21 a5bcddc85a Add pcb_onfault handling to address exception handler so users can't crash
the kernel by passing ludicrous addresses to system calls.
2003-11-30 13:22:32 +00:00
bjh21 e8532b5727 Remove a stray "#ifndef __APCS_26__" 2003-11-29 22:27:56 +00:00
bjh21 8ed01db68c Add some commas to make a comment more readable. 2003-11-29 22:26:17 +00:00
bjh21 41f83fd2b1 On a prefetch abort or an address exception in the kernel, drop
straight into DDB rather than calling panic().  This will allow DDB to
see what was actually going on at the time of the exception.
2003-11-29 22:03:21 +00:00
bjh21 18a0620f50 Sync acorn26 riscoscalls with acorn32 version. 2003-11-23 15:55:03 +00:00
bjh21 d8b0dd8a97 Create the "machine" and "arm" links directly from the .BEGIN rule, rather
than in dependencies of it, since .BEGIN is apparently only special for
its commands, not its dependencies.  This should get boot26, and probably
boot32, compiling again.
2003-11-23 13:34:07 +00:00
he 435506f677 Reshuffle this code so that we avoid an uninitialized warning from the
compiler.

Reviewed by bjh21.
2003-11-07 12:24:10 +00:00
he 0b0101a884 Re-balance parenthesis. 2003-11-07 10:41:55 +00:00
dsl 2ffbd2ab99 Remove p_nras from struct proc - use LIST_EMPTY(&p->p_raslist) instead.
Remove p_raslock and rename p_lwplock p_lock (one lock is enough).
Simplify window test when adding a ras and correct test on VM_MAXUSER_ADDRESS.
Avoid unpredictable branch in i386 locore.S
(pad fields left in struct proc to avoid kernel bump)
2003-11-04 10:33:15 +00:00
he c8122b488e The compiler doesn't know that setjmp() always returns 0 "the first
time around", so move the initialization of cp0 and cp15 to outside
the if() statement to make this compile again.
2003-11-02 12:39:30 +00:00
jdolecek f592a1fb33 update for SA_SIGINFO trapsignal changes 2003-10-26 13:19:30 +00:00
jdolecek a95f0f5f7d fix NULL vs. 0 usage 2003-10-26 13:17:50 +00:00
lukem f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00
jdolecek bf6449bbff add major for wsfont 2003-10-20 16:20:53 +00:00
jdolecek 4bb42bc621 switch ARM to use same minor for /dev/zero as other archs
as discussed on tech-arm@
2003-10-16 12:02:58 +00:00
jdolecek 79ebb210fa add majors for ipfilter, lkm, vnd, tun, raid, cgd, ccd, and md
where missing
2003-10-15 18:20:19 +00:00
christos 4262a06968 try to fix the compile error. 2003-10-11 03:01:53 +00:00
jdolecek ef5bb330f5 reassing majors for crypto and pf to use the newly defined MI major
range
2003-10-10 22:42:39 +00:00
jdolecek 4e915c9ccd update the comment - the space for machine-dependant majors
is reduced to 0-143
follows discussion on tech-kern
2003-10-10 21:21:25 +00:00
bouyer b7d355a7b2 add atabus 2003-10-08 10:59:55 +00:00
simonb 970b12080e Define LIB{CRT0,C,CRTBEGIN,CRTEND} as nothing, we don't need to link
against them.
2003-10-08 01:40:22 +00:00
thorpej 2af80d899e New generic I2C framework. Supports bit-bang and "intelligent" I2C
interface controllers (of varying intelligence levels).

Contributed by Wasabi Systems, Inc.  Primarily written by Steve Woodford,
with some modification by me.

(NOTE: "cvs add" was missed on this file during the initial checkin
of the new I2C code.)
2003-10-06 16:08:42 +00:00
jdolecek e6286b949a Add some framework for MI assignment of device majors - add sys/dev/majors
which is automatically included during kernel config, and add comments
to individual machine-dependant majors.* files to assign new MI majors
in MI file.

Range 0-191 is reserved for machine-specific assignments, range
192+ are MI assignments.

Follows recent discussion on tech-kern@
2003-10-05 08:04:24 +00:00
thorpej 2652188cc4 New generic I2C framework. Supports bit-bang and "intelligent" I2C
interface controllers (of varying intelligence levels).

Contributed by Wasabi Systems, Inc.  Primarily written by Steve Woodford,
with some modification by me.
2003-09-30 00:35:30 +00:00
matt 533ad6c08b Fix more GCC 3.3.1 nits. 2003-09-21 06:52:42 +00:00
matt cd3cb3dc0f GCC 3.3.1 fixes (-ffreestanding, #include <lib/libkern/libkern.h>) 2003-09-21 06:28:37 +00:00
chris cfb7a98211 Add COMPAT_16 to most arm based kernels. Mainly in preperation for doing
SA_SIGINFO work.
2003-09-13 13:30:01 +00:00
scw 973e9cff89 Add definitions required for new in_cksum. 2003-09-11 18:58:44 +00:00
itojun 4440262659 create /dev/crypto 2003-08-22 05:06:22 +00:00
he b6643fd4d3 Adapt to const-ification of first arg of open function in fs_ops. 2003-08-21 23:15:18 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
bsh fbf0aea004 add __GENERIC_SOFT_INTERRUPTS_ALL_LEVELS to machine/types.h for
following ports:

	acorn26, amiga, hpcarm, sparc, sparc64

This was proposed by Martin Husemann at teck-kern@ in May to properly
test whether softintr can be established for all IPL, or only for
IPL_SOFT*.  OKed by acorn26, hpcarm and sparc port masters.
2003-08-06 00:43:53 +00:00
itojun 3f14c71f75 reserve cdev major # for PF. ok'ed by technical-exec 2003-07-27 14:17:57 +00:00
thorpej 063033a023 Since everyone uses clock_subr.c (or should, if they don't currently),
list it in conf/files instead of in every port's files.*.
2003-07-27 01:17:37 +00:00
lukem 1b7326b581 use __KERNEL_RCSID() in a consistent manner 2003-07-14 22:48:19 +00:00
lukem de043b8788 use __KERNEL_RCSID(0, instead of RCSID( in the kernel 2003-07-14 15:17:13 +00:00
thorpej 452a8fdae2 Rename IPL_IMP -> IPL_VM. 2003-06-16 20:00:56 +00:00
kristerw 2794d56b90 Use __asm instead of asm, to make lint happy. 2003-05-31 00:38:05 +00:00
kristerw 19827361f5 Add some LINTSTUB comments. 2003-05-31 00:36:46 +00:00
kristerw 370fc7eb10 Use __asm instead of asm, to make lint happy. 2003-05-28 21:35:13 +00:00
simonb 9c528c084a Remove definitions for fp,ip,sp,lr,pc. Stops duplicate warnings from
the assembler, identical code generated before and after.
2003-05-20 10:21:29 +00:00
wiz de87ca793d constant usually has two n. 2003-05-14 12:45:06 +00:00
thorpej 36da248c07 Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.
2003-05-10 21:10:23 +00:00
thorpej b77900c3c2 Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM.  Machine-dependent code is
responsible for initializing them before main() is called.  Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).
2003-05-08 18:13:12 +00:00
bjh21 384447456c Rename Locore.c to cpuswitch.c. The only thing it contained was cpu_switch()
and its children, and the old name caused problems when building on case-
insensitive file systems.  Should fix PR 21468 by John Gordon.
2003-05-05 22:43:38 +00:00
thorpej cdb561065e Remove some dead code from db_machine_init(). 2003-05-03 17:37:05 +00:00