Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <linux/sched.h> |
| 7 | #include <linux/mm.h> |
| 8 | #include <linux/interrupt.h> |
| 9 | #include <linux/thread_info.h> |
| 10 | #include <linux/kbuild.h> |
Sachin Kamat | 1ec9db1 | 2013-03-06 16:53:44 +0530 | [diff] [blame] | 11 | #include <linux/ptrace.h> |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 12 | #include <asm/hardirq.h> |
| 13 | #include <asm/page.h> |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 14 | |
| 15 | int main(void) |
| 16 | { |
| 17 | DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); |
| 18 | DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, stack)); |
| 19 | |
| 20 | BLANK(); |
| 21 | |
| 22 | DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp)); |
| 23 | DEFINE(THREAD_CALLEE_REG, offsetof(struct thread_struct, callee_reg)); |
| 24 | DEFINE(THREAD_FAULT_ADDR, |
| 25 | offsetof(struct thread_struct, fault_address)); |
| 26 | |
| 27 | BLANK(); |
| 28 | |
| 29 | DEFINE(THREAD_INFO_FLAGS, offsetof(struct thread_info, flags)); |
| 30 | DEFINE(THREAD_INFO_PREEMPT_COUNT, |
| 31 | offsetof(struct thread_info, preempt_count)); |
| 32 | |
| 33 | BLANK(); |
| 34 | |
| 35 | DEFINE(TASK_ACT_MM, offsetof(struct task_struct, active_mm)); |
| 36 | DEFINE(TASK_TGID, offsetof(struct task_struct, tgid)); |
Ruud Derwig | 2924cd1 | 2014-12-03 15:52:41 +0100 | [diff] [blame] | 37 | DEFINE(TASK_PID, offsetof(struct task_struct, pid)); |
| 38 | DEFINE(TASK_COMM, offsetof(struct task_struct, comm)); |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 39 | |
| 40 | DEFINE(MM_CTXT, offsetof(struct mm_struct, context)); |
| 41 | DEFINE(MM_PGD, offsetof(struct mm_struct, pgd)); |
| 42 | |
| 43 | DEFINE(MM_CTXT_ASID, offsetof(mm_context_t, asid)); |
| 44 | |
| 45 | BLANK(); |
| 46 | |
| 47 | DEFINE(PT_status32, offsetof(struct pt_regs, status32)); |
Vineet Gupta | 502a0c7 | 2013-06-11 18:56:54 +0530 | [diff] [blame] | 48 | DEFINE(PT_event, offsetof(struct pt_regs, event)); |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 49 | DEFINE(PT_sp, offsetof(struct pt_regs, sp)); |
| 50 | DEFINE(PT_r0, offsetof(struct pt_regs, r0)); |
| 51 | DEFINE(PT_r1, offsetof(struct pt_regs, r1)); |
| 52 | DEFINE(PT_r2, offsetof(struct pt_regs, r2)); |
| 53 | DEFINE(PT_r3, offsetof(struct pt_regs, r3)); |
| 54 | DEFINE(PT_r4, offsetof(struct pt_regs, r4)); |
| 55 | DEFINE(PT_r5, offsetof(struct pt_regs, r5)); |
| 56 | DEFINE(PT_r6, offsetof(struct pt_regs, r6)); |
| 57 | DEFINE(PT_r7, offsetof(struct pt_regs, r7)); |
Vineet Gupta | a488080 | 2019-05-15 15:36:46 -0700 | [diff] [blame^] | 58 | DEFINE(PT_r8, offsetof(struct pt_regs, r8)); |
| 59 | DEFINE(PT_r10, offsetof(struct pt_regs, r10)); |
| 60 | DEFINE(PT_r26, offsetof(struct pt_regs, r26)); |
Vineet Gupta | 4255b07 | 2014-09-22 16:51:47 +0530 | [diff] [blame] | 61 | DEFINE(PT_ret, offsetof(struct pt_regs, ret)); |
Vineet Gupta | a488080 | 2019-05-15 15:36:46 -0700 | [diff] [blame^] | 62 | DEFINE(PT_blink, offsetof(struct pt_regs, blink)); |
| 63 | DEFINE(PT_lpe, offsetof(struct pt_regs, lp_end)); |
| 64 | DEFINE(PT_lpc, offsetof(struct pt_regs, lp_count)); |
| 65 | DEFINE(PT_user_r25, offsetof(struct pt_regs, user_r25)); |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 66 | |
Vineet Gupta | 16f9afe | 2013-05-27 21:43:41 +0530 | [diff] [blame] | 67 | DEFINE(SZ_CALLEE_REGS, sizeof(struct callee_regs)); |
Vineet Gupta | 359105b | 2013-05-28 13:50:41 +0530 | [diff] [blame] | 68 | DEFINE(SZ_PT_REGS, sizeof(struct pt_regs)); |
Vineet Gupta | 0d7b885 | 2014-10-07 14:12:13 +0530 | [diff] [blame] | 69 | DEFINE(PT_user_r25, offsetof(struct pt_regs, user_r25)); |
| 70 | |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 71 | return 0; |
| 72 | } |