Skip to content

Commit 3998e18

Browse files
ycsinMaureenHelm
authored andcommitted
arch: rename all esf struct to struct arch_esf
Rename every architecture's esf struct to `struct esf`. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
1 parent 31742d0 commit 3998e18

File tree

23 files changed

+42
-39
lines changed

23 files changed

+42
-39
lines changed

arch/arc/include/kernel_arch_data.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern "C" {
3636
#endif
3737

3838
#ifdef CONFIG_ARC_HAS_SECURE
39-
struct _irq_stack_frame {
39+
struct arch_esf {
4040
#ifdef CONFIG_ARC_HAS_ZOL
4141
uintptr_t lp_end;
4242
uintptr_t lp_start;
@@ -72,7 +72,7 @@ struct _irq_stack_frame {
7272
uintptr_t status32;
7373
};
7474
#else
75-
struct _irq_stack_frame {
75+
struct arch_esf {
7676
uintptr_t r0;
7777
uintptr_t r1;
7878
uintptr_t r2;
@@ -108,7 +108,7 @@ struct _irq_stack_frame {
108108
};
109109
#endif
110110

111-
typedef struct _irq_stack_frame _isf_t;
111+
typedef struct arch_esf _isf_t;
112112

113113

114114

arch/arm/include/kernel_arch_data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
extern "C" {
4343
#endif
4444

45-
typedef struct __esf _esf_t;
45+
typedef struct arch_esf _esf_t;
4646
typedef struct __basic_sf _basic_sf_t;
4747
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
4848
typedef struct __fpu_sf _fpu_sf_t;

arch/arm64/core/thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
102102
* dropping into EL0.
103103
*/
104104

105-
pInitCtx = Z_STACK_PTR_TO_FRAME(struct __esf, stack_ptr);
105+
pInitCtx = Z_STACK_PTR_TO_FRAME(struct arch_esf, stack_ptr);
106106

107107
pInitCtx->x0 = (uint64_t)entry;
108108
pInitCtx->x1 = (uint64_t)p1;

arch/arm64/include/kernel_arch_data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
extern "C" {
3737
#endif
3838

39-
typedef struct __esf _esf_t;
39+
typedef struct arch_esf _esf_t;
4040
typedef struct __basic_sf _basic_sf_t;
4141

4242
#ifdef __cplusplus

arch/mips/core/thread.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
1919
char *stack_ptr, k_thread_entry_t entry,
2020
void *p1, void *p2, void *p3)
2121
{
22-
struct __esf *stack_init;
22+
struct arch_esf *stack_init;
2323

2424
/* Initial stack frame for thread */
25-
stack_init = (struct __esf *)Z_STACK_PTR_ALIGN(
26-
Z_STACK_PTR_TO_FRAME(struct __esf, stack_ptr)
25+
stack_init = (struct arch_esf *)Z_STACK_PTR_ALIGN(
26+
Z_STACK_PTR_TO_FRAME(struct arch_esf, stack_ptr)
2727
);
2828

2929
/* Setup the initial stack frame */

arch/riscv/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ config RISCV_SOC_HAS_ISR_STACKING
8888
guarded by !_ASMLANGUAGE. The ESF should be defined to account for
8989
the hardware stacked registers in the proper order as they are
9090
saved on the stack by the hardware, and the registers saved by the
91-
software macros. The structure must be called '__esf'.
91+
software macros. The structure must be called 'struct arch_esf'.
9292

9393
config RISCV_SOC_HAS_CUSTOM_IRQ_HANDLING
9494
bool

arch/riscv/core/thread.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
2323
void *p1, void *p2, void *p3)
2424
{
2525
extern void z_riscv_thread_start(void);
26-
struct __esf *stack_init;
26+
struct arch_esf *stack_init;
2727

2828
#ifdef CONFIG_RISCV_SOC_CONTEXT_SAVE
2929
const struct soc_esf soc_esf_init = {SOC_ESF_INIT};
3030
#endif
3131

3232
/* Initial stack frame for thread */
33-
stack_init = (struct __esf *)Z_STACK_PTR_ALIGN(
34-
Z_STACK_PTR_TO_FRAME(struct __esf, stack_ptr)
33+
stack_init = (struct arch_esf *)Z_STACK_PTR_ALIGN(
34+
Z_STACK_PTR_TO_FRAME(struct arch_esf, stack_ptr)
3535
);
3636

3737
/* Setup the initial stack frame */

include/zephyr/arch/arc/v2/exception.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extern "C" {
2020

2121
#ifdef _ASMLANGUAGE
2222
#else
23-
typedef struct _irq_stack_frame z_arch_esf_t;
23+
typedef struct arch_esf z_arch_esf_t;
2424
#endif
2525

2626
#ifdef __cplusplus

include/zephyr/arch/arm/cortex_a_r/exception.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct __extra_esf_info {
5454
};
5555
#endif /* CONFIG_EXTRA_EXCEPTION_INFO */
5656

57-
struct __esf {
57+
struct arch_esf {
5858
#if defined(CONFIG_EXTRA_EXCEPTION_INFO)
5959
struct __extra_esf_info extra_info;
6060
#endif
@@ -75,7 +75,7 @@ struct __esf {
7575

7676
extern uint32_t z_arm_coredump_fault_sp;
7777

78-
typedef struct __esf z_arch_esf_t;
78+
typedef struct arch_esf z_arch_esf_t;
7979

8080
extern void z_arm_exc_exit(bool fatal);
8181

include/zephyr/arch/arm/cortex_m/exception.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct __extra_esf_info {
9898
};
9999
#endif /* CONFIG_EXTRA_EXCEPTION_INFO */
100100

101-
struct __esf {
101+
struct arch_esf {
102102
struct __basic_sf {
103103
sys_define_gpr_with_alias(a1, r0);
104104
sys_define_gpr_with_alias(a2, r1);
@@ -119,7 +119,7 @@ struct __esf {
119119

120120
extern uint32_t z_arm_coredump_fault_sp;
121121

122-
typedef struct __esf z_arch_esf_t;
122+
typedef struct arch_esf z_arch_esf_t;
123123

124124
extern void z_arm_exc_exit(void);
125125

include/zephyr/arch/arm64/exception.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
extern "C" {
2525
#endif
2626

27-
struct __esf {
27+
struct arch_esf {
2828
uint64_t x0;
2929
uint64_t x1;
3030
uint64_t x2;
@@ -55,7 +55,7 @@ struct __esf {
5555
#endif
5656
} __aligned(16);
5757

58-
typedef struct __esf z_arch_esf_t;
58+
typedef struct arch_esf z_arch_esf_t;
5959

6060
#ifdef __cplusplus
6161
}

include/zephyr/arch/mips/exception.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
extern "C" {
1818
#endif
1919

20-
struct __esf {
20+
struct arch_esf {
2121
unsigned long ra; /* return address */
2222
unsigned long gp; /* global pointer */
2323

@@ -50,7 +50,7 @@ struct __esf {
5050
unsigned long cause;
5151
};
5252

53-
typedef struct __esf z_arch_esf_t;
53+
typedef struct arch_esf z_arch_esf_t;
5454

5555
#ifdef __cplusplus
5656
}

include/zephyr/arch/nios2/exception.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
extern "C" {
1515
#endif
1616

17-
struct __esf {
17+
struct arch_esf {
1818
uint32_t ra; /* return address r31 */
1919
uint32_t r1; /* at */
2020
uint32_t r2; /* return value */
@@ -35,7 +35,7 @@ struct __esf {
3535
uint32_t instr; /* Instruction being executed when exc occurred */
3636
};
3737

38-
typedef struct __esf z_arch_esf_t;
38+
typedef struct arch_esf z_arch_esf_t;
3939

4040
#ifdef __cplusplus
4141
}

include/zephyr/arch/posix/exception.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
extern "C" {
1616
#endif
1717

18-
struct __esf {
18+
struct arch_esf {
1919
uint32_t dummy; /*maybe we will want to add something someday*/
2020
};
2121

22-
typedef struct __esf z_arch_esf_t;
22+
typedef struct arch_esf z_arch_esf_t;
2323

2424
#ifdef __cplusplus
2525
}

include/zephyr/arch/riscv/exception.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct soc_esf {
4848
#if defined(CONFIG_RISCV_SOC_HAS_ISR_STACKING)
4949
SOC_ISR_STACKING_ESF_DECLARE;
5050
#else
51-
struct __esf {
51+
struct arch_esf {
5252
unsigned long ra; /* return address */
5353

5454
unsigned long t0; /* Caller-saved temporary register */
@@ -87,7 +87,7 @@ struct __esf {
8787
} __aligned(16);
8888
#endif /* CONFIG_RISCV_SOC_HAS_ISR_STACKING */
8989

90-
typedef struct __esf z_arch_esf_t;
90+
typedef struct arch_esf z_arch_esf_t;
9191
#ifdef CONFIG_RISCV_SOC_CONTEXT_SAVE
9292
typedef struct soc_esf soc_esf_t;
9393
#endif

include/zephyr/arch/sparc/exception.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
extern "C" {
1515
#endif
1616

17-
struct __esf {
17+
struct arch_esf {
1818
uint32_t out[8];
1919
uint32_t global[8];
2020
uint32_t psr;
@@ -25,7 +25,7 @@ struct __esf {
2525
uint32_t y;
2626
};
2727

28-
typedef struct __esf z_arch_esf_t;
28+
typedef struct arch_esf z_arch_esf_t;
2929

3030
#ifdef __cplusplus
3131
}

include/zephyr/arch/x86/ia32/exception.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
* Those registers are pushed onto the stack by _ExcEnt().
2828
*/
2929

30-
typedef struct nanoEsf {
30+
typedef struct arch_esf {
3131
#ifdef CONFIG_GDBSTUB
3232
unsigned int ss;
3333
unsigned int gs;

include/zephyr/arch/x86/intel64/exception.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extern "C" {
1717
* the exception stack frame
1818
*/
1919

20-
struct x86_esf {
20+
struct arch_esf {
2121
#ifdef CONFIG_EXCEPTION_DEBUG
2222
/* callee-saved */
2323
unsigned long rbx;
@@ -53,7 +53,7 @@ struct x86_esf {
5353
unsigned long ss;
5454
};
5555

56-
typedef struct x86_esf z_arch_esf_t;
56+
typedef struct arch_esf z_arch_esf_t;
5757

5858
struct x86_ssf {
5959
unsigned long rip;

include/zephyr/arch/xtensa/exception.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ extern "C" {
2525
* register windows are in use. This isn't a struct type, it just
2626
* matches the register/stack-unit width.
2727
*/
28+
struct arch_esf {
29+
int dummy;
30+
};
2831
typedef int z_arch_esf_t;
2932

3033
#endif

scripts/coredump/gdbstubs/arch/arm64.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def parse_arch_data_block(self):
9595
self.registers[RegNum.X17] = tu[17]
9696
self.registers[RegNum.X18] = tu[18]
9797

98-
# Callee saved registers are not provided in __esf structure
98+
# Callee saved registers are not provided in arch_esf structure
9999
# So they will be omitted (set to undefined) when stub generates the
100100
# packet in handle_register_group_read_packet.
101101

soc/nordic/common/vpr/soc_isr_stacking.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#if DT_PROP(VPR_CPU, nordic_bus_width) == 64
1818

1919
#define SOC_ISR_STACKING_ESF_DECLARE \
20-
struct __esf { \
20+
struct arch_esf { \
2121
unsigned long s0; \
2222
unsigned long mstatus; \
2323
unsigned long tp; \
@@ -40,7 +40,7 @@
4040
#else /* DT_PROP(VPR_CPU, nordic_bus_width) == 32 */
4141

4242
#define SOC_ISR_STACKING_ESF_DECLARE \
43-
struct __esf { \
43+
struct arch_esf { \
4444
unsigned long s0; \
4545
unsigned long mstatus; \
4646
unsigned long tp; \

subsys/testsuite/ztest/include/zephyr/ztest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#ifdef __cplusplus
2929
extern "C" {
3030
#endif
31-
struct esf;
32-
typedef struct esf z_arch_esf_t;
31+
struct arch_esf;
32+
typedef struct arch_esf z_arch_esf_t;
3333
#ifdef __cplusplus
3434
}
3535
#endif

tests/arch/arm/arm_interrupt/src/arm_interrupt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static int check_esf_matches_expectations(const z_arch_esf_t *pEsf)
7474
* is overwritten in fault.c)
7575
*/
7676
if (memcmp((void *)callee_regs->psp, pEsf,
77-
offsetof(struct __esf, basic.xpsr)) != 0) {
77+
offsetof(struct arch_esf, basic.xpsr)) != 0) {
7878
printk("psp does not match __basic_sf provided\n");
7979
return -1;
8080
}

0 commit comments

Comments
 (0)