freebsd-nq/sys/powerpc/aim
David Xu 0dbb100b9b Move UPCALL related data structure out of kse, introduce a new
data structure called kse_upcall to manage UPCALL. All KSE binding
and loaning code are gone.

A thread owns an upcall can collect all completed syscall contexts in
its ksegrp, turn itself into UPCALL mode, and takes those contexts back
to userland. Any thread without upcall structure has to export their
contexts and exit at user boundary.

Any thread running in user mode owns an upcall structure, when it enters
kernel, if the kse mailbox's current thread pointer is not NULL, then
when the thread is blocked in kernel, a new UPCALL thread is created and
the upcall structure is transfered to the new UPCALL thread. if the kse
mailbox's current thread pointer is NULL, then when a thread is blocked
in kernel, no UPCALL thread will be created.

Each upcall always has an owner thread. Userland can remove an upcall by
calling kse_exit, when all upcalls in ksegrp are removed, the group is
atomatically shutdown. An upcall owner thread also exits when process is
in exiting state. when an owner thread exits, the upcall it owns is also
removed.

KSE is a pure scheduler entity. it represents a virtual cpu. when a thread
is running, it always has a KSE associated with it. scheduler is free to
assign a KSE to thread according thread priority, if thread priority is changed,
KSE can be moved from one thread to another.

When a ksegrp is created, there is always N KSEs created in the group. the
N is the number of physical cpu in the current system. This makes it is
possible that even an userland UTS is single CPU safe, threads in kernel still
can execute on different cpu in parallel. Userland calls kse_create to add more
upcall structures into ksegrp to increase concurrent in userland itself, kernel
is not restricted by number of upcalls userland provides.

The code hasn't been tested under SMP by author due to lack of hardware.

Reviewed by: julian
2003-01-26 11:41:35 +00:00
..
clock.c Fetch the initial time from the rtc OpenFirmware node. This is a short-term 2003-01-08 12:17:44 +00:00
copyinout.c Fix incorrect error returns and sign-extension. 2003-01-08 12:19:37 +00:00
interrupt.c Be more conservative about re-enabling interrupts during trap processing 2003-01-08 12:20:46 +00:00
locore.S Remove BAT invalidation. This is done later in the boot sequence, 2003-01-22 01:47:05 +00:00
machdep.c Sync the i-cache after copying down the interrupt code 2003-01-08 12:27:47 +00:00
mmu_oea.c Move pmap_collect() out of the machine-dependent code, rename it 2002-11-13 05:39:58 +00:00
nexus.c Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
ofw_machdep.c Clear on-demand BAT entries to properly restore OpenFirmware's 2002-09-19 04:31:39 +00:00
ofwmagic.S Bring in NetBSD code used in the PowerPC port. 2001-06-10 02:39:37 +00:00
swtch.S Add the USER_SR segment register to pcb state. Initialize correctly, 2002-10-21 05:27:41 +00:00
trap_subr.S - make sure recoverable interrupts are re-enabled in the trap handler 2002-09-19 04:39:04 +00:00
trap.c Clean up ddb warnings/errors and enable in GENERIC 2002-10-04 01:19:18 +00:00
vm_machdep.c Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00