xref: /linux/arch/riscv/kernel/asm-offsets.c (revision a031e154043984cc5a073c1b7fe62abdbe25c0c6)
150acfb2bSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
27db91e57SPalmer Dabbelt /*
37db91e57SPalmer Dabbelt  * Copyright (C) 2012 Regents of the University of California
47db91e57SPalmer Dabbelt  * Copyright (C) 2017 SiFive
57db91e57SPalmer Dabbelt  */
67db91e57SPalmer Dabbelt 
77db91e57SPalmer Dabbelt #include <linux/kbuild.h>
834bde9d8SAnup Patel #include <linux/mm.h>
97db91e57SPalmer Dabbelt #include <linux/sched.h>
107caa9765SPuranjay Mohan #include <linux/ftrace.h>
11c0317210SSia Jee Heng #include <linux/suspend.h>
1234bde9d8SAnup Patel #include <asm/kvm_host.h>
137db91e57SPalmer Dabbelt #include <asm/thread_info.h>
147db91e57SPalmer Dabbelt #include <asm/ptrace.h>
159a2451f1SAtish Patra #include <asm/cpu_ops_sbi.h>
1682982fddSSami Tolvanen #include <asm/stacktrace.h>
1763b13e64SAnup Patel #include <asm/suspend.h>
187db91e57SPalmer Dabbelt 
193ae9c3cdSSouptick Joarder void asm_offsets(void);
203ae9c3cdSSouptick Joarder 
asm_offsets(void)217db91e57SPalmer Dabbelt void asm_offsets(void)
227db91e57SPalmer Dabbelt {
237db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_RA, task_struct, thread.ra);
247db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_SP, task_struct, thread.sp);
257db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_S0, task_struct, thread.s[0]);
267db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_S1, task_struct, thread.s[1]);
277db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_S2, task_struct, thread.s[2]);
287db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_S3, task_struct, thread.s[3]);
297db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_S4, task_struct, thread.s[4]);
307db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_S5, task_struct, thread.s[5]);
317db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_S6, task_struct, thread.s[6]);
327db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_S7, task_struct, thread.s[7]);
337db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_S8, task_struct, thread.s[8]);
347db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_S9, task_struct, thread.s[9]);
357db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_S10, task_struct, thread.s[10]);
367db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_S11, task_struct, thread.s[11]);
37*503638e0SAlexandre Ghiti 
38*503638e0SAlexandre Ghiti 	OFFSET(TASK_TI_CPU, task_struct, thread_info.cpu);
397db91e57SPalmer Dabbelt 	OFFSET(TASK_TI_FLAGS, task_struct, thread_info.flags);
4099fd6e87SVincent Chen 	OFFSET(TASK_TI_PREEMPT_COUNT, task_struct, thread_info.preempt_count);
417db91e57SPalmer Dabbelt 	OFFSET(TASK_TI_KERNEL_SP, task_struct, thread_info.kernel_sp);
427db91e57SPalmer Dabbelt 	OFFSET(TASK_TI_USER_SP, task_struct, thread_info.user_sp);
43d1584d79SSami Tolvanen #ifdef CONFIG_SHADOW_CALL_STACK
44d1584d79SSami Tolvanen 	OFFSET(TASK_TI_SCS_SP, task_struct, thread_info.scs_sp);
45d1584d79SSami Tolvanen #endif
46*503638e0SAlexandre Ghiti #ifdef CONFIG_64BIT
47*503638e0SAlexandre Ghiti 	OFFSET(TASK_TI_A0, task_struct, thread_info.a0);
48*503638e0SAlexandre Ghiti 	OFFSET(TASK_TI_A1, task_struct, thread_info.a1);
49*503638e0SAlexandre Ghiti 	OFFSET(TASK_TI_A2, task_struct, thread_info.a2);
50*503638e0SAlexandre Ghiti #endif
517db91e57SPalmer Dabbelt 
52be97d0dbSDeepak Gupta 	OFFSET(TASK_TI_CPU_NUM, task_struct, thread_info.cpu);
537db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F0,  task_struct, thread.fstate.f[0]);
547db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F1,  task_struct, thread.fstate.f[1]);
557db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F2,  task_struct, thread.fstate.f[2]);
567db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F3,  task_struct, thread.fstate.f[3]);
577db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F4,  task_struct, thread.fstate.f[4]);
587db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F5,  task_struct, thread.fstate.f[5]);
597db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F6,  task_struct, thread.fstate.f[6]);
607db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F7,  task_struct, thread.fstate.f[7]);
617db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F8,  task_struct, thread.fstate.f[8]);
627db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F9,  task_struct, thread.fstate.f[9]);
637db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F10, task_struct, thread.fstate.f[10]);
647db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F11, task_struct, thread.fstate.f[11]);
657db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F12, task_struct, thread.fstate.f[12]);
667db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F13, task_struct, thread.fstate.f[13]);
677db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F14, task_struct, thread.fstate.f[14]);
687db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F15, task_struct, thread.fstate.f[15]);
697db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F16, task_struct, thread.fstate.f[16]);
707db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F17, task_struct, thread.fstate.f[17]);
717db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F18, task_struct, thread.fstate.f[18]);
727db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F19, task_struct, thread.fstate.f[19]);
737db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F20, task_struct, thread.fstate.f[20]);
747db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F21, task_struct, thread.fstate.f[21]);
757db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F22, task_struct, thread.fstate.f[22]);
767db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F23, task_struct, thread.fstate.f[23]);
777db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F24, task_struct, thread.fstate.f[24]);
787db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F25, task_struct, thread.fstate.f[25]);
797db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F26, task_struct, thread.fstate.f[26]);
807db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F27, task_struct, thread.fstate.f[27]);
817db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F28, task_struct, thread.fstate.f[28]);
827db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F29, task_struct, thread.fstate.f[29]);
837db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F30, task_struct, thread.fstate.f[30]);
847db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_F31, task_struct, thread.fstate.f[31]);
857db91e57SPalmer Dabbelt 	OFFSET(TASK_THREAD_FCSR, task_struct, thread.fstate.fcsr);
86fea2fed2SGuo Ren #ifdef CONFIG_STACKPROTECTOR
87fea2fed2SGuo Ren 	OFFSET(TSK_STACK_CANARY, task_struct, stack_canary);
88fea2fed2SGuo Ren #endif
897db91e57SPalmer Dabbelt 
907db91e57SPalmer Dabbelt 	DEFINE(PT_SIZE, sizeof(struct pt_regs));
91a4c3733dSChristoph Hellwig 	OFFSET(PT_EPC, pt_regs, epc);
927db91e57SPalmer Dabbelt 	OFFSET(PT_RA, pt_regs, ra);
937db91e57SPalmer Dabbelt 	OFFSET(PT_FP, pt_regs, s0);
947db91e57SPalmer Dabbelt 	OFFSET(PT_S0, pt_regs, s0);
957db91e57SPalmer Dabbelt 	OFFSET(PT_S1, pt_regs, s1);
967db91e57SPalmer Dabbelt 	OFFSET(PT_S2, pt_regs, s2);
977db91e57SPalmer Dabbelt 	OFFSET(PT_S3, pt_regs, s3);
987db91e57SPalmer Dabbelt 	OFFSET(PT_S4, pt_regs, s4);
997db91e57SPalmer Dabbelt 	OFFSET(PT_S5, pt_regs, s5);
1007db91e57SPalmer Dabbelt 	OFFSET(PT_S6, pt_regs, s6);
1017db91e57SPalmer Dabbelt 	OFFSET(PT_S7, pt_regs, s7);
1027db91e57SPalmer Dabbelt 	OFFSET(PT_S8, pt_regs, s8);
1037db91e57SPalmer Dabbelt 	OFFSET(PT_S9, pt_regs, s9);
1047db91e57SPalmer Dabbelt 	OFFSET(PT_S10, pt_regs, s10);
1057db91e57SPalmer Dabbelt 	OFFSET(PT_S11, pt_regs, s11);
1067db91e57SPalmer Dabbelt 	OFFSET(PT_SP, pt_regs, sp);
1077db91e57SPalmer Dabbelt 	OFFSET(PT_TP, pt_regs, tp);
1087db91e57SPalmer Dabbelt 	OFFSET(PT_A0, pt_regs, a0);
1097db91e57SPalmer Dabbelt 	OFFSET(PT_A1, pt_regs, a1);
1107db91e57SPalmer Dabbelt 	OFFSET(PT_A2, pt_regs, a2);
1117db91e57SPalmer Dabbelt 	OFFSET(PT_A3, pt_regs, a3);
1127db91e57SPalmer Dabbelt 	OFFSET(PT_A4, pt_regs, a4);
1137db91e57SPalmer Dabbelt 	OFFSET(PT_A5, pt_regs, a5);
1147db91e57SPalmer Dabbelt 	OFFSET(PT_A6, pt_regs, a6);
1157db91e57SPalmer Dabbelt 	OFFSET(PT_A7, pt_regs, a7);
1167db91e57SPalmer Dabbelt 	OFFSET(PT_T0, pt_regs, t0);
1177db91e57SPalmer Dabbelt 	OFFSET(PT_T1, pt_regs, t1);
1187db91e57SPalmer Dabbelt 	OFFSET(PT_T2, pt_regs, t2);
1197db91e57SPalmer Dabbelt 	OFFSET(PT_T3, pt_regs, t3);
1207db91e57SPalmer Dabbelt 	OFFSET(PT_T4, pt_regs, t4);
1217db91e57SPalmer Dabbelt 	OFFSET(PT_T5, pt_regs, t5);
1227db91e57SPalmer Dabbelt 	OFFSET(PT_T6, pt_regs, t6);
1237db91e57SPalmer Dabbelt 	OFFSET(PT_GP, pt_regs, gp);
1247db91e57SPalmer Dabbelt 	OFFSET(PT_ORIG_A0, pt_regs, orig_a0);
125a4c3733dSChristoph Hellwig 	OFFSET(PT_STATUS, pt_regs, status);
126a4c3733dSChristoph Hellwig 	OFFSET(PT_BADADDR, pt_regs, badaddr);
127a4c3733dSChristoph Hellwig 	OFFSET(PT_CAUSE, pt_regs, cause);
1287db91e57SPalmer Dabbelt 
12963b13e64SAnup Patel 	OFFSET(SUSPEND_CONTEXT_REGS, suspend_context, regs);
13063b13e64SAnup Patel 
131c0317210SSia Jee Heng 	OFFSET(HIBERN_PBE_ADDR, pbe, address);
132c0317210SSia Jee Heng 	OFFSET(HIBERN_PBE_ORIG, pbe, orig_address);
133c0317210SSia Jee Heng 	OFFSET(HIBERN_PBE_NEXT, pbe, next);
134c0317210SSia Jee Heng 
13534bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_ZERO, kvm_vcpu_arch, guest_context.zero);
13634bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_RA, kvm_vcpu_arch, guest_context.ra);
13734bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_SP, kvm_vcpu_arch, guest_context.sp);
13834bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_GP, kvm_vcpu_arch, guest_context.gp);
13934bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_TP, kvm_vcpu_arch, guest_context.tp);
14034bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_T0, kvm_vcpu_arch, guest_context.t0);
14134bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_T1, kvm_vcpu_arch, guest_context.t1);
14234bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_T2, kvm_vcpu_arch, guest_context.t2);
14334bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_S0, kvm_vcpu_arch, guest_context.s0);
14434bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_S1, kvm_vcpu_arch, guest_context.s1);
14534bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_A0, kvm_vcpu_arch, guest_context.a0);
14634bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_A1, kvm_vcpu_arch, guest_context.a1);
14734bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_A2, kvm_vcpu_arch, guest_context.a2);
14834bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_A3, kvm_vcpu_arch, guest_context.a3);
14934bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_A4, kvm_vcpu_arch, guest_context.a4);
15034bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_A5, kvm_vcpu_arch, guest_context.a5);
15134bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_A6, kvm_vcpu_arch, guest_context.a6);
15234bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_A7, kvm_vcpu_arch, guest_context.a7);
15334bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_S2, kvm_vcpu_arch, guest_context.s2);
15434bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_S3, kvm_vcpu_arch, guest_context.s3);
15534bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_S4, kvm_vcpu_arch, guest_context.s4);
15634bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_S5, kvm_vcpu_arch, guest_context.s5);
15734bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_S6, kvm_vcpu_arch, guest_context.s6);
15834bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_S7, kvm_vcpu_arch, guest_context.s7);
15934bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_S8, kvm_vcpu_arch, guest_context.s8);
16034bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_S9, kvm_vcpu_arch, guest_context.s9);
16134bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_S10, kvm_vcpu_arch, guest_context.s10);
16234bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_S11, kvm_vcpu_arch, guest_context.s11);
16334bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_T3, kvm_vcpu_arch, guest_context.t3);
16434bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_T4, kvm_vcpu_arch, guest_context.t4);
16534bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_T5, kvm_vcpu_arch, guest_context.t5);
16634bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_T6, kvm_vcpu_arch, guest_context.t6);
16734bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_SEPC, kvm_vcpu_arch, guest_context.sepc);
16834bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_SSTATUS, kvm_vcpu_arch, guest_context.sstatus);
16934bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_HSTATUS, kvm_vcpu_arch, guest_context.hstatus);
17034bde9d8SAnup Patel 	OFFSET(KVM_ARCH_GUEST_SCOUNTEREN, kvm_vcpu_arch, guest_csr.scounteren);
17134bde9d8SAnup Patel 
17234bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_ZERO, kvm_vcpu_arch, host_context.zero);
17334bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_RA, kvm_vcpu_arch, host_context.ra);
17434bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_SP, kvm_vcpu_arch, host_context.sp);
17534bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_GP, kvm_vcpu_arch, host_context.gp);
17634bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_TP, kvm_vcpu_arch, host_context.tp);
17734bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_T0, kvm_vcpu_arch, host_context.t0);
17834bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_T1, kvm_vcpu_arch, host_context.t1);
17934bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_T2, kvm_vcpu_arch, host_context.t2);
18034bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_S0, kvm_vcpu_arch, host_context.s0);
18134bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_S1, kvm_vcpu_arch, host_context.s1);
18234bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_A0, kvm_vcpu_arch, host_context.a0);
18334bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_A1, kvm_vcpu_arch, host_context.a1);
18434bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_A2, kvm_vcpu_arch, host_context.a2);
18534bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_A3, kvm_vcpu_arch, host_context.a3);
18634bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_A4, kvm_vcpu_arch, host_context.a4);
18734bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_A5, kvm_vcpu_arch, host_context.a5);
18834bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_A6, kvm_vcpu_arch, host_context.a6);
18934bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_A7, kvm_vcpu_arch, host_context.a7);
19034bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_S2, kvm_vcpu_arch, host_context.s2);
19134bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_S3, kvm_vcpu_arch, host_context.s3);
19234bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_S4, kvm_vcpu_arch, host_context.s4);
19334bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_S5, kvm_vcpu_arch, host_context.s5);
19434bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_S6, kvm_vcpu_arch, host_context.s6);
19534bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_S7, kvm_vcpu_arch, host_context.s7);
19634bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_S8, kvm_vcpu_arch, host_context.s8);
19734bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_S9, kvm_vcpu_arch, host_context.s9);
19834bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_S10, kvm_vcpu_arch, host_context.s10);
19934bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_S11, kvm_vcpu_arch, host_context.s11);
20034bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_T3, kvm_vcpu_arch, host_context.t3);
20134bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_T4, kvm_vcpu_arch, host_context.t4);
20234bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_T5, kvm_vcpu_arch, host_context.t5);
20334bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_T6, kvm_vcpu_arch, host_context.t6);
20434bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_SEPC, kvm_vcpu_arch, host_context.sepc);
20534bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_SSTATUS, kvm_vcpu_arch, host_context.sstatus);
20634bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_HSTATUS, kvm_vcpu_arch, host_context.hstatus);
20734bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_SSCRATCH, kvm_vcpu_arch, host_sscratch);
20834bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_STVEC, kvm_vcpu_arch, host_stvec);
20934bde9d8SAnup Patel 	OFFSET(KVM_ARCH_HOST_SCOUNTEREN, kvm_vcpu_arch, host_scounteren);
21034bde9d8SAnup Patel 
2119f701326SAnup Patel 	OFFSET(KVM_ARCH_TRAP_SEPC, kvm_cpu_trap, sepc);
2129f701326SAnup Patel 	OFFSET(KVM_ARCH_TRAP_SCAUSE, kvm_cpu_trap, scause);
2139f701326SAnup Patel 	OFFSET(KVM_ARCH_TRAP_STVAL, kvm_cpu_trap, stval);
2149f701326SAnup Patel 	OFFSET(KVM_ARCH_TRAP_HTVAL, kvm_cpu_trap, htval);
2159f701326SAnup Patel 	OFFSET(KVM_ARCH_TRAP_HTINST, kvm_cpu_trap, htinst);
2169f701326SAnup Patel 
2175de52d4aSAtish Patra 	/* F extension */
2185de52d4aSAtish Patra 
2195de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F0, kvm_cpu_context, fp.f.f[0]);
2205de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F1, kvm_cpu_context, fp.f.f[1]);
2215de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F2, kvm_cpu_context, fp.f.f[2]);
2225de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F3, kvm_cpu_context, fp.f.f[3]);
2235de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F4, kvm_cpu_context, fp.f.f[4]);
2245de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F5, kvm_cpu_context, fp.f.f[5]);
2255de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F6, kvm_cpu_context, fp.f.f[6]);
2265de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F7, kvm_cpu_context, fp.f.f[7]);
2275de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F8, kvm_cpu_context, fp.f.f[8]);
2285de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F9, kvm_cpu_context, fp.f.f[9]);
2295de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F10, kvm_cpu_context, fp.f.f[10]);
2305de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F11, kvm_cpu_context, fp.f.f[11]);
2315de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F12, kvm_cpu_context, fp.f.f[12]);
2325de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F13, kvm_cpu_context, fp.f.f[13]);
2335de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F14, kvm_cpu_context, fp.f.f[14]);
2345de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F15, kvm_cpu_context, fp.f.f[15]);
2355de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F16, kvm_cpu_context, fp.f.f[16]);
2365de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F17, kvm_cpu_context, fp.f.f[17]);
2375de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F18, kvm_cpu_context, fp.f.f[18]);
2385de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F19, kvm_cpu_context, fp.f.f[19]);
2395de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F20, kvm_cpu_context, fp.f.f[20]);
2405de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F21, kvm_cpu_context, fp.f.f[21]);
2415de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F22, kvm_cpu_context, fp.f.f[22]);
2425de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F23, kvm_cpu_context, fp.f.f[23]);
2435de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F24, kvm_cpu_context, fp.f.f[24]);
2445de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F25, kvm_cpu_context, fp.f.f[25]);
2455de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F26, kvm_cpu_context, fp.f.f[26]);
2465de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F27, kvm_cpu_context, fp.f.f[27]);
2475de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F28, kvm_cpu_context, fp.f.f[28]);
2485de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F29, kvm_cpu_context, fp.f.f[29]);
2495de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F30, kvm_cpu_context, fp.f.f[30]);
2505de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_F31, kvm_cpu_context, fp.f.f[31]);
2515de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_F_FCSR, kvm_cpu_context, fp.f.fcsr);
2525de52d4aSAtish Patra 
2535de52d4aSAtish Patra 	/* D extension */
2545de52d4aSAtish Patra 
2555de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F0, kvm_cpu_context, fp.d.f[0]);
2565de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F1, kvm_cpu_context, fp.d.f[1]);
2575de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F2, kvm_cpu_context, fp.d.f[2]);
2585de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F3, kvm_cpu_context, fp.d.f[3]);
2595de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F4, kvm_cpu_context, fp.d.f[4]);
2605de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F5, kvm_cpu_context, fp.d.f[5]);
2615de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F6, kvm_cpu_context, fp.d.f[6]);
2625de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F7, kvm_cpu_context, fp.d.f[7]);
2635de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F8, kvm_cpu_context, fp.d.f[8]);
2645de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F9, kvm_cpu_context, fp.d.f[9]);
2655de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F10, kvm_cpu_context, fp.d.f[10]);
2665de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F11, kvm_cpu_context, fp.d.f[11]);
2675de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F12, kvm_cpu_context, fp.d.f[12]);
2685de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F13, kvm_cpu_context, fp.d.f[13]);
2695de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F14, kvm_cpu_context, fp.d.f[14]);
2705de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F15, kvm_cpu_context, fp.d.f[15]);
2715de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F16, kvm_cpu_context, fp.d.f[16]);
2725de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F17, kvm_cpu_context, fp.d.f[17]);
2735de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F18, kvm_cpu_context, fp.d.f[18]);
2745de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F19, kvm_cpu_context, fp.d.f[19]);
2755de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F20, kvm_cpu_context, fp.d.f[20]);
2765de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F21, kvm_cpu_context, fp.d.f[21]);
2775de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F22, kvm_cpu_context, fp.d.f[22]);
2785de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F23, kvm_cpu_context, fp.d.f[23]);
2795de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F24, kvm_cpu_context, fp.d.f[24]);
2805de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F25, kvm_cpu_context, fp.d.f[25]);
2815de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F26, kvm_cpu_context, fp.d.f[26]);
2825de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F27, kvm_cpu_context, fp.d.f[27]);
2835de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F28, kvm_cpu_context, fp.d.f[28]);
2845de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F29, kvm_cpu_context, fp.d.f[29]);
2855de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F30, kvm_cpu_context, fp.d.f[30]);
2865de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_F31, kvm_cpu_context, fp.d.f[31]);
2875de52d4aSAtish Patra 	OFFSET(KVM_ARCH_FP_D_FCSR, kvm_cpu_context, fp.d.fcsr);
2885de52d4aSAtish Patra 
2897db91e57SPalmer Dabbelt 	/*
2907db91e57SPalmer Dabbelt 	 * THREAD_{F,X}* might be larger than a S-type offset can handle, but
2917db91e57SPalmer Dabbelt 	 * these are used in performance-sensitive assembly so we can't resort
2927db91e57SPalmer Dabbelt 	 * to loading the long immediate every time.
2937db91e57SPalmer Dabbelt 	 */
2947db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_RA_RA,
2957db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.ra)
2967db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
2977db91e57SPalmer Dabbelt 	);
2987db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_SP_RA,
2997db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.sp)
3007db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3017db91e57SPalmer Dabbelt 	);
3027db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_S0_RA,
3037db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.s[0])
3047db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3057db91e57SPalmer Dabbelt 	);
3067db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_S1_RA,
3077db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.s[1])
3087db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3097db91e57SPalmer Dabbelt 	);
3107db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_S2_RA,
3117db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.s[2])
3127db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3137db91e57SPalmer Dabbelt 	);
3147db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_S3_RA,
3157db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.s[3])
3167db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3177db91e57SPalmer Dabbelt 	);
3187db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_S4_RA,
3197db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.s[4])
3207db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3217db91e57SPalmer Dabbelt 	);
3227db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_S5_RA,
3237db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.s[5])
3247db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3257db91e57SPalmer Dabbelt 	);
3267db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_S6_RA,
3277db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.s[6])
3287db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3297db91e57SPalmer Dabbelt 	);
3307db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_S7_RA,
3317db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.s[7])
3327db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3337db91e57SPalmer Dabbelt 	);
3347db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_S8_RA,
3357db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.s[8])
3367db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3377db91e57SPalmer Dabbelt 	);
3387db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_S9_RA,
3397db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.s[9])
3407db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3417db91e57SPalmer Dabbelt 	);
3427db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_S10_RA,
3437db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.s[10])
3447db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3457db91e57SPalmer Dabbelt 	);
3467db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_S11_RA,
3477db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.s[11])
3487db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.ra)
3497db91e57SPalmer Dabbelt 	);
3507db91e57SPalmer Dabbelt 
3517db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F0_F0,
3527db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[0])
3537db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
3547db91e57SPalmer Dabbelt 	);
3557db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F1_F0,
3567db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[1])
3577db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
3587db91e57SPalmer Dabbelt 	);
3597db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F2_F0,
3607db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[2])
3617db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
3627db91e57SPalmer Dabbelt 	);
3637db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F3_F0,
3647db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[3])
3657db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
3667db91e57SPalmer Dabbelt 	);
3677db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F4_F0,
3687db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[4])
3697db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
3707db91e57SPalmer Dabbelt 	);
3717db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F5_F0,
3727db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[5])
3737db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
3747db91e57SPalmer Dabbelt 	);
3757db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F6_F0,
3767db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[6])
3777db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
3787db91e57SPalmer Dabbelt 	);
3797db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F7_F0,
3807db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[7])
3817db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
3827db91e57SPalmer Dabbelt 	);
3837db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F8_F0,
3847db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[8])
3857db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
3867db91e57SPalmer Dabbelt 	);
3877db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F9_F0,
3887db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[9])
3897db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
3907db91e57SPalmer Dabbelt 	);
3917db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F10_F0,
3927db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[10])
3937db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
3947db91e57SPalmer Dabbelt 	);
3957db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F11_F0,
3967db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[11])
3977db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
3987db91e57SPalmer Dabbelt 	);
3997db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F12_F0,
4007db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[12])
4017db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4027db91e57SPalmer Dabbelt 	);
4037db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F13_F0,
4047db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[13])
4057db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4067db91e57SPalmer Dabbelt 	);
4077db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F14_F0,
4087db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[14])
4097db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4107db91e57SPalmer Dabbelt 	);
4117db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F15_F0,
4127db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[15])
4137db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4147db91e57SPalmer Dabbelt 	);
4157db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F16_F0,
4167db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[16])
4177db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4187db91e57SPalmer Dabbelt 	);
4197db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F17_F0,
4207db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[17])
4217db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4227db91e57SPalmer Dabbelt 	);
4237db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F18_F0,
4247db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[18])
4257db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4267db91e57SPalmer Dabbelt 	);
4277db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F19_F0,
4287db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[19])
4297db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4307db91e57SPalmer Dabbelt 	);
4317db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F20_F0,
4327db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[20])
4337db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4347db91e57SPalmer Dabbelt 	);
4357db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F21_F0,
4367db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[21])
4377db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4387db91e57SPalmer Dabbelt 	);
4397db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F22_F0,
4407db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[22])
4417db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4427db91e57SPalmer Dabbelt 	);
4437db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F23_F0,
4447db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[23])
4457db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4467db91e57SPalmer Dabbelt 	);
4477db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F24_F0,
4487db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[24])
4497db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4507db91e57SPalmer Dabbelt 	);
4517db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F25_F0,
4527db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[25])
4537db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4547db91e57SPalmer Dabbelt 	);
4557db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F26_F0,
4567db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[26])
4577db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4587db91e57SPalmer Dabbelt 	);
4597db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F27_F0,
4607db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[27])
4617db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4627db91e57SPalmer Dabbelt 	);
4637db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F28_F0,
4647db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[28])
4657db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4667db91e57SPalmer Dabbelt 	);
4677db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F29_F0,
4687db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[29])
4697db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4707db91e57SPalmer Dabbelt 	);
4717db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F30_F0,
4727db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[30])
4737db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4747db91e57SPalmer Dabbelt 	);
4757db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_F31_F0,
4767db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.f[31])
4777db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4787db91e57SPalmer Dabbelt 	);
4797db91e57SPalmer Dabbelt 	DEFINE(TASK_THREAD_FCSR_F0,
4807db91e57SPalmer Dabbelt 		  offsetof(struct task_struct, thread.fstate.fcsr)
4817db91e57SPalmer Dabbelt 		- offsetof(struct task_struct, thread.fstate.f[0])
4827db91e57SPalmer Dabbelt 	);
4837db91e57SPalmer Dabbelt 
4847db91e57SPalmer Dabbelt 	/*
4857db91e57SPalmer Dabbelt 	 * We allocate a pt_regs on the stack when entering the kernel.  This
4867db91e57SPalmer Dabbelt 	 * ensures the alignment is sane.
4877db91e57SPalmer Dabbelt 	 */
4887db91e57SPalmer Dabbelt 	DEFINE(PT_SIZE_ON_STACK, ALIGN(sizeof(struct pt_regs), STACK_ALIGN));
489658e2c51SAlexandre Ghiti 
490658e2c51SAlexandre Ghiti 	OFFSET(KERNEL_MAP_VIRT_ADDR, kernel_mapping, virt_addr);
4919a2451f1SAtish Patra 	OFFSET(SBI_HART_BOOT_TASK_PTR_OFFSET, sbi_hart_boot_data, task_ptr);
4929a2451f1SAtish Patra 	OFFSET(SBI_HART_BOOT_STACK_PTR_OFFSET, sbi_hart_boot_data, stack_ptr);
49382982fddSSami Tolvanen 
49482982fddSSami Tolvanen 	DEFINE(STACKFRAME_SIZE_ON_STACK, ALIGN(sizeof(struct stackframe), STACK_ALIGN));
49582982fddSSami Tolvanen 	OFFSET(STACKFRAME_FP, stackframe, fp);
49682982fddSSami Tolvanen 	OFFSET(STACKFRAME_RA, stackframe, ra);
4977caa9765SPuranjay Mohan 
4987caa9765SPuranjay Mohan #ifdef CONFIG_DYNAMIC_FTRACE_WITH_ARGS
4997caa9765SPuranjay Mohan 	DEFINE(FREGS_SIZE_ON_STACK, ALIGN(sizeof(struct ftrace_regs), STACK_ALIGN));
5007caa9765SPuranjay Mohan 	DEFINE(FREGS_EPC,	    offsetof(struct ftrace_regs, epc));
5017caa9765SPuranjay Mohan 	DEFINE(FREGS_RA,	    offsetof(struct ftrace_regs, ra));
5027caa9765SPuranjay Mohan 	DEFINE(FREGS_SP,	    offsetof(struct ftrace_regs, sp));
5037caa9765SPuranjay Mohan 	DEFINE(FREGS_S0,	    offsetof(struct ftrace_regs, s0));
5047caa9765SPuranjay Mohan 	DEFINE(FREGS_T1,	    offsetof(struct ftrace_regs, t1));
5057caa9765SPuranjay Mohan 	DEFINE(FREGS_A0,	    offsetof(struct ftrace_regs, a0));
5067caa9765SPuranjay Mohan 	DEFINE(FREGS_A1,	    offsetof(struct ftrace_regs, a1));
5077caa9765SPuranjay Mohan 	DEFINE(FREGS_A2,	    offsetof(struct ftrace_regs, a2));
5087caa9765SPuranjay Mohan 	DEFINE(FREGS_A3,	    offsetof(struct ftrace_regs, a3));
5097caa9765SPuranjay Mohan 	DEFINE(FREGS_A4,	    offsetof(struct ftrace_regs, a4));
5107caa9765SPuranjay Mohan 	DEFINE(FREGS_A5,	    offsetof(struct ftrace_regs, a5));
5117caa9765SPuranjay Mohan 	DEFINE(FREGS_A6,	    offsetof(struct ftrace_regs, a6));
5127caa9765SPuranjay Mohan 	DEFINE(FREGS_A7,	    offsetof(struct ftrace_regs, a7));
5137caa9765SPuranjay Mohan #endif
5147db91e57SPalmer Dabbelt }
515