2 * arch/xtensa/kernel/asm-offsets.c
4 * Generates definitions from c-type structures used by assembly sources.
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
10 * Copyright (C) 2005 Tensilica Inc.
12 * Chris Zankel <chris@zankel.net>
15 #include <asm/processor.h>
17 #include <linux/types.h>
18 #include <linux/stddef.h>
19 #include <linux/thread_info.h>
20 #include <linux/ptrace.h>
23 #include <asm/ptrace.h>
24 <<<<<<< HEAD
:arch
/xtensa
/kernel
/asm-offsets
.c
25 #include <asm/processor.h>
27 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:arch
/xtensa
/kernel
/asm-offsets
.c
28 #include <asm/uaccess.h>
30 #define DEFINE(sym, val) asm volatile("\n->" #sym " %0 " #val : : "i" (val))
35 DEFINE(PT_PC
, offsetof (struct pt_regs
, pc
));
36 DEFINE(PT_PS
, offsetof (struct pt_regs
, ps
));
37 DEFINE(PT_DEPC
, offsetof (struct pt_regs
, depc
));
38 DEFINE(PT_EXCCAUSE
, offsetof (struct pt_regs
, exccause
));
39 DEFINE(PT_EXCVADDR
, offsetof (struct pt_regs
, excvaddr
));
40 DEFINE(PT_DEBUGCAUSE
, offsetof (struct pt_regs
, debugcause
));
41 DEFINE(PT_WMASK
, offsetof (struct pt_regs
, wmask
));
42 DEFINE(PT_LBEG
, offsetof (struct pt_regs
, lbeg
));
43 DEFINE(PT_LEND
, offsetof (struct pt_regs
, lend
));
44 DEFINE(PT_LCOUNT
, offsetof (struct pt_regs
, lcount
));
45 DEFINE(PT_SAR
, offsetof (struct pt_regs
, sar
));
46 DEFINE(PT_ICOUNTLEVEL
, offsetof (struct pt_regs
, icountlevel
));
47 DEFINE(PT_SYSCALL
, offsetof (struct pt_regs
, syscall
));
48 DEFINE(PT_AREG
, offsetof (struct pt_regs
, areg
[0]));
49 DEFINE(PT_AREG0
, offsetof (struct pt_regs
, areg
[0]));
50 DEFINE(PT_AREG1
, offsetof (struct pt_regs
, areg
[1]));
51 DEFINE(PT_AREG2
, offsetof (struct pt_regs
, areg
[2]));
52 DEFINE(PT_AREG3
, offsetof (struct pt_regs
, areg
[3]));
53 DEFINE(PT_AREG4
, offsetof (struct pt_regs
, areg
[4]));
54 DEFINE(PT_AREG5
, offsetof (struct pt_regs
, areg
[5]));
55 DEFINE(PT_AREG6
, offsetof (struct pt_regs
, areg
[6]));
56 DEFINE(PT_AREG7
, offsetof (struct pt_regs
, areg
[7]));
57 DEFINE(PT_AREG8
, offsetof (struct pt_regs
, areg
[8]));
58 DEFINE(PT_AREG9
, offsetof (struct pt_regs
, areg
[9]));
59 DEFINE(PT_AREG10
, offsetof (struct pt_regs
, areg
[10]));
60 DEFINE(PT_AREG11
, offsetof (struct pt_regs
, areg
[11]));
61 DEFINE(PT_AREG12
, offsetof (struct pt_regs
, areg
[12]));
62 DEFINE(PT_AREG13
, offsetof (struct pt_regs
, areg
[13]));
63 DEFINE(PT_AREG14
, offsetof (struct pt_regs
, areg
[14]));
64 DEFINE(PT_AREG15
, offsetof (struct pt_regs
, areg
[15]));
65 DEFINE(PT_WINDOWBASE
, offsetof (struct pt_regs
, windowbase
));
66 DEFINE(PT_WINDOWSTART
, offsetof(struct pt_regs
, windowstart
));
67 DEFINE(PT_SIZE
, sizeof(struct pt_regs
));
68 DEFINE(PT_AREG_END
, offsetof (struct pt_regs
, areg
[XCHAL_NUM_AREGS
]));
69 DEFINE(PT_USER_SIZE
, offsetof(struct pt_regs
, areg
[XCHAL_NUM_AREGS
]));
70 <<<<<<< HEAD
:arch
/xtensa
/kernel
/asm-offsets
.c
72 DEFINE(PT_XTREGS_OPT
, offsetof(struct pt_regs
, xtregs_opt
));
73 DEFINE(XTREGS_OPT_SIZE
, sizeof(xtregs_opt_t
));
74 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:arch
/xtensa
/kernel
/asm-offsets
.c
76 /* struct task_struct */
77 DEFINE(TASK_PTRACE
, offsetof (struct task_struct
, ptrace
));
78 DEFINE(TASK_MM
, offsetof (struct task_struct
, mm
));
79 DEFINE(TASK_ACTIVE_MM
, offsetof (struct task_struct
, active_mm
));
80 DEFINE(TASK_PID
, offsetof (struct task_struct
, pid
));
81 DEFINE(TASK_THREAD
, offsetof (struct task_struct
, thread
));
82 DEFINE(TASK_THREAD_INFO
, offsetof (struct task_struct
, stack
));
83 DEFINE(TASK_STRUCT_SIZE
, sizeof (struct task_struct
));
85 /* struct thread_info (offset from start_struct) */
86 DEFINE(THREAD_RA
, offsetof (struct task_struct
, thread
.ra
));
87 DEFINE(THREAD_SP
, offsetof (struct task_struct
, thread
.sp
));
88 <<<<<<< HEAD
:arch
/xtensa
/kernel
/asm-offsets
.c
89 DEFINE(THREAD_CP_SAVE
, offsetof (struct task_struct
, thread
.cp_save
));
91 DEFINE(THREAD_CPENABLE
, offsetof (struct thread_info
, cpenable
));
92 #if XTENSA_HAVE_COPROCESSORS
93 DEFINE(THREAD_XTREGS_CP0
, offsetof (struct thread_info
, xtregs_cp
));
94 DEFINE(THREAD_XTREGS_CP1
, offsetof (struct thread_info
, xtregs_cp
));
95 DEFINE(THREAD_XTREGS_CP2
, offsetof (struct thread_info
, xtregs_cp
));
96 DEFINE(THREAD_XTREGS_CP3
, offsetof (struct thread_info
, xtregs_cp
));
97 DEFINE(THREAD_XTREGS_CP4
, offsetof (struct thread_info
, xtregs_cp
));
98 DEFINE(THREAD_XTREGS_CP5
, offsetof (struct thread_info
, xtregs_cp
));
99 DEFINE(THREAD_XTREGS_CP6
, offsetof (struct thread_info
, xtregs_cp
));
100 DEFINE(THREAD_XTREGS_CP7
, offsetof (struct thread_info
, xtregs_cp
));
102 DEFINE(THREAD_XTREGS_USER
, offsetof (struct thread_info
, xtregs_user
));
103 DEFINE(XTREGS_USER_SIZE
, sizeof(xtregs_user_t
));
104 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:arch
/xtensa
/kernel
/asm-offsets
.c
105 DEFINE(THREAD_CURRENT_DS
, offsetof (struct task_struct
, thread
.current_ds
));
107 /* struct mm_struct */
108 DEFINE(MM_USERS
, offsetof(struct mm_struct
, mm_users
));
109 DEFINE(MM_PGD
, offsetof (struct mm_struct
, pgd
));
110 DEFINE(MM_CONTEXT
, offsetof (struct mm_struct
, context
));
113 DEFINE(PAGE_FLAGS
, offsetof(struct page
, flags
));
116 DEFINE(_CLONE_VM
, CLONE_VM
);
117 DEFINE(_CLONE_UNTRACED
, CLONE_UNTRACED
);
118 DEFINE(PG_ARCH_1
, PG_arch_1
);