]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/xtensa/kernel/asm-offsets.c
xtensa: use kbuild.h macros instead of defining them in asm-offsets.c
[linux-2.6-omap-h63xx.git] / arch / xtensa / kernel / asm-offsets.c
index b256cfbef3447bfcc647904e7ccc1c6cdd123f21..070ff8af3a21e45a338c95dad5d0e6d8bb74907c 100644 (file)
 #include <linux/stddef.h>
 #include <linux/thread_info.h>
 #include <linux/ptrace.h>
+#include <linux/mm.h>
+#include <linux/kbuild.h>
+
 #include <asm/ptrace.h>
-#include <asm/processor.h>
 #include <asm/uaccess.h>
 
-#define DEFINE(sym, val) asm volatile("\n->" #sym " %0 " #val : : "i" (val))
-#define BLANK() asm volatile("\n->" : : )
-
 int main(void)
 {
        /* struct pt_regs */
@@ -39,6 +38,7 @@ int main(void)
        DEFINE(PT_LEND, offsetof (struct pt_regs, lend));
        DEFINE(PT_LCOUNT, offsetof (struct pt_regs, lcount));
        DEFINE(PT_SAR, offsetof (struct pt_regs, sar));
+       DEFINE(PT_ICOUNTLEVEL, offsetof (struct pt_regs, icountlevel));
        DEFINE(PT_SYSCALL, offsetof (struct pt_regs, syscall));
        DEFINE(PT_AREG, offsetof (struct pt_regs, areg[0]));
        DEFINE(PT_AREG0, offsetof (struct pt_regs, areg[0]));
@@ -62,7 +62,8 @@ int main(void)
        DEFINE(PT_SIZE, sizeof(struct pt_regs));
        DEFINE(PT_AREG_END, offsetof (struct pt_regs, areg[XCHAL_NUM_AREGS]));
        DEFINE(PT_USER_SIZE, offsetof(struct pt_regs, areg[XCHAL_NUM_AREGS]));
-       BLANK();
+       DEFINE(PT_XTREGS_OPT, offsetof(struct pt_regs, xtregs_opt));
+       DEFINE(XTREGS_OPT_SIZE, sizeof(xtregs_opt_t));
 
        /* struct task_struct */
        DEFINE(TASK_PTRACE, offsetof (struct task_struct, ptrace));
@@ -70,29 +71,40 @@ int main(void)
        DEFINE(TASK_ACTIVE_MM, offsetof (struct task_struct, active_mm));
        DEFINE(TASK_PID, offsetof (struct task_struct, pid));
        DEFINE(TASK_THREAD, offsetof (struct task_struct, thread));
-       DEFINE(TASK_THREAD_INFO, offsetof (struct task_struct, thread_info));
+       DEFINE(TASK_THREAD_INFO, offsetof (struct task_struct, stack));
        DEFINE(TASK_STRUCT_SIZE, sizeof (struct task_struct));
-       BLANK();
 
        /* struct thread_info (offset from start_struct) */
        DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra));
        DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp));
-       DEFINE(THREAD_CP_SAVE, offsetof (struct task_struct, thread.cp_save));
+       DEFINE(THREAD_CPENABLE, offsetof (struct thread_info, cpenable));
+#if XTENSA_HAVE_COPROCESSORS
+       DEFINE(THREAD_XTREGS_CP0, offsetof (struct thread_info, xtregs_cp));
+       DEFINE(THREAD_XTREGS_CP1, offsetof (struct thread_info, xtregs_cp));
+       DEFINE(THREAD_XTREGS_CP2, offsetof (struct thread_info, xtregs_cp));
+       DEFINE(THREAD_XTREGS_CP3, offsetof (struct thread_info, xtregs_cp));
+       DEFINE(THREAD_XTREGS_CP4, offsetof (struct thread_info, xtregs_cp));
+       DEFINE(THREAD_XTREGS_CP5, offsetof (struct thread_info, xtregs_cp));
+       DEFINE(THREAD_XTREGS_CP6, offsetof (struct thread_info, xtregs_cp));
+       DEFINE(THREAD_XTREGS_CP7, offsetof (struct thread_info, xtregs_cp));
+#endif
+       DEFINE(THREAD_XTREGS_USER, offsetof (struct thread_info, xtregs_user));
+       DEFINE(XTREGS_USER_SIZE, sizeof(xtregs_user_t));
        DEFINE(THREAD_CURRENT_DS, offsetof (struct task_struct, thread.current_ds));
-       BLANK();
 
        /* struct mm_struct */
        DEFINE(MM_USERS, offsetof(struct mm_struct, mm_users));
        DEFINE(MM_PGD, offsetof (struct mm_struct, pgd));
        DEFINE(MM_CONTEXT, offsetof (struct mm_struct, context));
-       BLANK();
-       DEFINE(PT_SINGLESTEP_BIT, PT_SINGLESTEP_BIT);
+
+       /* struct page */
+       DEFINE(PAGE_FLAGS, offsetof(struct page, flags));
 
        /* constants */
        DEFINE(_CLONE_VM, CLONE_VM);
        DEFINE(_CLONE_UNTRACED, CLONE_UNTRACED);
+       DEFINE(PG_ARCH_1, PG_arch_1);
 
        return 0;
 }
 
-