xref: /openbmc/linux/arch/mips/kernel/asm-offsets.c (revision e0d77d0f38aa60ca61b3ce6e60d64fad2aa0853d)
1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
2e6c69bd3SSam Ravnborg /*
35f7e6310SRalf Baechle  * asm-offsets.c: Calculate pt_regs and task_struct offsets.
4e6c69bd3SSam Ravnborg  *
5e6c69bd3SSam Ravnborg  * Copyright (C) 1996 David S. Miller
6e6c69bd3SSam Ravnborg  * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Ralf Baechle
7e6c69bd3SSam Ravnborg  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8e6c69bd3SSam Ravnborg  *
9e6c69bd3SSam Ravnborg  * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
10e6c69bd3SSam Ravnborg  * Copyright (C) 2000 MIPS Technologies, Inc.
11e6c69bd3SSam Ravnborg  */
12e6c69bd3SSam Ravnborg #include <linux/compat.h>
13e6c69bd3SSam Ravnborg #include <linux/types.h>
14e6c69bd3SSam Ravnborg #include <linux/sched.h>
15e6c69bd3SSam Ravnborg #include <linux/mm.h>
16fd04d206SChristoph Lameter #include <linux/kbuild.h>
17363c55caSWu Zhangjin #include <linux/suspend.h>
182db003a5SPaul Burton #include <asm/cpu-info.h>
1974e91335SJames Hogan #include <asm/pm.h>
20e6c69bd3SSam Ravnborg #include <asm/ptrace.h>
21e6c69bd3SSam Ravnborg #include <asm/processor.h>
220ee958e1SPaul Burton #include <asm/smp-cps.h>
23e6c69bd3SSam Ravnborg 
2412e25f8eSSanjay Lal #include <linux/kvm_host.h>
2512e25f8eSSanjay Lal 
26dfbd992eSArnd Bergmann void output_ptreg_defines(void);
output_ptreg_defines(void)27e6c69bd3SSam Ravnborg void output_ptreg_defines(void)
28e6c69bd3SSam Ravnborg {
29fd04d206SChristoph Lameter 	COMMENT("MIPS pt_regs offsets.");
30fd04d206SChristoph Lameter 	OFFSET(PT_R0, pt_regs, regs[0]);
31fd04d206SChristoph Lameter 	OFFSET(PT_R1, pt_regs, regs[1]);
32fd04d206SChristoph Lameter 	OFFSET(PT_R2, pt_regs, regs[2]);
33fd04d206SChristoph Lameter 	OFFSET(PT_R3, pt_regs, regs[3]);
34fd04d206SChristoph Lameter 	OFFSET(PT_R4, pt_regs, regs[4]);
35fd04d206SChristoph Lameter 	OFFSET(PT_R5, pt_regs, regs[5]);
36fd04d206SChristoph Lameter 	OFFSET(PT_R6, pt_regs, regs[6]);
37fd04d206SChristoph Lameter 	OFFSET(PT_R7, pt_regs, regs[7]);
38fd04d206SChristoph Lameter 	OFFSET(PT_R8, pt_regs, regs[8]);
39fd04d206SChristoph Lameter 	OFFSET(PT_R9, pt_regs, regs[9]);
40fd04d206SChristoph Lameter 	OFFSET(PT_R10, pt_regs, regs[10]);
41fd04d206SChristoph Lameter 	OFFSET(PT_R11, pt_regs, regs[11]);
42fd04d206SChristoph Lameter 	OFFSET(PT_R12, pt_regs, regs[12]);
43fd04d206SChristoph Lameter 	OFFSET(PT_R13, pt_regs, regs[13]);
44fd04d206SChristoph Lameter 	OFFSET(PT_R14, pt_regs, regs[14]);
45fd04d206SChristoph Lameter 	OFFSET(PT_R15, pt_regs, regs[15]);
46fd04d206SChristoph Lameter 	OFFSET(PT_R16, pt_regs, regs[16]);
47fd04d206SChristoph Lameter 	OFFSET(PT_R17, pt_regs, regs[17]);
48fd04d206SChristoph Lameter 	OFFSET(PT_R18, pt_regs, regs[18]);
49fd04d206SChristoph Lameter 	OFFSET(PT_R19, pt_regs, regs[19]);
50fd04d206SChristoph Lameter 	OFFSET(PT_R20, pt_regs, regs[20]);
51fd04d206SChristoph Lameter 	OFFSET(PT_R21, pt_regs, regs[21]);
52fd04d206SChristoph Lameter 	OFFSET(PT_R22, pt_regs, regs[22]);
53fd04d206SChristoph Lameter 	OFFSET(PT_R23, pt_regs, regs[23]);
54fd04d206SChristoph Lameter 	OFFSET(PT_R24, pt_regs, regs[24]);
55fd04d206SChristoph Lameter 	OFFSET(PT_R25, pt_regs, regs[25]);
56fd04d206SChristoph Lameter 	OFFSET(PT_R26, pt_regs, regs[26]);
57fd04d206SChristoph Lameter 	OFFSET(PT_R27, pt_regs, regs[27]);
58fd04d206SChristoph Lameter 	OFFSET(PT_R28, pt_regs, regs[28]);
59fd04d206SChristoph Lameter 	OFFSET(PT_R29, pt_regs, regs[29]);
60fd04d206SChristoph Lameter 	OFFSET(PT_R30, pt_regs, regs[30]);
61fd04d206SChristoph Lameter 	OFFSET(PT_R31, pt_regs, regs[31]);
62fd04d206SChristoph Lameter 	OFFSET(PT_LO, pt_regs, lo);
63fd04d206SChristoph Lameter 	OFFSET(PT_HI, pt_regs, hi);
649693a853SFranck Bui-Huu #ifdef CONFIG_CPU_HAS_SMARTMIPS
65fd04d206SChristoph Lameter 	OFFSET(PT_ACX, pt_regs, acx);
669693a853SFranck Bui-Huu #endif
67fd04d206SChristoph Lameter 	OFFSET(PT_EPC, pt_regs, cp0_epc);
68fd04d206SChristoph Lameter 	OFFSET(PT_BVADDR, pt_regs, cp0_badvaddr);
69fd04d206SChristoph Lameter 	OFFSET(PT_STATUS, pt_regs, cp0_status);
70fd04d206SChristoph Lameter 	OFFSET(PT_CAUSE, pt_regs, cp0_cause);
71babed555SDavid Daney #ifdef CONFIG_CPU_CAVIUM_OCTEON
72babed555SDavid Daney 	OFFSET(PT_MPL, pt_regs, mpl);
73babed555SDavid Daney 	OFFSET(PT_MTP, pt_regs, mtp);
74babed555SDavid Daney #endif /* CONFIG_CPU_CAVIUM_OCTEON */
75fd04d206SChristoph Lameter 	DEFINE(PT_SIZE, sizeof(struct pt_regs));
76fd04d206SChristoph Lameter 	BLANK();
77e6c69bd3SSam Ravnborg }
78e6c69bd3SSam Ravnborg 
79dfbd992eSArnd Bergmann void output_task_defines(void);
output_task_defines(void)80e6c69bd3SSam Ravnborg void output_task_defines(void)
81e6c69bd3SSam Ravnborg {
82fd04d206SChristoph Lameter 	COMMENT("MIPS task_struct offsets.");
83fd04d206SChristoph Lameter 	OFFSET(TASK_THREAD_INFO, task_struct, stack);
84fd04d206SChristoph Lameter 	OFFSET(TASK_FLAGS, task_struct, flags);
85fd04d206SChristoph Lameter 	OFFSET(TASK_MM, task_struct, mm);
86fd04d206SChristoph Lameter 	OFFSET(TASK_PID, task_struct, pid);
87050e9baaSLinus Torvalds #if defined(CONFIG_STACKPROTECTOR)
881400eb65SGregory Fong 	OFFSET(TASK_STACK_CANARY, task_struct, stack_canary);
891400eb65SGregory Fong #endif
90fd04d206SChristoph Lameter 	DEFINE(TASK_STRUCT_SIZE, sizeof(struct task_struct));
91fd04d206SChristoph Lameter 	BLANK();
92e6c69bd3SSam Ravnborg }
93e6c69bd3SSam Ravnborg 
94dfbd992eSArnd Bergmann void output_thread_info_defines(void);
output_thread_info_defines(void)95e6c69bd3SSam Ravnborg void output_thread_info_defines(void)
96e6c69bd3SSam Ravnborg {
97fd04d206SChristoph Lameter 	COMMENT("MIPS thread_info offsets.");
98fd04d206SChristoph Lameter 	OFFSET(TI_TASK, thread_info, task);
99fd04d206SChristoph Lameter 	OFFSET(TI_FLAGS, thread_info, flags);
100fd04d206SChristoph Lameter 	OFFSET(TI_TP_VALUE, thread_info, tp_value);
101fd04d206SChristoph Lameter 	OFFSET(TI_CPU, thread_info, cpu);
102fd04d206SChristoph Lameter 	OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
103fd04d206SChristoph Lameter 	OFFSET(TI_REGS, thread_info, regs);
104*f91955daSJiaxun Yang 	OFFSET(TI_SYSCALL, thread_info, syscall);
105fd04d206SChristoph Lameter 	DEFINE(_THREAD_SIZE, THREAD_SIZE);
106fd04d206SChristoph Lameter 	DEFINE(_THREAD_MASK, THREAD_MASK);
107fe8bd18fSMatt Redfearn 	DEFINE(_IRQ_STACK_SIZE, IRQ_STACK_SIZE);
108db8466c5SMatt Redfearn 	DEFINE(_IRQ_STACK_START, IRQ_STACK_START);
109fd04d206SChristoph Lameter 	BLANK();
110e6c69bd3SSam Ravnborg }
111e6c69bd3SSam Ravnborg 
112dfbd992eSArnd Bergmann void output_thread_defines(void);
output_thread_defines(void)113e6c69bd3SSam Ravnborg void output_thread_defines(void)
114e6c69bd3SSam Ravnborg {
115fd04d206SChristoph Lameter 	COMMENT("MIPS specific thread_struct offsets.");
116fd04d206SChristoph Lameter 	OFFSET(THREAD_REG16, task_struct, thread.reg16);
117fd04d206SChristoph Lameter 	OFFSET(THREAD_REG17, task_struct, thread.reg17);
118fd04d206SChristoph Lameter 	OFFSET(THREAD_REG18, task_struct, thread.reg18);
119fd04d206SChristoph Lameter 	OFFSET(THREAD_REG19, task_struct, thread.reg19);
120fd04d206SChristoph Lameter 	OFFSET(THREAD_REG20, task_struct, thread.reg20);
121fd04d206SChristoph Lameter 	OFFSET(THREAD_REG21, task_struct, thread.reg21);
122fd04d206SChristoph Lameter 	OFFSET(THREAD_REG22, task_struct, thread.reg22);
123fd04d206SChristoph Lameter 	OFFSET(THREAD_REG23, task_struct, thread.reg23);
124fd04d206SChristoph Lameter 	OFFSET(THREAD_REG29, task_struct, thread.reg29);
125fd04d206SChristoph Lameter 	OFFSET(THREAD_REG30, task_struct, thread.reg30);
126fd04d206SChristoph Lameter 	OFFSET(THREAD_REG31, task_struct, thread.reg31);
127fd04d206SChristoph Lameter 	OFFSET(THREAD_STATUS, task_struct,
128e6c69bd3SSam Ravnborg 	       thread.cp0_status);
129e6c69bd3SSam Ravnborg 
130fd04d206SChristoph Lameter 	OFFSET(THREAD_BVADDR, task_struct, \
131e6c69bd3SSam Ravnborg 	       thread.cp0_badvaddr);
132fd04d206SChristoph Lameter 	OFFSET(THREAD_BUADDR, task_struct, \
133e6c69bd3SSam Ravnborg 	       thread.cp0_baduaddr);
134fd04d206SChristoph Lameter 	OFFSET(THREAD_ECODE, task_struct, \
135e6c69bd3SSam Ravnborg 	       thread.error_code);
136e3b28831SRalf Baechle 	OFFSET(THREAD_TRAPNO, task_struct, thread.trap_nr);
137fd04d206SChristoph Lameter 	BLANK();
138e6c69bd3SSam Ravnborg }
139e6c69bd3SSam Ravnborg 
1402725f377SPaul Burton #ifdef CONFIG_MIPS_FP_SUPPORT
141dfbd992eSArnd Bergmann void output_thread_fpu_defines(void);
output_thread_fpu_defines(void)142e6c69bd3SSam Ravnborg void output_thread_fpu_defines(void)
143e6c69bd3SSam Ravnborg {
1442725f377SPaul Burton 	OFFSET(THREAD_FPU, task_struct, thread.fpu);
1452725f377SPaul Burton 
146fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR0, task_struct, thread.fpu.fpr[0]);
147fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR1, task_struct, thread.fpu.fpr[1]);
148fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR2, task_struct, thread.fpu.fpr[2]);
149fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR3, task_struct, thread.fpu.fpr[3]);
150fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR4, task_struct, thread.fpu.fpr[4]);
151fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR5, task_struct, thread.fpu.fpr[5]);
152fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR6, task_struct, thread.fpu.fpr[6]);
153fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR7, task_struct, thread.fpu.fpr[7]);
154fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR8, task_struct, thread.fpu.fpr[8]);
155fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR9, task_struct, thread.fpu.fpr[9]);
156fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR10, task_struct, thread.fpu.fpr[10]);
157fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR11, task_struct, thread.fpu.fpr[11]);
158fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR12, task_struct, thread.fpu.fpr[12]);
159fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR13, task_struct, thread.fpu.fpr[13]);
160fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR14, task_struct, thread.fpu.fpr[14]);
161fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR15, task_struct, thread.fpu.fpr[15]);
162fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR16, task_struct, thread.fpu.fpr[16]);
163fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR17, task_struct, thread.fpu.fpr[17]);
164fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR18, task_struct, thread.fpu.fpr[18]);
165fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR19, task_struct, thread.fpu.fpr[19]);
166fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR20, task_struct, thread.fpu.fpr[20]);
167fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR21, task_struct, thread.fpu.fpr[21]);
168fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR22, task_struct, thread.fpu.fpr[22]);
169fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR23, task_struct, thread.fpu.fpr[23]);
170fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR24, task_struct, thread.fpu.fpr[24]);
171fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR25, task_struct, thread.fpu.fpr[25]);
172fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR26, task_struct, thread.fpu.fpr[26]);
173fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR27, task_struct, thread.fpu.fpr[27]);
174fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR28, task_struct, thread.fpu.fpr[28]);
175fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR29, task_struct, thread.fpu.fpr[29]);
176fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR30, task_struct, thread.fpu.fpr[30]);
177fd04d206SChristoph Lameter 	OFFSET(THREAD_FPR31, task_struct, thread.fpu.fpr[31]);
178e6c69bd3SSam Ravnborg 
179fd04d206SChristoph Lameter 	OFFSET(THREAD_FCR31, task_struct, thread.fpu.fcr31);
180f7a46fa7SPaul Burton 	OFFSET(THREAD_MSA_CSR, task_struct, thread.fpu.msacsr);
181fd04d206SChristoph Lameter 	BLANK();
182e6c69bd3SSam Ravnborg }
1832725f377SPaul Burton #endif
184e6c69bd3SSam Ravnborg 
185dfbd992eSArnd Bergmann void output_mm_defines(void);
output_mm_defines(void)186e6c69bd3SSam Ravnborg void output_mm_defines(void)
187e6c69bd3SSam Ravnborg {
188fd04d206SChristoph Lameter 	COMMENT("Size of struct page");
189fd04d206SChristoph Lameter 	DEFINE(STRUCT_PAGE_SIZE, sizeof(struct page));
190fd04d206SChristoph Lameter 	BLANK();
191fd04d206SChristoph Lameter 	COMMENT("Linux mm_struct offsets.");
192fd04d206SChristoph Lameter 	OFFSET(MM_USERS, mm_struct, mm_users);
193fd04d206SChristoph Lameter 	OFFSET(MM_PGD, mm_struct, pgd);
194fd04d206SChristoph Lameter 	OFFSET(MM_CONTEXT, mm_struct, context);
195fd04d206SChristoph Lameter 	BLANK();
196fd04d206SChristoph Lameter 	DEFINE(_PGD_T_SIZE, sizeof(pgd_t));
197fd04d206SChristoph Lameter 	DEFINE(_PMD_T_SIZE, sizeof(pmd_t));
198fd04d206SChristoph Lameter 	DEFINE(_PTE_T_SIZE, sizeof(pte_t));
199fd04d206SChristoph Lameter 	BLANK();
200fd04d206SChristoph Lameter 	DEFINE(_PGD_T_LOG2, PGD_T_LOG2);
201325f8a0aSDavid Daney #ifndef __PAGETABLE_PMD_FOLDED
202fd04d206SChristoph Lameter 	DEFINE(_PMD_T_LOG2, PMD_T_LOG2);
203325f8a0aSDavid Daney #endif
204fd04d206SChristoph Lameter 	DEFINE(_PTE_T_LOG2, PTE_T_LOG2);
205fd04d206SChristoph Lameter 	BLANK();
206fd04d206SChristoph Lameter 	BLANK();
207fd04d206SChristoph Lameter 	DEFINE(_PMD_SHIFT, PMD_SHIFT);
208fd04d206SChristoph Lameter 	DEFINE(_PGDIR_SHIFT, PGDIR_SHIFT);
209fd04d206SChristoph Lameter 	BLANK();
210fd04d206SChristoph Lameter 	DEFINE(_PTRS_PER_PGD, PTRS_PER_PGD);
211fd04d206SChristoph Lameter 	DEFINE(_PTRS_PER_PMD, PTRS_PER_PMD);
212fd04d206SChristoph Lameter 	DEFINE(_PTRS_PER_PTE, PTRS_PER_PTE);
213fd04d206SChristoph Lameter 	BLANK();
21420082595SRalf Baechle 	DEFINE(_PAGE_SHIFT, PAGE_SHIFT);
21520082595SRalf Baechle 	DEFINE(_PAGE_SIZE, PAGE_SIZE);
21620082595SRalf Baechle 	BLANK();
217e6c69bd3SSam Ravnborg }
218e6c69bd3SSam Ravnborg 
219e50c0a8fSRalf Baechle #ifdef CONFIG_32BIT
220dfbd992eSArnd Bergmann void output_sc_defines(void);
output_sc_defines(void)221e6c69bd3SSam Ravnborg void output_sc_defines(void)
222e6c69bd3SSam Ravnborg {
223fd04d206SChristoph Lameter 	COMMENT("Linux sigcontext offsets.");
224fd04d206SChristoph Lameter 	OFFSET(SC_REGS, sigcontext, sc_regs);
225fd04d206SChristoph Lameter 	OFFSET(SC_FPREGS, sigcontext, sc_fpregs);
226fd04d206SChristoph Lameter 	OFFSET(SC_ACX, sigcontext, sc_acx);
227fd04d206SChristoph Lameter 	OFFSET(SC_MDHI, sigcontext, sc_mdhi);
228fd04d206SChristoph Lameter 	OFFSET(SC_MDLO, sigcontext, sc_mdlo);
229fd04d206SChristoph Lameter 	OFFSET(SC_PC, sigcontext, sc_pc);
230fd04d206SChristoph Lameter 	OFFSET(SC_FPC_CSR, sigcontext, sc_fpc_csr);
231fd04d206SChristoph Lameter 	OFFSET(SC_FPC_EIR, sigcontext, sc_fpc_eir);
232fd04d206SChristoph Lameter 	OFFSET(SC_HI1, sigcontext, sc_hi1);
233fd04d206SChristoph Lameter 	OFFSET(SC_LO1, sigcontext, sc_lo1);
234fd04d206SChristoph Lameter 	OFFSET(SC_HI2, sigcontext, sc_hi2);
235fd04d206SChristoph Lameter 	OFFSET(SC_LO2, sigcontext, sc_lo2);
236fd04d206SChristoph Lameter 	OFFSET(SC_HI3, sigcontext, sc_hi3);
237fd04d206SChristoph Lameter 	OFFSET(SC_LO3, sigcontext, sc_lo3);
238fd04d206SChristoph Lameter 	BLANK();
239e6c69bd3SSam Ravnborg }
240e50c0a8fSRalf Baechle #endif
241e50c0a8fSRalf Baechle 
242e50c0a8fSRalf Baechle #ifdef CONFIG_64BIT
243dfbd992eSArnd Bergmann void output_sc_defines(void);
output_sc_defines(void)244e50c0a8fSRalf Baechle void output_sc_defines(void)
245e50c0a8fSRalf Baechle {
246fd04d206SChristoph Lameter 	COMMENT("Linux sigcontext offsets.");
247fd04d206SChristoph Lameter 	OFFSET(SC_REGS, sigcontext, sc_regs);
248fd04d206SChristoph Lameter 	OFFSET(SC_FPREGS, sigcontext, sc_fpregs);
249fd04d206SChristoph Lameter 	OFFSET(SC_MDHI, sigcontext, sc_mdhi);
250fd04d206SChristoph Lameter 	OFFSET(SC_MDLO, sigcontext, sc_mdlo);
251fd04d206SChristoph Lameter 	OFFSET(SC_PC, sigcontext, sc_pc);
252fd04d206SChristoph Lameter 	OFFSET(SC_FPC_CSR, sigcontext, sc_fpc_csr);
253fd04d206SChristoph Lameter 	BLANK();
254e50c0a8fSRalf Baechle }
255e50c0a8fSRalf Baechle #endif
256e6c69bd3SSam Ravnborg 
257dfbd992eSArnd Bergmann void output_signal_defined(void);
output_signal_defined(void)258e6c69bd3SSam Ravnborg void output_signal_defined(void)
259e6c69bd3SSam Ravnborg {
260fd04d206SChristoph Lameter 	COMMENT("Linux signal numbers.");
261fd04d206SChristoph Lameter 	DEFINE(_SIGHUP, SIGHUP);
262fd04d206SChristoph Lameter 	DEFINE(_SIGINT, SIGINT);
263fd04d206SChristoph Lameter 	DEFINE(_SIGQUIT, SIGQUIT);
264fd04d206SChristoph Lameter 	DEFINE(_SIGILL, SIGILL);
265fd04d206SChristoph Lameter 	DEFINE(_SIGTRAP, SIGTRAP);
266fd04d206SChristoph Lameter 	DEFINE(_SIGIOT, SIGIOT);
267fd04d206SChristoph Lameter 	DEFINE(_SIGABRT, SIGABRT);
268fd04d206SChristoph Lameter 	DEFINE(_SIGEMT, SIGEMT);
269fd04d206SChristoph Lameter 	DEFINE(_SIGFPE, SIGFPE);
270fd04d206SChristoph Lameter 	DEFINE(_SIGKILL, SIGKILL);
271fd04d206SChristoph Lameter 	DEFINE(_SIGBUS, SIGBUS);
272fd04d206SChristoph Lameter 	DEFINE(_SIGSEGV, SIGSEGV);
273fd04d206SChristoph Lameter 	DEFINE(_SIGSYS, SIGSYS);
274fd04d206SChristoph Lameter 	DEFINE(_SIGPIPE, SIGPIPE);
275fd04d206SChristoph Lameter 	DEFINE(_SIGALRM, SIGALRM);
276fd04d206SChristoph Lameter 	DEFINE(_SIGTERM, SIGTERM);
277fd04d206SChristoph Lameter 	DEFINE(_SIGUSR1, SIGUSR1);
278fd04d206SChristoph Lameter 	DEFINE(_SIGUSR2, SIGUSR2);
279fd04d206SChristoph Lameter 	DEFINE(_SIGCHLD, SIGCHLD);
280fd04d206SChristoph Lameter 	DEFINE(_SIGPWR, SIGPWR);
281fd04d206SChristoph Lameter 	DEFINE(_SIGWINCH, SIGWINCH);
282fd04d206SChristoph Lameter 	DEFINE(_SIGURG, SIGURG);
283fd04d206SChristoph Lameter 	DEFINE(_SIGIO, SIGIO);
284fd04d206SChristoph Lameter 	DEFINE(_SIGSTOP, SIGSTOP);
285fd04d206SChristoph Lameter 	DEFINE(_SIGTSTP, SIGTSTP);
286fd04d206SChristoph Lameter 	DEFINE(_SIGCONT, SIGCONT);
287fd04d206SChristoph Lameter 	DEFINE(_SIGTTIN, SIGTTIN);
288fd04d206SChristoph Lameter 	DEFINE(_SIGTTOU, SIGTTOU);
289fd04d206SChristoph Lameter 	DEFINE(_SIGVTALRM, SIGVTALRM);
290fd04d206SChristoph Lameter 	DEFINE(_SIGPROF, SIGPROF);
291fd04d206SChristoph Lameter 	DEFINE(_SIGXCPU, SIGXCPU);
292fd04d206SChristoph Lameter 	DEFINE(_SIGXFSZ, SIGXFSZ);
293fd04d206SChristoph Lameter 	BLANK();
294e6c69bd3SSam Ravnborg }
295e6c69bd3SSam Ravnborg 
296babed555SDavid Daney #ifdef CONFIG_CPU_CAVIUM_OCTEON
297dfbd992eSArnd Bergmann void output_octeon_cop2_state_defines(void);
output_octeon_cop2_state_defines(void)298babed555SDavid Daney void output_octeon_cop2_state_defines(void)
299babed555SDavid Daney {
300babed555SDavid Daney 	COMMENT("Octeon specific octeon_cop2_state offsets.");
301babed555SDavid Daney 	OFFSET(OCTEON_CP2_CRC_IV,	octeon_cop2_state, cop2_crc_iv);
302babed555SDavid Daney 	OFFSET(OCTEON_CP2_CRC_LENGTH,	octeon_cop2_state, cop2_crc_length);
303babed555SDavid Daney 	OFFSET(OCTEON_CP2_CRC_POLY,	octeon_cop2_state, cop2_crc_poly);
304babed555SDavid Daney 	OFFSET(OCTEON_CP2_LLM_DAT,	octeon_cop2_state, cop2_llm_dat);
305babed555SDavid Daney 	OFFSET(OCTEON_CP2_3DES_IV,	octeon_cop2_state, cop2_3des_iv);
306babed555SDavid Daney 	OFFSET(OCTEON_CP2_3DES_KEY,	octeon_cop2_state, cop2_3des_key);
307babed555SDavid Daney 	OFFSET(OCTEON_CP2_3DES_RESULT,	octeon_cop2_state, cop2_3des_result);
308babed555SDavid Daney 	OFFSET(OCTEON_CP2_AES_INP0,	octeon_cop2_state, cop2_aes_inp0);
309babed555SDavid Daney 	OFFSET(OCTEON_CP2_AES_IV,	octeon_cop2_state, cop2_aes_iv);
310babed555SDavid Daney 	OFFSET(OCTEON_CP2_AES_KEY,	octeon_cop2_state, cop2_aes_key);
311babed555SDavid Daney 	OFFSET(OCTEON_CP2_AES_KEYLEN,	octeon_cop2_state, cop2_aes_keylen);
312babed555SDavid Daney 	OFFSET(OCTEON_CP2_AES_RESULT,	octeon_cop2_state, cop2_aes_result);
313babed555SDavid Daney 	OFFSET(OCTEON_CP2_GFM_MULT,	octeon_cop2_state, cop2_gfm_mult);
314babed555SDavid Daney 	OFFSET(OCTEON_CP2_GFM_POLY,	octeon_cop2_state, cop2_gfm_poly);
315babed555SDavid Daney 	OFFSET(OCTEON_CP2_GFM_RESULT,	octeon_cop2_state, cop2_gfm_result);
316babed555SDavid Daney 	OFFSET(OCTEON_CP2_HSH_DATW,	octeon_cop2_state, cop2_hsh_datw);
317babed555SDavid Daney 	OFFSET(OCTEON_CP2_HSH_IVW,	octeon_cop2_state, cop2_hsh_ivw);
3186b3a287eSDavid Daney 	OFFSET(OCTEON_CP2_SHA3,		octeon_cop2_state, cop2_sha3);
319babed555SDavid Daney 	OFFSET(THREAD_CP2,	task_struct, thread.cp2);
320b6007ff8SJiaxun Yang #if defined(CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE) && \
321b6007ff8SJiaxun Yang     CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0
322babed555SDavid Daney 	OFFSET(THREAD_CVMSEG,	task_struct, thread.cvmseg.cvmseg);
323b6007ff8SJiaxun Yang #endif
324babed555SDavid Daney 	BLANK();
325babed555SDavid Daney }
326babed555SDavid Daney #endif
327363c55caSWu Zhangjin 
328363c55caSWu Zhangjin #ifdef CONFIG_HIBERNATION
329dfbd992eSArnd Bergmann void output_pbe_defines(void);
output_pbe_defines(void)330363c55caSWu Zhangjin void output_pbe_defines(void)
331363c55caSWu Zhangjin {
332363c55caSWu Zhangjin 	COMMENT(" Linux struct pbe offsets. ");
333363c55caSWu Zhangjin 	OFFSET(PBE_ADDRESS, pbe, address);
334363c55caSWu Zhangjin 	OFFSET(PBE_ORIG_ADDRESS, pbe, orig_address);
335363c55caSWu Zhangjin 	OFFSET(PBE_NEXT, pbe, next);
336363c55caSWu Zhangjin 	DEFINE(PBE_SIZE, sizeof(struct pbe));
337363c55caSWu Zhangjin 	BLANK();
338363c55caSWu Zhangjin }
339363c55caSWu Zhangjin #endif
34012e25f8eSSanjay Lal 
34174e91335SJames Hogan #ifdef CONFIG_CPU_PM
342dfbd992eSArnd Bergmann void output_pm_defines(void);
output_pm_defines(void)34374e91335SJames Hogan void output_pm_defines(void)
34474e91335SJames Hogan {
34574e91335SJames Hogan 	COMMENT(" PM offsets. ");
34674e91335SJames Hogan #ifdef CONFIG_EVA
34774e91335SJames Hogan 	OFFSET(SSS_SEGCTL0,	mips_static_suspend_state, segctl[0]);
34874e91335SJames Hogan 	OFFSET(SSS_SEGCTL1,	mips_static_suspend_state, segctl[1]);
34974e91335SJames Hogan 	OFFSET(SSS_SEGCTL2,	mips_static_suspend_state, segctl[2]);
35074e91335SJames Hogan #endif
35174e91335SJames Hogan 	OFFSET(SSS_SP,		mips_static_suspend_state, sp);
35274e91335SJames Hogan 	BLANK();
35374e91335SJames Hogan }
35474e91335SJames Hogan #endif
35574e91335SJames Hogan 
3562725f377SPaul Burton #ifdef CONFIG_MIPS_FP_SUPPORT
357dfbd992eSArnd Bergmann void output_kvm_defines(void);
output_kvm_defines(void)35812e25f8eSSanjay Lal void output_kvm_defines(void)
35912e25f8eSSanjay Lal {
3609165dabbSMasanari Iida 	COMMENT(" KVM/MIPS Specific offsets. ");
36198e91b84SJames Hogan 
36298e91b84SJames Hogan 	OFFSET(VCPU_FPR0, kvm_vcpu_arch, fpu.fpr[0]);
36398e91b84SJames Hogan 	OFFSET(VCPU_FPR1, kvm_vcpu_arch, fpu.fpr[1]);
36498e91b84SJames Hogan 	OFFSET(VCPU_FPR2, kvm_vcpu_arch, fpu.fpr[2]);
36598e91b84SJames Hogan 	OFFSET(VCPU_FPR3, kvm_vcpu_arch, fpu.fpr[3]);
36698e91b84SJames Hogan 	OFFSET(VCPU_FPR4, kvm_vcpu_arch, fpu.fpr[4]);
36798e91b84SJames Hogan 	OFFSET(VCPU_FPR5, kvm_vcpu_arch, fpu.fpr[5]);
36898e91b84SJames Hogan 	OFFSET(VCPU_FPR6, kvm_vcpu_arch, fpu.fpr[6]);
36998e91b84SJames Hogan 	OFFSET(VCPU_FPR7, kvm_vcpu_arch, fpu.fpr[7]);
37098e91b84SJames Hogan 	OFFSET(VCPU_FPR8, kvm_vcpu_arch, fpu.fpr[8]);
37198e91b84SJames Hogan 	OFFSET(VCPU_FPR9, kvm_vcpu_arch, fpu.fpr[9]);
37298e91b84SJames Hogan 	OFFSET(VCPU_FPR10, kvm_vcpu_arch, fpu.fpr[10]);
37398e91b84SJames Hogan 	OFFSET(VCPU_FPR11, kvm_vcpu_arch, fpu.fpr[11]);
37498e91b84SJames Hogan 	OFFSET(VCPU_FPR12, kvm_vcpu_arch, fpu.fpr[12]);
37598e91b84SJames Hogan 	OFFSET(VCPU_FPR13, kvm_vcpu_arch, fpu.fpr[13]);
37698e91b84SJames Hogan 	OFFSET(VCPU_FPR14, kvm_vcpu_arch, fpu.fpr[14]);
37798e91b84SJames Hogan 	OFFSET(VCPU_FPR15, kvm_vcpu_arch, fpu.fpr[15]);
37898e91b84SJames Hogan 	OFFSET(VCPU_FPR16, kvm_vcpu_arch, fpu.fpr[16]);
37998e91b84SJames Hogan 	OFFSET(VCPU_FPR17, kvm_vcpu_arch, fpu.fpr[17]);
38098e91b84SJames Hogan 	OFFSET(VCPU_FPR18, kvm_vcpu_arch, fpu.fpr[18]);
38198e91b84SJames Hogan 	OFFSET(VCPU_FPR19, kvm_vcpu_arch, fpu.fpr[19]);
38298e91b84SJames Hogan 	OFFSET(VCPU_FPR20, kvm_vcpu_arch, fpu.fpr[20]);
38398e91b84SJames Hogan 	OFFSET(VCPU_FPR21, kvm_vcpu_arch, fpu.fpr[21]);
38498e91b84SJames Hogan 	OFFSET(VCPU_FPR22, kvm_vcpu_arch, fpu.fpr[22]);
38598e91b84SJames Hogan 	OFFSET(VCPU_FPR23, kvm_vcpu_arch, fpu.fpr[23]);
38698e91b84SJames Hogan 	OFFSET(VCPU_FPR24, kvm_vcpu_arch, fpu.fpr[24]);
38798e91b84SJames Hogan 	OFFSET(VCPU_FPR25, kvm_vcpu_arch, fpu.fpr[25]);
38898e91b84SJames Hogan 	OFFSET(VCPU_FPR26, kvm_vcpu_arch, fpu.fpr[26]);
38998e91b84SJames Hogan 	OFFSET(VCPU_FPR27, kvm_vcpu_arch, fpu.fpr[27]);
39098e91b84SJames Hogan 	OFFSET(VCPU_FPR28, kvm_vcpu_arch, fpu.fpr[28]);
39198e91b84SJames Hogan 	OFFSET(VCPU_FPR29, kvm_vcpu_arch, fpu.fpr[29]);
39298e91b84SJames Hogan 	OFFSET(VCPU_FPR30, kvm_vcpu_arch, fpu.fpr[30]);
39398e91b84SJames Hogan 	OFFSET(VCPU_FPR31, kvm_vcpu_arch, fpu.fpr[31]);
39498e91b84SJames Hogan 
39598e91b84SJames Hogan 	OFFSET(VCPU_FCR31, kvm_vcpu_arch, fpu.fcr31);
396539cb89fSJames Hogan 	OFFSET(VCPU_MSA_CSR, kvm_vcpu_arch, fpu.msacsr);
39798e91b84SJames Hogan 	BLANK();
39812e25f8eSSanjay Lal }
3992725f377SPaul Burton #endif
4000ee958e1SPaul Burton 
4010ee958e1SPaul Burton #ifdef CONFIG_MIPS_CPS
402dfbd992eSArnd Bergmann void output_cps_defines(void);
output_cps_defines(void)4030ee958e1SPaul Burton void output_cps_defines(void)
4040ee958e1SPaul Burton {
4050ee958e1SPaul Burton 	COMMENT(" MIPS CPS offsets. ");
406245a7868SPaul Burton 
407245a7868SPaul Burton 	OFFSET(COREBOOTCFG_VPEMASK, core_boot_config, vpe_mask);
408245a7868SPaul Burton 	OFFSET(COREBOOTCFG_VPECONFIG, core_boot_config, vpe_config);
409245a7868SPaul Burton 	DEFINE(COREBOOTCFG_SIZE, sizeof(struct core_boot_config));
410245a7868SPaul Burton 
411245a7868SPaul Burton 	OFFSET(VPEBOOTCFG_PC, vpe_boot_config, pc);
412245a7868SPaul Burton 	OFFSET(VPEBOOTCFG_SP, vpe_boot_config, sp);
413245a7868SPaul Burton 	OFFSET(VPEBOOTCFG_GP, vpe_boot_config, gp);
414245a7868SPaul Burton 	DEFINE(VPEBOOTCFG_SIZE, sizeof(struct vpe_boot_config));
4150ee958e1SPaul Burton }
4160ee958e1SPaul Burton #endif
417