| 1 | |
| 2 | |
| 3 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
|
| 4 |
|
| 5 | #define COMPILE_OFFSETS
|
| 6 |
|
| 7 | #include <linux/sched.h>
|
| 8 | #include <linux/mm.h>
|
| 9 | #include <linux/interrupt.h>
|
| 10 | #include <linux/thread_info.h>
|
| 11 | #include <linux/kbuild.h>
|
| 12 | #include <linux/ptrace.h>
|
| 13 | #include <asm/hardirq.h>
|
| 14 | #include <asm/page.h>
|
| 15 |
|
| 16 |
|
| 17 | int main(void)
|
| 18 | {
|
| 19 | DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
|
| 20 | DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, stack));
|
| 21 |
|
| 22 | BLANK();
|
| 23 |
|
| 24 | DEFINE(THREAD_CALLEE_REG, offsetof(struct thread_struct, callee_reg));
|
| 25 | DEFINE(THREAD_FAULT_ADDR,
|
| 26 | offsetof(struct thread_struct, fault_address));
|
| 27 |
|
| 28 | BLANK();
|
| 29 |
|
| 30 | DEFINE(THREAD_INFO_KSP, offsetof(struct thread_info, ksp));
|
| 31 | DEFINE(THREAD_INFO_FLAGS, offsetof(struct thread_info, flags));
|
| 32 | DEFINE(THREAD_INFO_PREEMPT_COUNT,
|
| 33 | offsetof(struct thread_info, preempt_count));
|
| 34 |
|
| 35 | BLANK();
|
| 36 |
|
| 37 | DEFINE(TASK_ACT_MM, offsetof(struct task_struct, active_mm));
|
| 38 | DEFINE(TASK_TGID, offsetof(struct task_struct, tgid));
|
| 39 | DEFINE(TASK_PID, offsetof(struct task_struct, pid));
|
| 40 | DEFINE(TASK_COMM, offsetof(struct task_struct, comm));
|
| 41 |
|
| 42 | DEFINE(MM_CTXT, offsetof(struct mm_struct, context));
|
| 43 | DEFINE(MM_PGD, offsetof(struct mm_struct, pgd));
|
| 44 |
|
| 45 | DEFINE(MM_CTXT_ASID, offsetof(mm_context_t, asid));
|
| 46 |
|
| 47 | BLANK();
|
| 48 |
|
| 49 | DEFINE(PT_status32, offsetof(struct pt_regs, status32));
|
| 50 | DEFINE(PT_event, offsetof(struct pt_regs, ecr));
|
| 51 | DEFINE(PT_bta, offsetof(struct pt_regs, bta));
|
| 52 | DEFINE(PT_sp, offsetof(struct pt_regs, sp));
|
| 53 | DEFINE(PT_r0, offsetof(struct pt_regs, r0));
|
| 54 | DEFINE(PT_r1, offsetof(struct pt_regs, r1));
|
| 55 | DEFINE(PT_r2, offsetof(struct pt_regs, r2));
|
| 56 | DEFINE(PT_r3, offsetof(struct pt_regs, r3));
|
| 57 | DEFINE(PT_r4, offsetof(struct pt_regs, r4));
|
| 58 | DEFINE(PT_r5, offsetof(struct pt_regs, r5));
|
| 59 | DEFINE(PT_r6, offsetof(struct pt_regs, r6));
|
| 60 | DEFINE(PT_r7, offsetof(struct pt_regs, r7));
|
| 61 | DEFINE(PT_r8, offsetof(struct pt_regs, r8));
|
| 62 | DEFINE(PT_r10, offsetof(struct pt_regs, r10));
|
| 63 | DEFINE(PT_r26, offsetof(struct pt_regs, r26));
|
| 64 | DEFINE(PT_ret, offsetof(struct pt_regs, ret));
|
| 65 | DEFINE(PT_blink, offsetof(struct pt_regs, blink));
|
| 66 | OFFSET(PT_fp, pt_regs, fp);
|
| 67 | DEFINE(PT_lpe, offsetof(struct pt_regs, lp_end));
|
| 68 | DEFINE(PT_lpc, offsetof(struct pt_regs, lp_count));
|
| 69 | #ifdef CONFIG_ISA_ARCV2
|
| 70 | OFFSET(PT_r12, pt_regs, r12);
|
| 71 | OFFSET(PT_r30, pt_regs, r30);
|
| 72 | #endif
|
| 73 | #ifdef CONFIG_ARC_HAS_ACCL_REGS
|
| 74 | OFFSET(PT_r58, pt_regs, r58);
|
| 75 | OFFSET(PT_r59, pt_regs, r59);
|
| 76 | #endif
|
| 77 | #ifdef CONFIG_ARC_DSP_SAVE_RESTORE_REGS
|
| 78 | OFFSET(PT_DSP_CTRL, pt_regs, DSP_CTRL);
|
| 79 | #endif
|
| 80 |
|
| 81 | DEFINE(SZ_CALLEE_REGS, sizeof(struct callee_regs));
|
| 82 | DEFINE(SZ_PT_REGS, sizeof(struct pt_regs));
|
| 83 |
|
| 84 | return 0;
|
| 85 | }
|