hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/riscv/kernel/asm-offsets.c
....@@ -1,15 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2012 Regents of the University of California
34 * Copyright (C) 2017 SiFive
4
- *
5
- * This program is free software; you can redistribute it and/or
6
- * modify it under the terms of the GNU General Public License
7
- * as published by the Free Software Foundation, version 2.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
135 */
146
157 #define GENERATING_ASM_OFFSETS
....@@ -35,10 +27,8 @@
3527 OFFSET(TASK_THREAD_S9, task_struct, thread.s[9]);
3628 OFFSET(TASK_THREAD_S10, task_struct, thread.s[10]);
3729 OFFSET(TASK_THREAD_S11, task_struct, thread.s[11]);
38
- OFFSET(TASK_THREAD_SP, task_struct, thread.sp);
39
- OFFSET(TASK_STACK, task_struct, stack);
40
- OFFSET(TASK_TI, task_struct, thread_info);
4130 OFFSET(TASK_TI_FLAGS, task_struct, thread_info.flags);
31
+ OFFSET(TASK_TI_PREEMPT_COUNT, task_struct, thread_info.preempt_count);
4232 OFFSET(TASK_TI_KERNEL_SP, task_struct, thread_info.kernel_sp);
4333 OFFSET(TASK_TI_USER_SP, task_struct, thread_info.user_sp);
4434 OFFSET(TASK_TI_CPU, task_struct, thread_info.cpu);
....@@ -78,7 +68,7 @@
7868 OFFSET(TASK_THREAD_FCSR, task_struct, thread.fstate.fcsr);
7969
8070 DEFINE(PT_SIZE, sizeof(struct pt_regs));
81
- OFFSET(PT_SEPC, pt_regs, sepc);
71
+ OFFSET(PT_EPC, pt_regs, epc);
8272 OFFSET(PT_RA, pt_regs, ra);
8373 OFFSET(PT_FP, pt_regs, s0);
8474 OFFSET(PT_S0, pt_regs, s0);
....@@ -112,9 +102,9 @@
112102 OFFSET(PT_T6, pt_regs, t6);
113103 OFFSET(PT_GP, pt_regs, gp);
114104 OFFSET(PT_ORIG_A0, pt_regs, orig_a0);
115
- OFFSET(PT_SSTATUS, pt_regs, sstatus);
116
- OFFSET(PT_SBADADDR, pt_regs, sbadaddr);
117
- OFFSET(PT_SCAUSE, pt_regs, scause);
105
+ OFFSET(PT_STATUS, pt_regs, status);
106
+ OFFSET(PT_BADADDR, pt_regs, badaddr);
107
+ OFFSET(PT_CAUSE, pt_regs, cause);
118108
119109 /*
120110 * THREAD_{F,X}* might be larger than a S-type offset can handle, but
....@@ -310,9 +300,6 @@
310300 offsetof(struct task_struct, thread.fstate.fcsr)
311301 - offsetof(struct task_struct, thread.fstate.f[0])
312302 );
313
-
314
- /* The assembler needs access to THREAD_SIZE as well. */
315
- DEFINE(ASM_THREAD_SIZE, THREAD_SIZE);
316303
317304 /*
318305 * We allocate a pt_regs on the stack when entering the kernel. This