vserver 1.9.3
[linux-2.6.git] / arch / um / kernel / skas / include / ptrace-skas.h
1 /* 
2  * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3  * Licensed under the GPL
4  */
5
6 #ifndef __PTRACE_SKAS_H
7 #define __PTRACE_SKAS_H
8
9 #include "uml-config.h"
10
11 #ifdef UML_CONFIG_MODE_SKAS
12
13 /* syscall emulation path in ptrace */
14
15 #ifndef PTRACE_SYSEMU
16 #define PTRACE_SYSEMU 31
17 #endif
18
19 void set_using_sysemu(int value);
20 int get_using_sysemu(void);
21 extern int sysemu_supported;
22
23 #include "skas_ptregs.h"
24
25 #define HOST_FRAME_SIZE 17
26
27 #define REGS_IP(r) ((r)[HOST_IP])
28 #define REGS_SP(r) ((r)[HOST_SP])
29 #define REGS_EFLAGS(r) ((r)[HOST_EFLAGS])
30 #define REGS_EAX(r) ((r)[HOST_EAX])
31 #define REGS_EBX(r) ((r)[HOST_EBX])
32 #define REGS_ECX(r) ((r)[HOST_ECX])
33 #define REGS_EDX(r) ((r)[HOST_EDX])
34 #define REGS_ESI(r) ((r)[HOST_ESI])
35 #define REGS_EDI(r) ((r)[HOST_EDI])
36 #define REGS_EBP(r) ((r)[HOST_EBP])
37 #define REGS_CS(r) ((r)[HOST_CS])
38 #define REGS_SS(r) ((r)[HOST_SS])
39 #define REGS_DS(r) ((r)[HOST_DS])
40 #define REGS_ES(r) ((r)[HOST_ES])
41 #define REGS_FS(r) ((r)[HOST_FS])
42 #define REGS_GS(r) ((r)[HOST_GS])
43
44 #define REGS_SET_SYSCALL_RETURN(r, res) REGS_EAX(r) = (res)
45
46 #define REGS_RESTART_SYSCALL(r) IP_RESTART_SYSCALL(REGS_IP(r))
47
48 #define REGS_SEGV_IS_FIXABLE(r) SEGV_IS_FIXABLE((r)->trap_type)
49
50 #define REGS_FAULT_ADDR(r) ((r)->fault_addr)
51
52 #define REGS_FAULT_WRITE(r) FAULT_WRITE((r)->fault_type)
53
54 #endif
55
56 #endif
57
58 /*
59  * Overrides for Emacs so that we follow Linus's tabbing style.
60  * Emacs will notice this stuff at the end of the file and automatically
61  * adjust the settings for this buffer only.  This must remain at the end
62  * of the file.
63  * ---------------------------------------------------------------------------
64  * Local variables:
65  * c-file-style: "linux"
66  * End:
67  */