Path: blob/master/arch/xtensa/kernel/asm-offsets.c
10817 views
/*1* arch/xtensa/kernel/asm-offsets.c2*3* Generates definitions from c-type structures used by assembly sources.4*5* This file is subject to the terms and conditions of the GNU General Public6* License. See the file "COPYING" in the main directory of this archive7* for more details.8*9* Copyright (C) 2005 Tensilica Inc.10*11* Chris Zankel <[email protected]>12*/1314#include <asm/processor.h>15#include <asm/coprocessor.h>1617#include <linux/types.h>18#include <linux/stddef.h>19#include <linux/thread_info.h>20#include <linux/ptrace.h>21#include <linux/mm.h>22#include <linux/kbuild.h>2324#include <asm/ptrace.h>25#include <asm/uaccess.h>2627int main(void)28{29/* struct pt_regs */30DEFINE(PT_PC, offsetof (struct pt_regs, pc));31DEFINE(PT_PS, offsetof (struct pt_regs, ps));32DEFINE(PT_DEPC, offsetof (struct pt_regs, depc));33DEFINE(PT_EXCCAUSE, offsetof (struct pt_regs, exccause));34DEFINE(PT_EXCVADDR, offsetof (struct pt_regs, excvaddr));35DEFINE(PT_DEBUGCAUSE, offsetof (struct pt_regs, debugcause));36DEFINE(PT_WMASK, offsetof (struct pt_regs, wmask));37DEFINE(PT_LBEG, offsetof (struct pt_regs, lbeg));38DEFINE(PT_LEND, offsetof (struct pt_regs, lend));39DEFINE(PT_LCOUNT, offsetof (struct pt_regs, lcount));40DEFINE(PT_SAR, offsetof (struct pt_regs, sar));41DEFINE(PT_ICOUNTLEVEL, offsetof (struct pt_regs, icountlevel));42DEFINE(PT_SYSCALL, offsetof (struct pt_regs, syscall));43DEFINE(PT_AREG, offsetof (struct pt_regs, areg[0]));44DEFINE(PT_AREG0, offsetof (struct pt_regs, areg[0]));45DEFINE(PT_AREG1, offsetof (struct pt_regs, areg[1]));46DEFINE(PT_AREG2, offsetof (struct pt_regs, areg[2]));47DEFINE(PT_AREG3, offsetof (struct pt_regs, areg[3]));48DEFINE(PT_AREG4, offsetof (struct pt_regs, areg[4]));49DEFINE(PT_AREG5, offsetof (struct pt_regs, areg[5]));50DEFINE(PT_AREG6, offsetof (struct pt_regs, areg[6]));51DEFINE(PT_AREG7, offsetof (struct pt_regs, areg[7]));52DEFINE(PT_AREG8, offsetof (struct pt_regs, areg[8]));53DEFINE(PT_AREG9, offsetof (struct pt_regs, areg[9]));54DEFINE(PT_AREG10, offsetof (struct pt_regs, areg[10]));55DEFINE(PT_AREG11, offsetof (struct pt_regs, areg[11]));56DEFINE(PT_AREG12, offsetof (struct pt_regs, areg[12]));57DEFINE(PT_AREG13, offsetof (struct pt_regs, areg[13]));58DEFINE(PT_AREG14, offsetof (struct pt_regs, areg[14]));59DEFINE(PT_AREG15, offsetof (struct pt_regs, areg[15]));60DEFINE(PT_WINDOWBASE, offsetof (struct pt_regs, windowbase));61DEFINE(PT_WINDOWSTART, offsetof(struct pt_regs, windowstart));62DEFINE(PT_SIZE, sizeof(struct pt_regs));63DEFINE(PT_AREG_END, offsetof (struct pt_regs, areg[XCHAL_NUM_AREGS]));64DEFINE(PT_USER_SIZE, offsetof(struct pt_regs, areg[XCHAL_NUM_AREGS]));65DEFINE(PT_XTREGS_OPT, offsetof(struct pt_regs, xtregs_opt));66DEFINE(XTREGS_OPT_SIZE, sizeof(xtregs_opt_t));6768/* struct task_struct */69DEFINE(TASK_PTRACE, offsetof (struct task_struct, ptrace));70DEFINE(TASK_MM, offsetof (struct task_struct, mm));71DEFINE(TASK_ACTIVE_MM, offsetof (struct task_struct, active_mm));72DEFINE(TASK_PID, offsetof (struct task_struct, pid));73DEFINE(TASK_THREAD, offsetof (struct task_struct, thread));74DEFINE(TASK_THREAD_INFO, offsetof (struct task_struct, stack));75DEFINE(TASK_STRUCT_SIZE, sizeof (struct task_struct));7677/* struct thread_info (offset from start_struct) */78DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra));79DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp));80DEFINE(THREAD_CPENABLE, offsetof (struct thread_info, cpenable));81#if XTENSA_HAVE_COPROCESSORS82DEFINE(THREAD_XTREGS_CP0, offsetof (struct thread_info, xtregs_cp));83DEFINE(THREAD_XTREGS_CP1, offsetof (struct thread_info, xtregs_cp));84DEFINE(THREAD_XTREGS_CP2, offsetof (struct thread_info, xtregs_cp));85DEFINE(THREAD_XTREGS_CP3, offsetof (struct thread_info, xtregs_cp));86DEFINE(THREAD_XTREGS_CP4, offsetof (struct thread_info, xtregs_cp));87DEFINE(THREAD_XTREGS_CP5, offsetof (struct thread_info, xtregs_cp));88DEFINE(THREAD_XTREGS_CP6, offsetof (struct thread_info, xtregs_cp));89DEFINE(THREAD_XTREGS_CP7, offsetof (struct thread_info, xtregs_cp));90#endif91DEFINE(THREAD_XTREGS_USER, offsetof (struct thread_info, xtregs_user));92DEFINE(XTREGS_USER_SIZE, sizeof(xtregs_user_t));93DEFINE(THREAD_CURRENT_DS, offsetof (struct task_struct, thread.current_ds));9495/* struct mm_struct */96DEFINE(MM_USERS, offsetof(struct mm_struct, mm_users));97DEFINE(MM_PGD, offsetof (struct mm_struct, pgd));98DEFINE(MM_CONTEXT, offsetof (struct mm_struct, context));99100/* struct page */101DEFINE(PAGE_FLAGS, offsetof(struct page, flags));102103/* constants */104DEFINE(_CLONE_VM, CLONE_VM);105DEFINE(_CLONE_UNTRACED, CLONE_UNTRACED);106DEFINE(PG_ARCH_1, PG_arch_1);107108return 0;109}110111112113