hwmon: (jc42) Change detection class
[linux/fpc-iii.git] / arch / blackfin / kernel / asm-offsets.c
blobbd32c09b9349b789068015afa3999a9abd720f89
1 /*
2 * generate definitions needed by assembly language modules
4 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later
7 */
9 #include <linux/stddef.h>
10 #include <linux/sched.h>
11 #include <linux/kernel_stat.h>
12 #include <linux/ptrace.h>
13 #include <linux/hardirq.h>
14 #include <linux/irq.h>
15 #include <linux/thread_info.h>
16 #include <linux/kbuild.h>
18 int main(void)
20 /* offsets into the task struct */
21 DEFINE(TASK_STATE, offsetof(struct task_struct, state));
22 DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
23 DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
24 DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
25 DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
26 DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, stack));
27 DEFINE(TASK_MM, offsetof(struct task_struct, mm));
28 DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
29 DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, pending));
31 /* offsets into the irq_cpustat_t struct */
32 DEFINE(CPUSTAT_SOFTIRQ_PENDING,
33 offsetof(irq_cpustat_t, __softirq_pending));
35 /* offsets into the thread struct */
36 DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
37 DEFINE(THREAD_USP, offsetof(struct thread_struct, usp));
38 DEFINE(THREAD_SR, offsetof(struct thread_struct, seqstat));
39 DEFINE(PT_SR, offsetof(struct thread_struct, seqstat));
40 DEFINE(THREAD_ESP0, offsetof(struct thread_struct, esp0));
41 DEFINE(THREAD_PC, offsetof(struct thread_struct, pc));
42 DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE);
44 /* offsets into the pt_regs */
45 DEFINE(PT_ORIG_R0, offsetof(struct pt_regs, orig_r0));
46 DEFINE(PT_ORIG_P0, offsetof(struct pt_regs, orig_p0));
47 DEFINE(PT_ORIG_PC, offsetof(struct pt_regs, orig_pc));
48 DEFINE(PT_R0, offsetof(struct pt_regs, r0));
49 DEFINE(PT_R1, offsetof(struct pt_regs, r1));
50 DEFINE(PT_R2, offsetof(struct pt_regs, r2));
51 DEFINE(PT_R3, offsetof(struct pt_regs, r3));
52 DEFINE(PT_R4, offsetof(struct pt_regs, r4));
53 DEFINE(PT_R5, offsetof(struct pt_regs, r5));
54 DEFINE(PT_R6, offsetof(struct pt_regs, r6));
55 DEFINE(PT_R7, offsetof(struct pt_regs, r7));
57 DEFINE(PT_P0, offsetof(struct pt_regs, p0));
58 DEFINE(PT_P1, offsetof(struct pt_regs, p1));
59 DEFINE(PT_P2, offsetof(struct pt_regs, p2));
60 DEFINE(PT_P3, offsetof(struct pt_regs, p3));
61 DEFINE(PT_P4, offsetof(struct pt_regs, p4));
62 DEFINE(PT_P5, offsetof(struct pt_regs, p5));
64 DEFINE(PT_FP, offsetof(struct pt_regs, fp));
65 DEFINE(PT_USP, offsetof(struct pt_regs, usp));
66 DEFINE(PT_I0, offsetof(struct pt_regs, i0));
67 DEFINE(PT_I1, offsetof(struct pt_regs, i1));
68 DEFINE(PT_I2, offsetof(struct pt_regs, i2));
69 DEFINE(PT_I3, offsetof(struct pt_regs, i3));
70 DEFINE(PT_M0, offsetof(struct pt_regs, m0));
71 DEFINE(PT_M1, offsetof(struct pt_regs, m1));
72 DEFINE(PT_M2, offsetof(struct pt_regs, m2));
73 DEFINE(PT_M3, offsetof(struct pt_regs, m3));
74 DEFINE(PT_L0, offsetof(struct pt_regs, l0));
75 DEFINE(PT_L1, offsetof(struct pt_regs, l1));
76 DEFINE(PT_L2, offsetof(struct pt_regs, l2));
77 DEFINE(PT_L3, offsetof(struct pt_regs, l3));
78 DEFINE(PT_B0, offsetof(struct pt_regs, b0));
79 DEFINE(PT_B1, offsetof(struct pt_regs, b1));
80 DEFINE(PT_B2, offsetof(struct pt_regs, b2));
81 DEFINE(PT_B3, offsetof(struct pt_regs, b3));
82 DEFINE(PT_A0X, offsetof(struct pt_regs, a0x));
83 DEFINE(PT_A0W, offsetof(struct pt_regs, a0w));
84 DEFINE(PT_A1X, offsetof(struct pt_regs, a1x));
85 DEFINE(PT_A1W, offsetof(struct pt_regs, a1w));
86 DEFINE(PT_LC0, offsetof(struct pt_regs, lc0));
87 DEFINE(PT_LC1, offsetof(struct pt_regs, lc1));
88 DEFINE(PT_LT0, offsetof(struct pt_regs, lt0));
89 DEFINE(PT_LT1, offsetof(struct pt_regs, lt1));
90 DEFINE(PT_LB0, offsetof(struct pt_regs, lb0));
91 DEFINE(PT_LB1, offsetof(struct pt_regs, lb1));
92 DEFINE(PT_ASTAT, offsetof(struct pt_regs, astat));
93 DEFINE(PT_RESERVED, offsetof(struct pt_regs, reserved));
94 DEFINE(PT_RETS, offsetof(struct pt_regs, rets));
95 DEFINE(PT_PC, offsetof(struct pt_regs, pc));
96 DEFINE(PT_RETX, offsetof(struct pt_regs, retx));
97 DEFINE(PT_RETN, offsetof(struct pt_regs, retn));
98 DEFINE(PT_RETE, offsetof(struct pt_regs, rete));
99 DEFINE(PT_SEQSTAT, offsetof(struct pt_regs, seqstat));
100 DEFINE(PT_SYSCFG, offsetof(struct pt_regs, syscfg));
101 DEFINE(PT_IPEND, offsetof(struct pt_regs, ipend));
102 DEFINE(SIZEOF_PTREGS, sizeof(struct pt_regs));
103 DEFINE(PT_TEXT_ADDR, sizeof(struct pt_regs)); /* Needed by gdb */
104 DEFINE(PT_TEXT_END_ADDR, 4 + sizeof(struct pt_regs));/* Needed by gdb */
105 DEFINE(PT_DATA_ADDR, 8 + sizeof(struct pt_regs)); /* Needed by gdb */
106 DEFINE(PT_FDPIC_EXEC, 12 + sizeof(struct pt_regs)); /* Needed by gdb */
107 DEFINE(PT_FDPIC_INTERP, 16 + sizeof(struct pt_regs));/* Needed by gdb */
109 /* signal defines */
110 DEFINE(SIGSEGV, SIGSEGV);
111 DEFINE(SIGTRAP, SIGTRAP);
113 /* PDA management (in L1 scratchpad) */
114 DEFINE(PDA_SYSCFG, offsetof(struct blackfin_pda, syscfg));
115 #ifdef CONFIG_SMP
116 DEFINE(PDA_IRQFLAGS, offsetof(struct blackfin_pda, imask));
117 #endif
118 DEFINE(PDA_IPDT, offsetof(struct blackfin_pda, ipdt));
119 DEFINE(PDA_IPDT_SWAPCOUNT, offsetof(struct blackfin_pda, ipdt_swapcount));
120 DEFINE(PDA_DPDT, offsetof(struct blackfin_pda, dpdt));
121 DEFINE(PDA_DPDT_SWAPCOUNT, offsetof(struct blackfin_pda, dpdt_swapcount));
122 DEFINE(PDA_EXIPTR, offsetof(struct blackfin_pda, ex_iptr));
123 DEFINE(PDA_EXOPTR, offsetof(struct blackfin_pda, ex_optr));
124 DEFINE(PDA_EXBUF, offsetof(struct blackfin_pda, ex_buf));
125 DEFINE(PDA_EXIMASK, offsetof(struct blackfin_pda, ex_imask));
126 DEFINE(PDA_EXSTACK, offsetof(struct blackfin_pda, ex_stack));
127 DEFINE(PDA_EXIPEND, offsetof(struct blackfin_pda, ex_ipend));
128 #ifdef ANOMALY_05000261
129 DEFINE(PDA_LFRETX, offsetof(struct blackfin_pda, last_cplb_fault_retx));
130 #endif
131 DEFINE(PDA_DCPLB, offsetof(struct blackfin_pda, dcplb_fault_addr));
132 DEFINE(PDA_ICPLB, offsetof(struct blackfin_pda, icplb_fault_addr));
133 DEFINE(PDA_RETX, offsetof(struct blackfin_pda, retx));
134 DEFINE(PDA_SEQSTAT, offsetof(struct blackfin_pda, seqstat));
135 #ifdef CONFIG_DEBUG_DOUBLEFAULT
136 DEFINE(PDA_DF_DCPLB, offsetof(struct blackfin_pda, dcplb_doublefault_addr));
137 DEFINE(PDA_DF_ICPLB, offsetof(struct blackfin_pda, icplb_doublefault_addr));
138 DEFINE(PDA_DF_SEQSTAT, offsetof(struct blackfin_pda, seqstat_doublefault));
139 DEFINE(PDA_DF_RETX, offsetof(struct blackfin_pda, retx_doublefault));
140 #endif
141 #ifdef CONFIG_SMP
142 /* Inter-core lock (in L2 SRAM) */
143 DEFINE(SIZEOF_CORELOCK, sizeof(struct corelock_slot));
144 #endif
146 return 0;