mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
[linux/fpc-iii.git] / arch / frv / kernel / asm-offsets.c
blob0a468e9b51add897d2307582b4a8c910952d1bab
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Generate definitions needed by assembly language modules.
4 * This code generates raw asm output which is post-processed
5 * to extract and format the required data.
6 */
8 #include <linux/sched.h>
9 #include <linux/signal.h>
10 #include <linux/personality.h>
11 #include <linux/kbuild.h>
12 #include <asm/registers.h>
13 #include <asm/ucontext.h>
14 #include <asm/processor.h>
15 #include <asm/thread_info.h>
16 #include <asm/gdb-stub.h>
18 #define DEF_PTREG(sym, reg) OFFSET(sym, pt_regs, reg)
19 #define DEF_IREG(sym, reg) OFFSET(sym, user_context, reg)
20 #define DEF_FREG(sym, reg) OFFSET(sym, user_context, reg)
21 #define DEF_0REG(sym, reg) OFFSET(sym, frv_frame0, reg)
23 void foo(void)
25 /* offsets into the thread_info structure */
26 OFFSET(TI_TASK, thread_info, task);
27 OFFSET(TI_FLAGS, thread_info, flags);
28 OFFSET(TI_STATUS, thread_info, status);
29 OFFSET(TI_CPU, thread_info, cpu);
30 OFFSET(TI_PREEMPT_COUNT, thread_info, preempt_count);
31 OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
32 BLANK();
34 /* offsets into register file storage */
35 DEF_PTREG(REG_PSR, psr);
36 DEF_PTREG(REG_ISR, isr);
37 DEF_PTREG(REG_CCR, ccr);
38 DEF_PTREG(REG_CCCR, cccr);
39 DEF_PTREG(REG_LR, lr);
40 DEF_PTREG(REG_LCR, lcr);
41 DEF_PTREG(REG_PC, pc);
42 DEF_PTREG(REG__STATUS, __status);
43 DEF_PTREG(REG_SYSCALLNO, syscallno);
44 DEF_PTREG(REG_ORIG_GR8, orig_gr8);
45 DEF_PTREG(REG_GNER0, gner0);
46 DEF_PTREG(REG_GNER1, gner1);
47 DEF_PTREG(REG_IACC0, iacc0);
48 DEF_PTREG(REG_TBR, tbr);
49 DEF_PTREG(REG_GR0, tbr);
50 DEFINE(REG__END, sizeof(struct pt_regs));
51 BLANK();
53 DEF_0REG(REG_DCR, debug.dcr);
54 DEF_0REG(REG_IBAR0, debug.ibar[0]);
55 DEF_0REG(REG_DBAR0, debug.dbar[0]);
56 DEF_0REG(REG_DBDR00, debug.dbdr[0][0]);
57 DEF_0REG(REG_DBMR00, debug.dbmr[0][0]);
58 BLANK();
60 DEF_IREG(__INT_GR0, i.gr[0]);
61 DEF_FREG(__USER_FPMEDIA, f);
62 DEF_FREG(__FPMEDIA_FR0, f.fr[0]);
63 DEF_FREG(__FPMEDIA_FNER0, f.fner[0]);
64 DEF_FREG(__FPMEDIA_MSR0, f.msr[0]);
65 DEF_FREG(__FPMEDIA_ACC0, f.acc[0]);
66 DEF_FREG(__FPMEDIA_ACCG0, f.accg[0]);
67 DEF_FREG(__FPMEDIA_FSR0, f.fsr[0]);
68 BLANK();
70 DEFINE(NR_PT_REGS, sizeof(struct pt_regs) / 4);
71 DEFINE(NR_USER_INT_REGS, sizeof(struct user_int_regs) / 4);
72 DEFINE(NR_USER_FPMEDIA_REGS, sizeof(struct user_fpmedia_regs) / 4);
73 DEFINE(NR_USER_CONTEXT, sizeof(struct user_context) / 4);
74 DEFINE(FRV_FRAME0_SIZE, sizeof(struct frv_frame0));
75 BLANK();
77 /* offsets into thread_struct */
78 OFFSET(__THREAD_FRAME, thread_struct, frame);
79 OFFSET(__THREAD_CURR, thread_struct, curr);
80 OFFSET(__THREAD_SP, thread_struct, sp);
81 OFFSET(__THREAD_FP, thread_struct, fp);
82 OFFSET(__THREAD_LR, thread_struct, lr);
83 OFFSET(__THREAD_PC, thread_struct, pc);
84 OFFSET(__THREAD_GR16, thread_struct, gr[0]);
85 OFFSET(__THREAD_SCHED_LR, thread_struct, sched_lr);
86 OFFSET(__THREAD_FRAME0, thread_struct, frame0);
87 OFFSET(__THREAD_USER, thread_struct, user);
88 BLANK();
90 /* offsets into frv_debug_status */
91 OFFSET(DEBUG_BPSR, frv_debug_status, bpsr);
92 OFFSET(DEBUG_DCR, frv_debug_status, dcr);
93 OFFSET(DEBUG_BRR, frv_debug_status, brr);
94 OFFSET(DEBUG_NMAR, frv_debug_status, nmar);
95 BLANK();