Skip to content

Commit 4f99a38

Browse files
Flavio Ceolinandrewboie
authored andcommitted
arch: all: Remove not used struct _caller_saved
The struct _caller_saved is not used. Most architectures put automatically the registers onto stack, in others architectures the exception code does it. Signed-off-by: Flavio Ceolin <[email protected]>
1 parent d61c679 commit 4f99a38

File tree

12 files changed

+1
-123
lines changed

12 files changed

+1
-123
lines changed

arch/arc/include/kernel_arch_thread.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*
1313
* struct _thread_arch
1414
* struct _callee_saved
15-
* struct _caller_saved
1615
*
1716
* necessary to instantiate instances of struct k_thread.
1817
*/
@@ -32,15 +31,6 @@
3231
#ifndef _ASMLANGUAGE
3332
#include <zephyr/types.h>
3433

35-
struct _caller_saved {
36-
/*
37-
* Saved on the stack as part of handling a regular IRQ or by the
38-
* kernel when calling the FIRQ return code.
39-
*/
40-
};
41-
42-
typedef struct _caller_saved _caller_saved_t;
43-
4434
struct _callee_saved {
4535
u32_t sp; /* r28 */
4636
};

arch/arm/include/kernel_arch_thread.h

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
*
1313
* struct _thread_arch
1414
* struct _callee_saved
15-
* struct _caller_saved
16-
*
15+
*
1716
* necessary to instantiate instances of struct k_thread.
1817
*/
1918

@@ -23,26 +22,6 @@
2322
#ifndef _ASMLANGUAGE
2423
#include <zephyr/types.h>
2524

