Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * offset.c: Calculate pt_regs and task_struct offsets. |
| 3 | * |
| 4 | * Copyright (C) 1996 David S. Miller |
| 5 | * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Ralf Baechle |
| 6 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. |
| 7 | * |
| 8 | * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com |
| 9 | * Copyright (C) 2000 MIPS Technologies, Inc. |
| 10 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #include <linux/compat.h> |
| 12 | #include <linux/types.h> |
| 13 | #include <linux/sched.h> |
| 14 | #include <linux/mm.h> |
| 15 | #include <linux/interrupt.h> |
| 16 | |
| 17 | #include <asm/ptrace.h> |
| 18 | #include <asm/processor.h> |
| 19 | |
| 20 | #define text(t) __asm__("\n@@@" t) |
| 21 | #define _offset(type, member) (&(((type *)NULL)->member)) |
| 22 | #define offset(string, ptr, member) \ |
| 23 | __asm__("\n@@@" string "%0" : : "i" (_offset(ptr, member))) |
| 24 | #define constant(string, member) \ |
Ralf Baechle | 242954b | 2006-10-24 02:29:01 +0100 | [diff] [blame] | 25 | __asm__("\n@@@" string "%X0" : : "ri" (member)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | #define size(string, size) \ |
| 27 | __asm__("\n@@@" string "%0" : : "i" (sizeof(size))) |
| 28 | #define linefeed text("") |
| 29 | |
| 30 | void output_ptreg_defines(void) |
| 31 | { |
| 32 | text("/* MIPS pt_regs offsets. */"); |
| 33 | offset("#define PT_R0 ", struct pt_regs, regs[0]); |
| 34 | offset("#define PT_R1 ", struct pt_regs, regs[1]); |
| 35 | offset("#define PT_R2 ", struct pt_regs, regs[2]); |
| 36 | offset("#define PT_R3 ", struct pt_regs, regs[3]); |
| 37 | offset("#define PT_R4 ", struct pt_regs, regs[4]); |
| 38 | offset("#define PT_R5 ", struct pt_regs, regs[5]); |
| 39 | offset("#define PT_R6 ", struct pt_regs, regs[6]); |
| 40 | offset("#define PT_R7 ", struct pt_regs, regs[7]); |
| 41 | offset("#define PT_R8 ", struct pt_regs, regs[8]); |
| 42 | offset("#define PT_R9 ", struct pt_regs, regs[9]); |
| 43 | offset("#define PT_R10 ", struct pt_regs, regs[10]); |
| 44 | offset("#define PT_R11 ", struct pt_regs, regs[11]); |
| 45 | offset("#define PT_R12 ", struct pt_regs, regs[12]); |
| 46 | offset("#define PT_R13 ", struct pt_regs, regs[13]); |
| 47 | offset("#define PT_R14 ", struct pt_regs, regs[14]); |
| 48 | offset("#define PT_R15 ", struct pt_regs, regs[15]); |
| 49 | offset("#define PT_R16 ", struct pt_regs, regs[16]); |
| 50 | offset("#define PT_R17 ", struct pt_regs, regs[17]); |
| 51 | offset("#define PT_R18 ", struct pt_regs, regs[18]); |
| 52 | offset("#define PT_R19 ", struct pt_regs, regs[19]); |
| 53 | offset("#define PT_R20 ", struct pt_regs, regs[20]); |
| 54 | offset("#define PT_R21 ", struct pt_regs, regs[21]); |
| 55 | offset("#define PT_R22 ", struct pt_regs, regs[22]); |
| 56 | offset("#define PT_R23 ", struct pt_regs, regs[23]); |
| 57 | offset("#define PT_R24 ", struct pt_regs, regs[24]); |
| 58 | offset("#define PT_R25 ", struct pt_regs, regs[25]); |
| 59 | offset("#define PT_R26 ", struct pt_regs, regs[26]); |
| 60 | offset("#define PT_R27 ", struct pt_regs, regs[27]); |
| 61 | offset("#define PT_R28 ", struct pt_regs, regs[28]); |
| 62 | offset("#define PT_R29 ", struct pt_regs, regs[29]); |
| 63 | offset("#define PT_R30 ", struct pt_regs, regs[30]); |
| 64 | offset("#define PT_R31 ", struct pt_regs, regs[31]); |
| 65 | offset("#define PT_LO ", struct pt_regs, lo); |
| 66 | offset("#define PT_HI ", struct pt_regs, hi); |
Franck Bui-Huu | 9693a85 | 2007-02-02 17:41:47 +0100 | [diff] [blame^] | 67 | #ifdef CONFIG_CPU_HAS_SMARTMIPS |
| 68 | offset("#define PT_ACX ", struct pt_regs, acx); |
| 69 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | offset("#define PT_EPC ", struct pt_regs, cp0_epc); |
| 71 | offset("#define PT_BVADDR ", struct pt_regs, cp0_badvaddr); |
| 72 | offset("#define PT_STATUS ", struct pt_regs, cp0_status); |
| 73 | offset("#define PT_CAUSE ", struct pt_regs, cp0_cause); |
Ralf Baechle | 41c594a | 2006-04-05 09:45:45 +0100 | [diff] [blame] | 74 | #ifdef CONFIG_MIPS_MT_SMTC |
| 75 | offset("#define PT_TCSTATUS ", struct pt_regs, cp0_tcstatus); |
| 76 | #endif /* CONFIG_MIPS_MT_SMTC */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | size("#define PT_SIZE ", struct pt_regs); |
| 78 | linefeed; |
| 79 | } |
| 80 | |
| 81 | void output_task_defines(void) |
| 82 | { |
| 83 | text("/* MIPS task_struct offsets. */"); |
| 84 | offset("#define TASK_STATE ", struct task_struct, state); |
| 85 | offset("#define TASK_THREAD_INFO ", struct task_struct, thread_info); |
| 86 | offset("#define TASK_FLAGS ", struct task_struct, flags); |
| 87 | offset("#define TASK_MM ", struct task_struct, mm); |
| 88 | offset("#define TASK_PID ", struct task_struct, pid); |
| 89 | size( "#define TASK_STRUCT_SIZE ", struct task_struct); |
| 90 | linefeed; |
| 91 | } |
| 92 | |
| 93 | void output_thread_info_defines(void) |
| 94 | { |
| 95 | text("/* MIPS thread_info offsets. */"); |
| 96 | offset("#define TI_TASK ", struct thread_info, task); |
| 97 | offset("#define TI_EXEC_DOMAIN ", struct thread_info, exec_domain); |
| 98 | offset("#define TI_FLAGS ", struct thread_info, flags); |
Ralf Baechle | 937a801 | 2006-10-07 19:44:33 +0100 | [diff] [blame] | 99 | offset("#define TI_TP_VALUE ", struct thread_info, tp_value); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | offset("#define TI_CPU ", struct thread_info, cpu); |
| 101 | offset("#define TI_PRE_COUNT ", struct thread_info, preempt_count); |
| 102 | offset("#define TI_ADDR_LIMIT ", struct thread_info, addr_limit); |
| 103 | offset("#define TI_RESTART_BLOCK ", struct thread_info, restart_block); |
Ralf Baechle | 937a801 | 2006-10-07 19:44:33 +0100 | [diff] [blame] | 104 | offset("#define TI_REGS ", struct thread_info, regs); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 105 | constant("#define _THREAD_SIZE_ORDER ", THREAD_SIZE_ORDER); |
| 106 | constant("#define _THREAD_SIZE ", THREAD_SIZE); |
| 107 | constant("#define _THREAD_MASK ", THREAD_MASK); |
| 108 | linefeed; |
| 109 | } |
| 110 | |
| 111 | void output_thread_defines(void) |
| 112 | { |
| 113 | text("/* MIPS specific thread_struct offsets. */"); |
| 114 | offset("#define THREAD_REG16 ", struct task_struct, thread.reg16); |
| 115 | offset("#define THREAD_REG17 ", struct task_struct, thread.reg17); |
| 116 | offset("#define THREAD_REG18 ", struct task_struct, thread.reg18); |
| 117 | offset("#define THREAD_REG19 ", struct task_struct, thread.reg19); |
| 118 | offset("#define THREAD_REG20 ", struct task_struct, thread.reg20); |
| 119 | offset("#define THREAD_REG21 ", struct task_struct, thread.reg21); |
| 120 | offset("#define THREAD_REG22 ", struct task_struct, thread.reg22); |
| 121 | offset("#define THREAD_REG23 ", struct task_struct, thread.reg23); |
| 122 | offset("#define THREAD_REG29 ", struct task_struct, thread.reg29); |
| 123 | offset("#define THREAD_REG30 ", struct task_struct, thread.reg30); |
| 124 | offset("#define THREAD_REG31 ", struct task_struct, thread.reg31); |
| 125 | offset("#define THREAD_STATUS ", struct task_struct, |
| 126 | thread.cp0_status); |
| 127 | offset("#define THREAD_FPU ", struct task_struct, thread.fpu); |
| 128 | |
| 129 | offset("#define THREAD_BVADDR ", struct task_struct, \ |
| 130 | thread.cp0_badvaddr); |
| 131 | offset("#define THREAD_BUADDR ", struct task_struct, \ |
| 132 | thread.cp0_baduaddr); |
| 133 | offset("#define THREAD_ECODE ", struct task_struct, \ |
| 134 | thread.error_code); |
| 135 | offset("#define THREAD_TRAPNO ", struct task_struct, thread.trap_no); |
| 136 | offset("#define THREAD_MFLAGS ", struct task_struct, thread.mflags); |
| 137 | offset("#define THREAD_TRAMP ", struct task_struct, \ |
| 138 | thread.irix_trampoline); |
| 139 | offset("#define THREAD_OLDCTX ", struct task_struct, \ |
| 140 | thread.irix_oldctx); |
| 141 | linefeed; |
| 142 | } |
| 143 | |
| 144 | void output_thread_fpu_defines(void) |
| 145 | { |
| 146 | offset("#define THREAD_FPR0 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 147 | struct task_struct, thread.fpu.fpr[0]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | offset("#define THREAD_FPR1 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 149 | struct task_struct, thread.fpu.fpr[1]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 150 | offset("#define THREAD_FPR2 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 151 | struct task_struct, thread.fpu.fpr[2]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | offset("#define THREAD_FPR3 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 153 | struct task_struct, thread.fpu.fpr[3]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | offset("#define THREAD_FPR4 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 155 | struct task_struct, thread.fpu.fpr[4]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 156 | offset("#define THREAD_FPR5 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 157 | struct task_struct, thread.fpu.fpr[5]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 158 | offset("#define THREAD_FPR6 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 159 | struct task_struct, thread.fpu.fpr[6]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 160 | offset("#define THREAD_FPR7 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 161 | struct task_struct, thread.fpu.fpr[7]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | offset("#define THREAD_FPR8 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 163 | struct task_struct, thread.fpu.fpr[8]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 164 | offset("#define THREAD_FPR9 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 165 | struct task_struct, thread.fpu.fpr[9]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | offset("#define THREAD_FPR10 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 167 | struct task_struct, thread.fpu.fpr[10]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | offset("#define THREAD_FPR11 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 169 | struct task_struct, thread.fpu.fpr[11]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | offset("#define THREAD_FPR12 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 171 | struct task_struct, thread.fpu.fpr[12]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | offset("#define THREAD_FPR13 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 173 | struct task_struct, thread.fpu.fpr[13]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 174 | offset("#define THREAD_FPR14 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 175 | struct task_struct, thread.fpu.fpr[14]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | offset("#define THREAD_FPR15 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 177 | struct task_struct, thread.fpu.fpr[15]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | offset("#define THREAD_FPR16 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 179 | struct task_struct, thread.fpu.fpr[16]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | offset("#define THREAD_FPR17 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 181 | struct task_struct, thread.fpu.fpr[17]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 182 | offset("#define THREAD_FPR18 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 183 | struct task_struct, thread.fpu.fpr[18]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | offset("#define THREAD_FPR19 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 185 | struct task_struct, thread.fpu.fpr[19]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 186 | offset("#define THREAD_FPR20 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 187 | struct task_struct, thread.fpu.fpr[20]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | offset("#define THREAD_FPR21 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 189 | struct task_struct, thread.fpu.fpr[21]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | offset("#define THREAD_FPR22 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 191 | struct task_struct, thread.fpu.fpr[22]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 192 | offset("#define THREAD_FPR23 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 193 | struct task_struct, thread.fpu.fpr[23]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 194 | offset("#define THREAD_FPR24 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 195 | struct task_struct, thread.fpu.fpr[24]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 196 | offset("#define THREAD_FPR25 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 197 | struct task_struct, thread.fpu.fpr[25]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 198 | offset("#define THREAD_FPR26 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 199 | struct task_struct, thread.fpu.fpr[26]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 200 | offset("#define THREAD_FPR27 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 201 | struct task_struct, thread.fpu.fpr[27]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 202 | offset("#define THREAD_FPR28 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 203 | struct task_struct, thread.fpu.fpr[28]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | offset("#define THREAD_FPR29 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 205 | struct task_struct, thread.fpu.fpr[29]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 206 | offset("#define THREAD_FPR30 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 207 | struct task_struct, thread.fpu.fpr[30]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 208 | offset("#define THREAD_FPR31 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 209 | struct task_struct, thread.fpu.fpr[31]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | |
| 211 | offset("#define THREAD_FCR31 ", |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 212 | struct task_struct, thread.fpu.fcr31); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 213 | linefeed; |
| 214 | } |
| 215 | |
| 216 | void output_mm_defines(void) |
| 217 | { |
| 218 | text("/* Size of struct page */"); |
| 219 | size("#define STRUCT_PAGE_SIZE ", struct page); |
| 220 | linefeed; |
| 221 | text("/* Linux mm_struct offsets. */"); |
| 222 | offset("#define MM_USERS ", struct mm_struct, mm_users); |
| 223 | offset("#define MM_PGD ", struct mm_struct, pgd); |
| 224 | offset("#define MM_CONTEXT ", struct mm_struct, context); |
| 225 | linefeed; |
| 226 | constant("#define _PAGE_SIZE ", PAGE_SIZE); |
| 227 | constant("#define _PAGE_SHIFT ", PAGE_SHIFT); |
| 228 | linefeed; |
| 229 | constant("#define _PGD_T_SIZE ", sizeof(pgd_t)); |
| 230 | constant("#define _PMD_T_SIZE ", sizeof(pmd_t)); |
| 231 | constant("#define _PTE_T_SIZE ", sizeof(pte_t)); |
| 232 | linefeed; |
| 233 | constant("#define _PGD_T_LOG2 ", PGD_T_LOG2); |
| 234 | constant("#define _PMD_T_LOG2 ", PMD_T_LOG2); |
| 235 | constant("#define _PTE_T_LOG2 ", PTE_T_LOG2); |
| 236 | linefeed; |
| 237 | constant("#define _PMD_SHIFT ", PMD_SHIFT); |
| 238 | constant("#define _PGDIR_SHIFT ", PGDIR_SHIFT); |
| 239 | linefeed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | constant("#define _PTRS_PER_PGD ", PTRS_PER_PGD); |
| 241 | constant("#define _PTRS_PER_PMD ", PTRS_PER_PMD); |
| 242 | constant("#define _PTRS_PER_PTE ", PTRS_PER_PTE); |
| 243 | linefeed; |
| 244 | } |
| 245 | |
Ralf Baechle | e50c0a8 | 2005-05-31 11:49:19 +0000 | [diff] [blame] | 246 | #ifdef CONFIG_32BIT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | void output_sc_defines(void) |
| 248 | { |
| 249 | text("/* Linux sigcontext offsets. */"); |
| 250 | offset("#define SC_REGS ", struct sigcontext, sc_regs); |
| 251 | offset("#define SC_FPREGS ", struct sigcontext, sc_fpregs); |
Franck Bui-Huu | 9693a85 | 2007-02-02 17:41:47 +0100 | [diff] [blame^] | 252 | offset("#define SC_ACX ", struct sigcontext, sc_acx); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | offset("#define SC_MDHI ", struct sigcontext, sc_mdhi); |
| 254 | offset("#define SC_MDLO ", struct sigcontext, sc_mdlo); |
| 255 | offset("#define SC_PC ", struct sigcontext, sc_pc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr); |
| 257 | offset("#define SC_FPC_EIR ", struct sigcontext, sc_fpc_eir); |
Ralf Baechle | e50c0a8 | 2005-05-31 11:49:19 +0000 | [diff] [blame] | 258 | offset("#define SC_HI1 ", struct sigcontext, sc_hi1); |
| 259 | offset("#define SC_LO1 ", struct sigcontext, sc_lo1); |
| 260 | offset("#define SC_HI2 ", struct sigcontext, sc_hi2); |
| 261 | offset("#define SC_LO2 ", struct sigcontext, sc_lo2); |
| 262 | offset("#define SC_HI3 ", struct sigcontext, sc_hi3); |
| 263 | offset("#define SC_LO3 ", struct sigcontext, sc_lo3); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 264 | linefeed; |
| 265 | } |
Ralf Baechle | e50c0a8 | 2005-05-31 11:49:19 +0000 | [diff] [blame] | 266 | #endif |
| 267 | |
| 268 | #ifdef CONFIG_64BIT |
| 269 | void output_sc_defines(void) |
| 270 | { |
| 271 | text("/* Linux sigcontext offsets. */"); |
| 272 | offset("#define SC_REGS ", struct sigcontext, sc_regs); |
| 273 | offset("#define SC_FPREGS ", struct sigcontext, sc_fpregs); |
Daniel Jacobowitz | 1c0c1ae | 2006-05-08 15:28:22 -0400 | [diff] [blame] | 274 | offset("#define SC_MDHI ", struct sigcontext, sc_mdhi); |
| 275 | offset("#define SC_MDLO ", struct sigcontext, sc_mdlo); |
Ralf Baechle | e50c0a8 | 2005-05-31 11:49:19 +0000 | [diff] [blame] | 276 | offset("#define SC_PC ", struct sigcontext, sc_pc); |
| 277 | offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr); |
| 278 | linefeed; |
| 279 | } |
| 280 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 281 | |
| 282 | #ifdef CONFIG_MIPS32_COMPAT |
| 283 | void output_sc32_defines(void) |
| 284 | { |
| 285 | text("/* Linux 32-bit sigcontext offsets. */"); |
| 286 | offset("#define SC32_FPREGS ", struct sigcontext32, sc_fpregs); |
| 287 | offset("#define SC32_FPC_CSR ", struct sigcontext32, sc_fpc_csr); |
| 288 | offset("#define SC32_FPC_EIR ", struct sigcontext32, sc_fpc_eir); |
| 289 | linefeed; |
| 290 | } |
| 291 | #endif |
| 292 | |
| 293 | void output_signal_defined(void) |
| 294 | { |
| 295 | text("/* Linux signal numbers. */"); |
| 296 | constant("#define _SIGHUP ", SIGHUP); |
| 297 | constant("#define _SIGINT ", SIGINT); |
| 298 | constant("#define _SIGQUIT ", SIGQUIT); |
| 299 | constant("#define _SIGILL ", SIGILL); |
| 300 | constant("#define _SIGTRAP ", SIGTRAP); |
| 301 | constant("#define _SIGIOT ", SIGIOT); |
| 302 | constant("#define _SIGABRT ", SIGABRT); |
| 303 | constant("#define _SIGEMT ", SIGEMT); |
| 304 | constant("#define _SIGFPE ", SIGFPE); |
| 305 | constant("#define _SIGKILL ", SIGKILL); |
| 306 | constant("#define _SIGBUS ", SIGBUS); |
| 307 | constant("#define _SIGSEGV ", SIGSEGV); |
| 308 | constant("#define _SIGSYS ", SIGSYS); |
| 309 | constant("#define _SIGPIPE ", SIGPIPE); |
| 310 | constant("#define _SIGALRM ", SIGALRM); |
| 311 | constant("#define _SIGTERM ", SIGTERM); |
| 312 | constant("#define _SIGUSR1 ", SIGUSR1); |
| 313 | constant("#define _SIGUSR2 ", SIGUSR2); |
| 314 | constant("#define _SIGCHLD ", SIGCHLD); |
| 315 | constant("#define _SIGPWR ", SIGPWR); |
| 316 | constant("#define _SIGWINCH ", SIGWINCH); |
| 317 | constant("#define _SIGURG ", SIGURG); |
| 318 | constant("#define _SIGIO ", SIGIO); |
| 319 | constant("#define _SIGSTOP ", SIGSTOP); |
| 320 | constant("#define _SIGTSTP ", SIGTSTP); |
| 321 | constant("#define _SIGCONT ", SIGCONT); |
| 322 | constant("#define _SIGTTIN ", SIGTTIN); |
| 323 | constant("#define _SIGTTOU ", SIGTTOU); |
| 324 | constant("#define _SIGVTALRM ", SIGVTALRM); |
| 325 | constant("#define _SIGPROF ", SIGPROF); |
| 326 | constant("#define _SIGXCPU ", SIGXCPU); |
| 327 | constant("#define _SIGXFSZ ", SIGXFSZ); |
| 328 | linefeed; |
| 329 | } |
| 330 | |
| 331 | void output_irq_cpustat_t_defines(void) |
| 332 | { |
| 333 | text("/* Linux irq_cpustat_t offsets. */"); |
| 334 | offset("#define IC_SOFTIRQ_PENDING ", irq_cpustat_t, __softirq_pending); |
| 335 | size("#define IC_IRQ_CPUSTAT_T ", irq_cpustat_t); |
| 336 | linefeed; |
| 337 | } |