freebsd-dev/sys/mips/mips
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
..
autoconf.c o) Eliminate the "stand" frame and its use. Use CALLFRAME_* everywhere. 2010-04-19 07:34:26 +00:00
bus_space_generic.c Various fixes to get the SWARM config working on a big-endian Sibyte CPU. 2010-02-17 06:43:37 +00:00
busdma_machdep.c Fix a bug where bus_dma_load_xxx() would not bounce misaligned buffers 2010-04-09 01:14:11 +00:00
cache_mipsNN.c Merge from projects/mips to head by hand: 2010-01-10 20:29:20 +00:00
cache.c Merge from projects/mips to head by hand: 2010-01-10 20:29:20 +00:00
cpu.c This pushes all of JC's patches that I have in place. I 2010-05-16 19:43:48 +00:00
db_disasm.c
db_interface.c Turns out this code was right, revert last change. 2009-07-08 06:00:18 +00:00
db_trace.c - Adjust the whitespace for the lines that output fields in 'show pcpu' in 2010-05-21 17:17:56 +00:00
dump_machdep.c Fix copyrights to reflect the origin of these files. 2009-06-29 16:45:50 +00:00
elf64_machdep.c Reorganize syscall entry and leave handling. 2010-05-23 18:32:02 +00:00
elf_machdep.c Reorganize syscall entry and leave handling. 2010-05-23 18:32:02 +00:00
elf_trampoline.c Use proper structure type for 64-bit headers 2010-02-18 19:02:33 +00:00
exception.S Build some nops into CLEAR_STATUS here to make sure that the following 2010-04-23 19:48:31 +00:00
fp.S o) Eliminate the "stand" frame and its use. Use CALLFRAME_* everywhere. 2010-04-19 07:34:26 +00:00
gdb_machdep.c Merge from projects/mips to head by hand: 2010-01-10 20:29:20 +00:00
genassym.c o) Fix XKPHYS physical address extraction. Also define cache coherency 2010-04-19 06:01:58 +00:00
in_cksum.c Merge from projects/mips to head by hand: 2010-01-10 20:29:20 +00:00
inckern.S - Revert changes accidentally killed by merge operation 2009-04-14 22:53:22 +00:00
intr_machdep.c SMP support for the mips port. 2010-02-09 06:24:43 +00:00
locore.S o) Add NPDEPG, like NPTEPG but for PDEs. 2010-04-17 07:20:01 +00:00
machdep.c This pushes all of JC's patches that I have in place. I 2010-05-16 19:43:48 +00:00
mainbus.c Merge from projects/mips to head by hand: 2010-01-10 20:29:20 +00:00
mem.c o) Back out my previous change to SWARM; some of it was to address an issue 2010-04-17 01:49:50 +00:00
mp_machdep.c Adds JC's cleanup patches that fix it so 2010-05-18 04:02:34 +00:00
mpboot.S Adds JC's cleanup patches that fix it so 2010-05-18 04:02:34 +00:00
nexus.c o) Use inline functions to access coprocessor 0 registers rather than external 2010-04-17 01:17:31 +00:00
pm_machdep.c Change the arguments of exec_setregs() so that it receives a pointer 2010-03-25 14:24:00 +00:00
pmap.c - Use ptpgzone zone to allocate page table pages irrespective of the amount of 2010-05-22 21:38:57 +00:00
psraccess.S o) Use inline functions to access coprocessor 0 registers rather than external 2010-04-17 01:17:31 +00:00
ptrace_machdep.c Place holder ptrace mips module. Not entirely sure what's required 2009-12-17 23:55:49 +00:00
stack_machdep.c
support.S o) Make pcb_onfault a pointer rather than an obscure integer value. 2010-04-17 09:42:07 +00:00
swtch.S o) Eliminate the "stand" frame and its use. Use CALLFRAME_* everywhere. 2010-04-19 07:34:26 +00:00
sys_machdep.c - Add support for handling TLS area address in kernel space. 2009-06-27 23:27:41 +00:00
tick.c Fix compilation error. 2010-04-23 01:34:01 +00:00
tlb.S o) Add NPDEPG, like NPTEPG but for PDEs. 2010-04-17 07:20:01 +00:00
trap.c Reorganize syscall entry and leave handling. 2010-05-23 18:32:02 +00:00
uio_machdep.c o) Use the direct map where possible for uiomove_fromphys, based on code from 2010-04-16 23:48:28 +00:00
vm_machdep.c o) Eliminate the "stand" frame and its use. Use CALLFRAME_* everywhere. 2010-04-19 07:34:26 +00:00