Commit 686d8c63d530a5cfdbab2523825e37b904be56f9

Authored by Thomas Gleixner
Committed by Thomas Gleixner
1 parent e2f430291f

x86: unify include/asm/ptrace-abi_32/64.h

Aside of the register defines the content can be shared.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 4 changed files with 79 additions and 103 deletions Side-by-side Diff

include/asm-x86/Kbuild
... ... @@ -9,8 +9,6 @@
9 9 header-y += ldt.h
10 10 header-y += msr-index.h
11 11 header-y += prctl.h
12   -header-y += ptrace-abi_32.h
13   -header-y += ptrace-abi_64.h
14 12 header-y += ptrace-abi.h
15 13 header-y += sigcontext32.h
16 14 header-y += ucontext_32.h
include/asm-x86/ptrace-abi.h
1   -#ifdef __KERNEL__
2   -# ifdef CONFIG_X86_32
3   -# include "ptrace-abi_32.h"
4   -# else
5   -# include "ptrace-abi_64.h"
6   -# endif
  1 +#ifndef _ASM_X86_PTRACE_ABI_H
  2 +#define _ASM_X86_PTRACE_ABI_H
  3 +
  4 +#ifdef __i386__
  5 +
  6 +#define EBX 0
  7 +#define ECX 1
  8 +#define EDX 2
  9 +#define ESI 3
  10 +#define EDI 4
  11 +#define EBP 5
  12 +#define EAX 6
  13 +#define DS 7
  14 +#define ES 8
  15 +#define FS 9
  16 +#define GS 10
  17 +#define ORIG_EAX 11
  18 +#define EIP 12
  19 +#define CS 13
  20 +#define EFL 14
  21 +#define UESP 15
  22 +#define SS 16
  23 +#define FRAME_SIZE 17
  24 +
  25 +#else /* __i386__ */
  26 +
  27 +#if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
  28 +#define R15 0
  29 +#define R14 8
  30 +#define R13 16
  31 +#define R12 24
  32 +#define RBP 32
  33 +#define RBX 40
  34 +/* arguments: interrupts/non tracing syscalls only save upto here*/
  35 +#define R11 48
  36 +#define R10 56
  37 +#define R9 64
  38 +#define R8 72
  39 +#define RAX 80
  40 +#define RCX 88
  41 +#define RDX 96
  42 +#define RSI 104
  43 +#define RDI 112
  44 +#define ORIG_RAX 120 /* = ERROR */
  45 +/* end of arguments */
  46 +/* cpu exception frame or undefined in case of fast syscall. */
  47 +#define RIP 128
  48 +#define CS 136
  49 +#define EFLAGS 144
  50 +#define RSP 152
  51 +#define SS 160
  52 +#define ARGOFFSET R11
  53 +#endif /* __ASSEMBLY__ */
  54 +
  55 +/* top of stack page */
  56 +#define FRAME_SIZE 168
  57 +
  58 +#endif /* !__i386__ */
  59 +
  60 +/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  61 +#define PTRACE_GETREGS 12
  62 +#define PTRACE_SETREGS 13
  63 +#define PTRACE_GETFPREGS 14
  64 +#define PTRACE_SETFPREGS 15
  65 +#define PTRACE_GETFPXREGS 18
  66 +#define PTRACE_SETFPXREGS 19
  67 +
  68 +#define PTRACE_OLDSETOPTIONS 21
  69 +
  70 +/* only useful for access 32bit programs / kernels */
  71 +#define PTRACE_GET_THREAD_AREA 25
  72 +#define PTRACE_SET_THREAD_AREA 26
  73 +
  74 +#ifdef __x86_64__
  75 +# define PTRACE_ARCH_PRCTL 30
7 76 #else
8   -# ifdef __i386__
9   -# include "ptrace-abi_32.h"
10   -# else
11   -# include "ptrace-abi_64.h"
12   -# endif
  77 +# define PTRACE_SYSEMU 31
  78 +# define PTRACE_SYSEMU_SINGLESTEP 32
  79 +#endif
  80 +
13 81 #endif
include/asm-x86/ptrace-abi_32.h
1   -#ifndef I386_PTRACE_ABI_H
2   -#define I386_PTRACE_ABI_H
3   -
4   -#define EBX 0
5   -#define ECX 1
6   -#define EDX 2
7   -#define ESI 3
8   -#define EDI 4
9   -#define EBP 5
10   -#define EAX 6
11   -#define DS 7
12   -#define ES 8
13   -#define FS 9
14   -#define GS 10
15   -#define ORIG_EAX 11
16   -#define EIP 12
17   -#define CS 13
18   -#define EFL 14
19   -#define UESP 15
20   -#define SS 16
21   -#define FRAME_SIZE 17
22   -
23   -/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
24   -#define PTRACE_GETREGS 12
25   -#define PTRACE_SETREGS 13
26   -#define PTRACE_GETFPREGS 14
27   -#define PTRACE_SETFPREGS 15
28   -#define PTRACE_GETFPXREGS 18
29   -#define PTRACE_SETFPXREGS 19
30   -
31   -#define PTRACE_OLDSETOPTIONS 21
32   -
33   -#define PTRACE_GET_THREAD_AREA 25
34   -#define PTRACE_SET_THREAD_AREA 26
35   -
36   -#define PTRACE_SYSEMU 31
37   -#define PTRACE_SYSEMU_SINGLESTEP 32
38   -
39   -#endif
include/asm-x86/ptrace-abi_64.h
1   -#ifndef _X86_64_PTRACE_ABI_H
2   -#define _X86_64_PTRACE_ABI_H
3   -
4   -#if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
5   -#define R15 0
6   -#define R14 8
7   -#define R13 16
8   -#define R12 24
9   -#define RBP 32
10   -#define RBX 40
11   -/* arguments: interrupts/non tracing syscalls only save upto here*/
12   -#define R11 48
13   -#define R10 56
14   -#define R9 64
15   -#define R8 72
16   -#define RAX 80
17   -#define RCX 88
18   -#define RDX 96
19   -#define RSI 104
20   -#define RDI 112
21   -#define ORIG_RAX 120 /* = ERROR */
22   -/* end of arguments */
23   -/* cpu exception frame or undefined in case of fast syscall. */
24   -#define RIP 128
25   -#define CS 136
26   -#define EFLAGS 144
27   -#define RSP 152
28   -#define SS 160
29   -#define ARGOFFSET R11
30   -#endif /* __ASSEMBLY__ */
31   -
32   -/* top of stack page */
33   -#define FRAME_SIZE 168
34   -
35   -#define PTRACE_OLDSETOPTIONS 21
36   -
37   -/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
38   -#define PTRACE_GETREGS 12
39   -#define PTRACE_SETREGS 13
40   -#define PTRACE_GETFPREGS 14
41   -#define PTRACE_SETFPREGS 15
42   -#define PTRACE_GETFPXREGS 18
43   -#define PTRACE_SETFPXREGS 19
44   -
45   -/* only useful for access 32bit programs */
46   -#define PTRACE_GET_THREAD_AREA 25
47   -#define PTRACE_SET_THREAD_AREA 26
48   -
49   -#define PTRACE_ARCH_PRCTL 30 /* arch_prctl for child */
50   -
51   -#endif