freebsd-dev/sys/powerpc
Konstantin Belousov afe1a68827 Reorganize syscall entry and leave handling.
Extend struct sysvec with three new elements:
sv_fetch_syscall_args - the method to fetch syscall arguments from
  usermode into struct syscall_args. The structure is machine-depended
  (this might be reconsidered after all architectures are converted).
sv_set_syscall_retval - the method to set a return value for usermode
  from the syscall. It is a generalization of
  cpu_set_syscall_retval(9) to allow ABIs to override the way to set a
  return value.
sv_syscallnames - the table of syscall names.

Use sv_set_syscall_retval in kern_sigsuspend() instead of hardcoding
the call to cpu_set_syscall_retval().

The new functions syscallenter(9) and syscallret(9) are provided that
use sv_*syscall* pointers and contain the common repeated code from
the syscall() implementations for the architecture-specific syscall
trap handlers.

Syscallenter() fetches arguments, calls syscall implementation from
ABI sysent table, and set up return frame. The end of syscall
bookkeeping is done by syscallret().

Take advantage of single place for MI syscall handling code and
implement ptrace_lwpinfo pl_flags PL_FLAG_SCE, PL_FLAG_SCX and
PL_FLAG_EXEC. The SCE and SCX flags notify the debugger that the
thread is stopped at syscall entry or return point respectively.  The
EXEC flag augments SCX and notifies debugger that the process address
space was changed by one of exec(2)-family syscalls.

The i386, amd64, sparc64, sun4v, powerpc and ia64 syscall()s are
changed to use syscallenter()/syscallret(). MIPS and arm are not
converted and use the mostly unchanged syscall() implementation.

Reviewed by:	jhb, marcel, marius, nwhitehorn, stas
Tested by:	marcel (ia64), marius (sparc64), nwhitehorn (powerpc),
	stas (mips)
MFC after:	1 month
2010-05-23 18:32:02 +00:00
..
aim Reorganize syscall entry and leave handling. 2010-05-23 18:32:02 +00:00
booke Reorganize syscall entry and leave handling. 2010-05-23 18:32:02 +00:00
compile
conf Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had 2010-04-22 21:31:34 +00:00
cpufreq On SMP G5 systems, sometimes the power-mode-data property is only found 2010-05-16 15:21:13 +00:00
fpu The NetBSD Foundation has granted permission to remove clause 3 and 4 from 2010-03-03 17:07:02 +00:00
include Reorganize syscall entry and leave handling. 2010-05-23 18:32:02 +00:00
mpc85xx Fix an off-by-one bug for the number of slots on a PCI/PCI-X bus. 2010-03-23 23:46:28 +00:00
ofw Pull OF_quiesce() out of the MI Open Firmware layer and entirely into 2010-05-16 22:01:43 +00:00
powermac Correct a typo. 2010-05-19 01:37:47 +00:00
powerpc Reorganize syscall entry and leave handling. 2010-05-23 18:32:02 +00:00
psim Unbreak build. 2009-12-06 17:26:43 +00:00