freebsd-skq/sys/i386/linux
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
..
imgact_linux.c VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in 2008-01-13 14:44:15 +00:00
linux_dummy.c Implement robust futexes. Most of the code is modelled after 2008-05-13 20:01:27 +00:00
linux_genassym.c Segment registers are stored in the uc_mcontext member of the struct 2008-09-07 16:39:21 +00:00
linux_ipc64.h
linux_locore.s Change some movl's to mov's. Newer GAS no longer accept 'movl' instructions 2009-01-31 11:37:21 +00:00
linux_machdep.c Fix some problems with effective mmap() offsets > 32 bits. This was 2009-10-28 20:17:54 +00:00
linux_proto.h As jhb@ pointed out to me, r197057 was incorrect, not least because these 2009-09-10 13:20:27 +00:00
linux_ptrace.c - Move all of the PS_ flags into either p_flag or td_flags. 2007-09-17 05:31:39 +00:00
linux_support.s Move futex support code from <arch>/support.s into linux compat directory. 2007-05-23 08:33:06 +00:00
linux_syscall.h Regenerate system call tables for r184789. 2008-11-09 10:48:06 +00:00
linux_sysent.c Regenerate generated syscall files following changes to struct sysent in 2009-06-01 16:14:38 +00:00
linux_sysvec.c Reorganize syscall entry and leave handling. 2010-05-23 18:32:02 +00:00
linux.h Rename st_*timespec fields to st_*tim for POSIX 2008 compliance. 2010-03-28 13:13:22 +00:00
Makefile
syscalls.conf - Remove unused sysvec variables from various syscalls.conf. 2006-08-15 17:25:55 +00:00
syscalls.master Mark uname(), getdomainname() and setdomainname() with COMPAT_FREEBSD4. 2008-11-09 10:45:13 +00:00