26-
struct _caller_saved {
27-
/*
28-
* Unused for Cortex-M, which automatically saves the necessary
29-
* registers in its exception stack frame.
30-
*
31-
* For Cortex-A, this may be:
32-
*
33-
* u32_t a1; r0
34-
* u32_t a2; r1
35-
* u32_t a3; r2
36-
* u32_t a4; r3
37-
* u32_t ip; r12
38-
* u32_t lr; r14
39-
* u32_t pc; r15
40-
* u32_t xpsr;
41-
*/
42-
};
43-
44-
typedef struct _caller_saved _caller_saved_t;
45-
4625
struct _callee_saved {
4726
u32_t v1; /* r4 */
4827
u32_t v2; /* r5 */

arch/nios2/include/kernel_arch_thread.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*
1313
* struct _thread_arch
1414
* struct _callee_saved
15-
* struct _caller_saved
1615
*
1716
* necessary to instantiate instances of struct k_thread.
1817
*/
@@ -23,15 +22,6 @@
2322
#ifndef _ASMLANGUAGE
2423
#include <zephyr/types.h>
2524

26-
struct _caller_saved {
27-
/*
28-
* Nothing here, the exception code puts all the caller-saved
29-
* registers onto the stack.
30-
*/
31-
};
32-
33-
typedef struct _caller_saved _caller_saved_t;
34-
3525
struct _callee_saved {
3626
/* General purpose callee-saved registers */
3727
u32_t r16;

arch/posix/include/kernel_arch_thread.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*
1414
* struct _thread_arch
1515
* struct _callee_saved
16-
* struct _caller_saved
1716
*
1817
* necessary to instantiate instances of struct k_thread.
1918
*/
@@ -24,13 +23,6 @@
2423
#ifndef _ASMLANGUAGE
2524
#include <zephyr/types.h>
2625

27-
struct _caller_saved {
28-
/*
29-
* Nothing here
30-
*/
31-
};
32-
33-
3426
struct _callee_saved {
3527
/* IRQ status before irq_lock() and call to z_swap() */
3628
u32_t key;

arch/riscv32/include/kernel_arch_thread.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*
1313
* struct _thread_arch
1414
* struct _callee_saved
15-
* struct _caller_saved
1615
*
1716
* necessary to instantiate instances of struct k_thread.
1817
*/
@@ -45,15 +44,6 @@ struct _callee_saved {
4544
};
4645
typedef struct _callee_saved _callee_saved_t;
4746

48-
struct _caller_saved {
49-
/*
50-
* Nothing here, the exception code puts all the caller-saved
51-
* registers onto the stack.
52-
*/
53-
};
54-
55-
typedef struct _caller_saved _caller_saved_t;
56-
5747
struct _thread_arch {
5848
u32_t swap_return_value; /* Return value of z_swap() */
5949
};

arch/x86/include/kernel_arch_thread.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*
1313
* struct _thread_arch
1414
* struct _callee_saved
15-
* struct _caller_saved
1615
*
1716
* necessary to instantiate instances of struct k_thread.
1817
*/
@@ -37,32 +36,6 @@
3736
#ifndef _ASMLANGUAGE
3837
#include <stdint.h>
3938

40-
/*
41-
* The following structure defines the set of 'volatile' integer registers.
42-
* These registers need not be preserved by a called C function. Given that
43-
* they are not preserved across function calls, they must be save/restored
44-
* (along with the struct _caller_saved) when a preemptive context switch
45-
* occurs.
46-
*/
47-
48-
struct _caller_saved {
49-
50-
/*
51-
* The volatile registers 'eax', 'ecx' and 'edx' area not included in
52-
* the definition of 'tPreempReg' since the interrupt and exception
53-
* handling routunes use the stack to save and restore the values of
54-
* these registers in order to support interrupt nesting. The stubs
55-
* do _not_ copy the saved values from the stack into the TCS.
56-
*
57-
* unsigned long eax;
58-
* unsigned long ecx;
59-
* unsigned long edx;
60-
*/
61-
62-
};
63-
64-
typedef struct _caller_saved _caller_saved_t;
65-
6639
/*
6740
* The following structure defines the set of 'non-volatile' integer registers.
6841
* These registers must be preserved by a called C function. These are the

arch/x86_64/include/kernel_arch_thread.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
* Zephyr thread struct. But we don't need that for this arch.
1212
*/
1313

14-
struct _caller_saved { };
1514
struct _callee_saved { };
1615
struct _thread_arch { };
1716

arch/xtensa/core/offsets/offsets.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ GEN_OFFSET_SYM(__esf_t, pc);
5050
/* size of the entire __esf_t structure */
5151
GEN_ABSOLUTE_SYM(____esf_t_SIZEOF, sizeof(__esf_t));
5252

53-
/* size of the entire preempt registers structure */
54-
GEN_ABSOLUTE_SYM(__tPreempt_SIZEOF, sizeof(_caller_saved_t));
55-
5653
/* size of the struct k_thread structure without save area for coproc regs */
5754
GEN_ABSOLUTE_SYM(_K_THREAD_NO_FLOAT_SIZEOF,
5855
sizeof(struct k_thread) - sizeof(tCoopCoprocReg) -

arch/xtensa/include/kernel_arch_thread.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*
1313
* struct _thread_arch
1414
* struct _callee_saved
15-
* struct _caller_saved
1615
*
1716
* necessary to instantiate instances of struct k_thread.
1817
*/
@@ -24,28 +23,6 @@
2423
#include <zephyr/types.h>
2524
#include <xtensa_context.h>
2625

27-
/*
28-
* The following structure defines the set of 'volatile' integer registers.
29-
* These registers need not be preserved by a called C function. Given that
30-
* they are not preserved across function calls, they must be save/restored
31-
* (along with the struct _caller_saved) when a preemptive context switch
32-
* occurs.
33-
*/
34-
35-
struct _caller_saved {
36-
37-
/*
38-
* The volatile registers area not included in the definition of
39-
* 'tPreempReg' since the interrupt stubs (_IntEnt/_IntExit)
40-
* and exception stubs (_ExcEnt/_ExcEnter) use the stack to save and
41-
* restore the values of these registers in order to support interrupt
42-
* nesting. The stubs do _not_ copy the saved values from the stack
43-
* into the k_thread.
44-
*/
45-
};
46-
47-
typedef struct _caller_saved _caller_saved_t;
48-
4926
/*
5027
* The following structure defines the set of 'non-volatile' integer registers.
5128
* These registers must be preserved by a called C function. These are the

include/kernel.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,6 @@ struct k_thread {
513513

514514
struct _thread_base base;
515515

516-
/** defined by the architecture, but all archs need these */
517-
struct _caller_saved caller_saved;
518516
/** defined by the architecture, but all archs need these */
519517
struct _callee_saved callee_saved;
520518

0 commit comments

Comments
 (0)