freebsd-dev/sys/alpha/osf1
John Baldwin 78c85e8dfc Rework how we store process times in the kernel such that we always store
the raw values including for child process statistics and only compute the
system and user timevals on demand.

- Fix the various kern_wait() syscall wrappers to only pass in a rusage
  pointer if they are going to use the result.
- Add a kern_getrusage() function for the ABI syscalls to use so that they
  don't have to play stackgap games to call getrusage().
- Fix the svr4_sys_times() syscall to just call calcru() to calculate the
  times it needs rather than calling getrusage() twice with associated
  stackgap, etc.
- Add a new rusage_ext structure to store raw time stats such as tick counts
  for user, system, and interrupt time as well as a bintime of the total
  runtime.  A new p_rux field in struct proc replaces the same inline fields
  from struct proc (i.e. p_[isu]ticks, p_[isu]u, and p_runtime).  A new p_crux
  field in struct proc contains the "raw" child time usage statistics.
  ruadd() has been changed to handle adding the associated rusage_ext
  structures as well as the values in rusage.  Effectively, the values in
  rusage_ext replace the ru_utime and ru_stime values in struct rusage.  These
  two fields in struct rusage are no longer used in the kernel.
- calcru() has been split into a static worker function calcru1() that
  calculates appropriate timevals for user and system time as well as updating
  the rux_[isu]u fields of a passed in rusage_ext structure.  calcru() uses a
  copy of the process' p_rux structure to compute the timevals after updating
  the runtime appropriately if any of the threads in that process are
  currently executing.  It also now only locks sched_lock internally while
  doing the rux_runtime fixup.  calcru() now only requires the caller to
  hold the proc lock and calcru1() only requires the proc lock internally.
  calcru() also no longer allows callers to ask for an interrupt timeval
  since none of them actually did.
- calcru() now correctly handles threads executing on other CPUs.
- A new calccru() function computes the child system and user timevals by
  calling calcru1() on p_crux.  Note that this means that any code that wants
  child times must now call this function rather than reading from p_cru
  directly.  This function also requires the proc lock.
- This finishes the locking for rusage and friends so some of the Giant locks
  in exit1() and kern_wait() are now gone.
- The locking in ttyinfo() has been tweaked so that a shared lock of the
  proctree lock is used to protect the process group rather than the process
  group lock.  By holding this lock until the end of the function we now
  ensure that the process/thread that we pick to dump info about will no
  longer vanish while we are trying to output its info to the console.

Submitted by:	bde (mostly)
MFC after:	1 month
2004-10-05 18:51:11 +00:00
..
exec_ecoff.h
imgact_osf1.c
Makefile
osf1_ioctl.c Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
osf1_misc.c Rework how we store process times in the kernel such that we always store 2004-10-05 18:51:11 +00:00
osf1_mount.c Fix build on alpha 2003-11-16 21:53:05 +00:00
osf1_proto.h Regenerate after fcntl() wrappers were marked MP safe. 2004-08-24 20:24:34 +00:00
osf1_signal.c Make sigaltstack as per-threaded, because per-process sigaltstack state 2004-01-03 23:36:31 +00:00
osf1_signal.h
osf1_syscall.h Regenerate after fcntl() wrappers were marked MP safe. 2004-08-24 20:24:34 +00:00
osf1_sysent.c Regenerate after fcntl() wrappers were marked MP safe. 2004-08-24 20:24:34 +00:00
osf1_sysvec.c
osf1_util.h
osf1.h
README.mach-traps
syscalls.conf GC unused 'syshide' override to /dev/null. This was here to disable 2003-12-24 00:32:07 +00:00
syscalls.master Fix the ABI wrappers to use kern_fcntl() rather than calling fcntl() 2004-08-24 20:21:21 +00:00

$NetBSD: README.mach-traps,v 1.2 1999/03/23 09:19:25 itohy Exp $
$FreeBSD$

Some Alpha AXP OSF/1 binaries directly use the facilities provided by
the Mach kernel that is the basis for OSF/1.  These include (but are
surely not limited to) 'dd', 'ps', and 'w'.

Invariably, the symptom that these binaries display is that they crash
with an "unimplemented system call" trap (SIGSYS signal) for a syscall
that has a negative number.  In general, binaries that use the Mach
syscalls appear to invoke task_self() as their first syscall.

The name, number, and number of arguments for each Mach syscall is
given below; this information was gleaned by looking through the OSF/1
libmach.a's object files with dbx, then double-checked against the
contents of OSF/1's <mach/syscall_sw.h>.

These calls would be very difficult to implement properly in the
OSF/1 emulation code; by its very nature, NetBSD is not Mach, and we
don't and can't provide the underlying facilities that it does.

-- cgd

trap name			number	nargs	notes
---- ----			------	-----	-----
task_self			-10	0
thread_reply			-11	0
task_notify			-12	0
thread_self			-13	0
msg_send_old			-14	3
msg_receive_old			-15	3
msg_rpc_old			-16	5
msg_send_trap			-20	4
msg_receive_trap		-21	5
msg_rpc_trap			-22	6
lw_wire				-30	3
lw_unwire			-31	1
nxm_task_init			-33	2
nxm_sched_thread		-34	1
nxm_idle			-35	1
nxm_wakeup_idle			-36	1
nxm_set_pthid			-37	2
nxm_thread_kill			-38	2
nxm_thread_block		-39	1
nxm_thread_wakeup		-40	1
inode_swap_preference		-40	3	old call?
init_process			-41	0
map_fd				-43	5
nxm_resched			-44	2
htg_unix_syscall		-52	3
host_self			-55	1
host_priv_self			-56	1
swtch_pri			-59	1
swtch				-60	0
thread_switch			-61	3
semop_fast			-62	4
mach_sctimes_0			-70	0	only if MACH_SCTIMES defined
mach_sctimes_1			-71	1	only if MACH_SCTIMES defined
mach_sctimes_2			-72	2	only if MACH_SCTIMES defined
mach_sctimes_3			-73	3	only if MACH_SCTIMES defined
mach_sctimes_4			-74	4	only if MACH_SCTIMES defined
mach_sctimes_5			-75	5	only if MACH_SCTIMES defined
mach_sctimes_6			-76	6	only if MACH_SCTIMES defined
mach_sctimes_7			-77	0	only if MACH_SCTIMES defined
mach_sctimes_8			-78	6	only if MACH_SCTIMES defined
mach_sctimes_9			-79	1	only if MACH_SCTIMES defined
mach_sctimes_10			-80	2	only if MACH_SCTIMES defined
mach_sctimes_11			-81	2	only if MACH_SCTIMES defined
mach_sctimes_port_alloc_dealloc	-82	1	only if MACH_SCTIMES defined