• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Linux-specific definitions: */
2 
3 /* Define various structure offsets to simplify cross-compilation.  */
4 
5 /* FIXME: Currently these are only used in getcontext.S, which is only used
6    for a local unwinder, so we can use the compile-time ABI.  At a later date
7    we will want all three here, to use for signal handlers.  Also, because
8    of the three ABIs, gen-offsets.c can not quite generate this file.  */
9 
10 /* Offsets for MIPS Linux "ucontext_t":  */
11 
12 /* First 24 bytes in sigframe are argument save space and padding for
13 what used to be signal trampolines. Ref: arch/mips/kernel/signal.c */
14 #define LINUX_SF_TRAMP_SIZE 0x18
15 
16 #if _MIPS_SIM == _ABIO32
17 
18 # define LINUX_UC_FLAGS_OFF     0x0
19 # define LINUX_UC_LINK_OFF      0x4
20 # define LINUX_UC_STACK_OFF     0x8
21 # define LINUX_UC_MCONTEXT_OFF  0x18
22 # define LINUX_UC_SIGMASK_OFF   0x268
23 # define LINUX_UC_MCONTEXT_PC   0x20
24 # define LINUX_UC_MCONTEXT_GREGS        0x28
25 
26 #elif _MIPS_SIM == _ABIN32
27 
28 # define LINUX_UC_FLAGS_OFF     0x0
29 # define LINUX_UC_LINK_OFF      0x4
30 # define LINUX_UC_STACK_OFF     0x8
31 # define LINUX_UC_MCONTEXT_OFF  0x18
32 # define LINUX_UC_SIGMASK_OFF   0x270
33 # define LINUX_UC_MCONTEXT_PC   0x258
34 # define LINUX_UC_MCONTEXT_GREGS        0x18
35 
36 #elif _MIPS_SIM == _ABI64
37 
38 # define LINUX_UC_FLAGS_OFF     0x0
39 # define LINUX_UC_LINK_OFF      0x8
40 # define LINUX_UC_STACK_OFF     0x10
41 # define LINUX_UC_MCONTEXT_OFF  0x28
42 # define LINUX_UC_SIGMASK_OFF   0x280
43 # define LINUX_UC_MCONTEXT_PC   0x268
44 # define LINUX_UC_MCONTEXT_GREGS        0x28
45 
46 #else
47 
48 #error Unsupported ABI
49 
50 #endif
51 
52 #define LINUX_SC_R0_OFF   (LINUX_UC_MCONTEXT_GREGS - LINUX_UC_MCONTEXT_OFF)
53 #define LINUX_SC_R1_OFF   (LINUX_SC_R0_OFF + 1*8)
54 #define LINUX_SC_R2_OFF   (LINUX_SC_R0_OFF + 2*8)
55 #define LINUX_SC_R3_OFF   (LINUX_SC_R0_OFF + 3*8)
56 #define LINUX_SC_R4_OFF   (LINUX_SC_R0_OFF + 4*8)
57 #define LINUX_SC_R5_OFF   (LINUX_SC_R0_OFF + 5*8)
58 #define LINUX_SC_R6_OFF   (LINUX_SC_R0_OFF + 6*8)
59 #define LINUX_SC_R7_OFF   (LINUX_SC_R0_OFF + 7*8)
60 #define LINUX_SC_R8_OFF   (LINUX_SC_R0_OFF + 8*8)
61 #define LINUX_SC_R9_OFF   (LINUX_SC_R0_OFF + 9*8)
62 #define LINUX_SC_R10_OFF  (LINUX_SC_R0_OFF + 10*8)
63 #define LINUX_SC_R11_OFF  (LINUX_SC_R0_OFF + 11*8)
64 #define LINUX_SC_R12_OFF  (LINUX_SC_R0_OFF + 12*8)
65 #define LINUX_SC_R13_OFF  (LINUX_SC_R0_OFF + 13*8)
66 #define LINUX_SC_R14_OFF  (LINUX_SC_R0_OFF + 14*8)
67 #define LINUX_SC_R15_OFF  (LINUX_SC_R0_OFF + 15*8)
68 #define LINUX_SC_R16_OFF  (LINUX_SC_R0_OFF + 16*8)
69 #define LINUX_SC_R17_OFF  (LINUX_SC_R0_OFF + 17*8)
70 #define LINUX_SC_R18_OFF  (LINUX_SC_R0_OFF + 18*8)
71 #define LINUX_SC_R19_OFF  (LINUX_SC_R0_OFF + 19*8)
72 #define LINUX_SC_R20_OFF  (LINUX_SC_R0_OFF + 20*8)
73 #define LINUX_SC_R21_OFF  (LINUX_SC_R0_OFF + 21*8)
74 #define LINUX_SC_R22_OFF  (LINUX_SC_R0_OFF + 22*8)
75 #define LINUX_SC_R23_OFF  (LINUX_SC_R0_OFF + 23*8)
76 #define LINUX_SC_R24_OFF  (LINUX_SC_R0_OFF + 24*8)
77 #define LINUX_SC_R25_OFF  (LINUX_SC_R0_OFF + 25*8)
78 #define LINUX_SC_R26_OFF  (LINUX_SC_R0_OFF + 26*8)
79 #define LINUX_SC_R27_OFF  (LINUX_SC_R0_OFF + 27*8)
80 #define LINUX_SC_R28_OFF  (LINUX_SC_R0_OFF + 28*8)
81 #define LINUX_SC_R29_OFF  (LINUX_SC_R0_OFF + 29*8)
82 #define LINUX_SC_R30_OFF  (LINUX_SC_R0_OFF + 30*8)
83 #define LINUX_SC_R31_OFF  (LINUX_SC_R0_OFF + 31*8)
84 
85 #define LINUX_SC_SP_OFF   LINUX_SC_R29_OFF
86 #define LINUX_SC_PC_OFF   (LINUX_UC_MCONTEXT_PC - LINUX_UC_MCONTEXT_OFF)
87