freebsd-dev/sys/sparc64/sparc64
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
..
autoconf.c Run configure at SI_SUB_THIRD instead of SI_SUB_ANY like other 2002-11-18 03:28:23 +00:00
bus_machdep.c Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
cache.c - Reorganize PMAP_STATS to scale a little better. 2003-01-05 05:30:40 +00:00
clock.c
counter.c Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
critical.c
db_disasm.c The abs() function isn't defined locally; include a header file that 2003-01-16 08:53:03 +00:00
db_hwwatch.c
db_interface.c
db_trace.c
dump_machdep.c - Use direct mapped addresses for the message buffer, for the crash dump 2002-12-27 01:50:29 +00:00
eeprom_ebus.c
eeprom_sbus.c
eeprom.c
elf_machdep.c Resolve relative relocations in klds before trying to parse the module's 2003-01-21 02:42:44 +00:00
exception.S Merge some code paths back together so that we only instantiate 1 copy of 2003-01-26 03:38:30 +00:00
genassym.c Forgot this file in previous commit. 2002-12-28 23:58:18 +00:00
identcpu.c
in_cksum.c
interrupt.S Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup, 2003-01-01 18:49:04 +00:00
intr_machdep.c
iommu.c Fixes for a number of problems in the IOMMU code: 2003-01-21 18:22:26 +00:00
locore.S
machdep.c Don't allow user process to set an invalid window state through sigreturn. 2003-01-10 00:04:56 +00:00
mem.c Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
mp_exception.S Use the meaningful mnemonics for ancillary state registers now that gas 2002-12-29 00:23:48 +00:00
mp_locore.S
mp_machdep.c - Add a spin lock to single thread cache invalidation and tlb flush ipis, 2002-12-22 20:50:23 +00:00
nexus.c Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
ofw_bus.c Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
ofw_machdep.c
pmap.c - Reorganize PMAP_STATS to scale a little better. 2003-01-05 05:30:40 +00:00
prof_machdep.c
rwindow.c
sparcbus_if.m
support.S
swtch.S
sys_machdep.c Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. 2003-01-21 08:56:16 +00:00
tick.c
tlb.c - Reorganize PMAP_STATS to scale a little better. 2003-01-05 05:30:40 +00:00
trap.c Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00
tsb.c - Reorganize PMAP_STATS to scale a little better. 2003-01-05 05:30:40 +00:00
upa.c
vm_machdep.c Move UPCALL related data structure out of kse, introduce a new 2003-01-26 11:41:35 +00:00