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