Skip to content
Permalink
Browse files

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 <flavio.ceolin@intel.com>
  • Loading branch information...
ceolin authored and andrewboie committed Apr 17, 2019
1 parent d61c679 commit 4f99a38b06357e11cc24dbacbf19862d67d3e94e
@@ -12,7 +12,6 @@
*
* struct _thread_arch
* struct _callee_saved
* struct _caller_saved
*
* necessary to instantiate instances of struct k_thread.
*/
@@ -32,15 +31,6 @@
#ifndef _ASMLANGUAGE
#include <zephyr/types.h>

struct _caller_saved {
/*
* Saved on the stack as part of handling a regular IRQ or by the
* kernel when calling the FIRQ return code.
*/
};

typedef struct _caller_saved _caller_saved_t;

struct _callee_saved {
u32_t sp; /* r28 */
};
@@ -12,8 +12,7 @@
*
* struct _thread_arch
* struct _callee_saved
* struct _caller_saved
*
*
* necessary to instantiate instances of struct k_thread.
*/

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

struct _caller_saved {
/*
* Unused for Cortex-M, which automatically saves the necessary
* registers in its exception stack frame.
*
* For Cortex-A, this may be:
*
* u32_t a1; r0
* u32_t a2; r1
* u32_t a3; r2
* u32_t a4; r3
* u32_t ip; r12
* u32_t lr; r14
* u32_t pc; r15
* u32_t xpsr;
*/
};

typedef struct _caller_saved _caller_saved_t;

struct _callee_saved {
u32_t v1; /* r4 */
u32_t v2; /* r5 */
@@ -12,7 +12,6 @@
*
* struct _thread_arch
* struct _callee_saved
* struct _caller_saved
*
* necessary to instantiate instances of struct k_thread.
*/
@@ -23,15 +22,6 @@
#ifndef _ASMLANGUAGE
#include <zephyr/types.h>

struct _caller_saved {
/*
* Nothing here, the exception code puts all the caller-saved
* registers onto the stack.
*/
};

typedef struct _caller_saved _caller_saved_t;

struct _callee_saved {
/* General purpose callee-saved registers */
u32_t r16;
@@ -13,7 +13,6 @@
*
* struct _thread_arch
* struct _callee_saved
* struct _caller_saved
*
* necessary to instantiate instances of struct k_thread.
*/
@@ -24,13 +23,6 @@
#ifndef _ASMLANGUAGE
#include <zephyr/types.h>

struct _caller_saved {
/*
* Nothing here
*/
};


struct _callee_saved {
/* IRQ status before irq_lock() and call to z_swap() */
u32_t key;
@@ -12,7 +12,6 @@
*
* struct _thread_arch
* struct _callee_saved
* struct _caller_saved
*
* necessary to instantiate instances of struct k_thread.
*/
@@ -45,15 +44,6 @@ struct _callee_saved {
};
typedef struct _callee_saved _callee_saved_t;

struct _caller_saved {
/*
* Nothing here, the exception code puts all the caller-saved
* registers onto the stack.
*/
};

typedef struct _caller_saved _caller_saved_t;

struct _thread_arch {
u32_t swap_return_value; /* Return value of z_swap() */
};
@@ -12,7 +12,6 @@
*
* struct _thread_arch
* struct _callee_saved
* struct _caller_saved
*
* necessary to instantiate instances of struct k_thread.
*/
@@ -37,32 +36,6 @@
#ifndef _ASMLANGUAGE
#include <stdint.h>

/*
* The following structure defines the set of 'volatile' integer registers.
* These registers need not be preserved by a called C function. Given that
* they are not preserved across function calls, they must be save/restored
* (along with the struct _caller_saved) when a preemptive context switch
* occurs.
*/

struct _caller_saved {

/*
* The volatile registers 'eax', 'ecx' and 'edx' area not included in
* the definition of 'tPreempReg' since the interrupt and exception
* handling routunes use the stack to save and restore the values of
* these registers in order to support interrupt nesting. The stubs
* do _not_ copy the saved values from the stack into the TCS.
*
* unsigned long eax;
* unsigned long ecx;
* unsigned long edx;
*/

};

typedef struct _caller_saved _caller_saved_t;

/*
* The following structure defines the set of 'non-volatile' integer registers.
* These registers must be preserved by a called C function. These are the
@@ -11,7 +11,6 @@
* Zephyr thread struct. But we don't need that for this arch.
*/

struct _caller_saved { };
struct _callee_saved { };
struct _thread_arch { };

@@ -50,9 +50,6 @@ GEN_OFFSET_SYM(__esf_t, pc);
/* size of the entire __esf_t structure */
GEN_ABSOLUTE_SYM(____esf_t_SIZEOF, sizeof(__esf_t));

/* size of the entire preempt registers structure */
GEN_ABSOLUTE_SYM(__tPreempt_SIZEOF, sizeof(_caller_saved_t));

/* size of the struct k_thread structure without save area for coproc regs */
GEN_ABSOLUTE_SYM(_K_THREAD_NO_FLOAT_SIZEOF,
sizeof(struct k_thread) - sizeof(tCoopCoprocReg) -
@@ -12,7 +12,6 @@
*
* struct _thread_arch
* struct _callee_saved
* struct _caller_saved
*
* necessary to instantiate instances of struct k_thread.
*/
@@ -24,28 +23,6 @@
#include <zephyr/types.h>
#include <xtensa_context.h>

/*
* The following structure defines the set of 'volatile' integer registers.
* These registers need not be preserved by a called C function. Given that
* they are not preserved across function calls, they must be save/restored
* (along with the struct _caller_saved) when a preemptive context switch
* occurs.
*/

struct _caller_saved {

/*
* The volatile registers area not included in the definition of
* 'tPreempReg' since the interrupt stubs (_IntEnt/_IntExit)
* and exception stubs (_ExcEnt/_ExcEnter) use the stack to save and
* restore the values of these registers in order to support interrupt
* nesting. The stubs do _not_ copy the saved values from the stack
* into the k_thread.
*/
};

typedef struct _caller_saved _caller_saved_t;

/*
* The following structure defines the set of 'non-volatile' integer registers.
* These registers must be preserved by a called C function. These are the
@@ -513,8 +513,6 @@ struct k_thread {

struct _thread_base base;

/** defined by the architecture, but all archs need these */
struct _caller_saved caller_saved;
/** defined by the architecture, but all archs need these */
struct _callee_saved callee_saved;

@@ -55,7 +55,6 @@ GEN_OFFSET_SYM(_thread_base_t, preempt);
GEN_OFFSET_SYM(_thread_base_t, swap_data);

GEN_OFFSET_SYM(_thread_t, base);
GEN_OFFSET_SYM(_thread_t, caller_saved);
GEN_OFFSET_SYM(_thread_t, callee_saved);
GEN_OFFSET_SYM(_thread_t, arch);

@@ -12,7 +12,6 @@
*
* struct _thread_arch
* struct _callee_saved
* struct _caller_saved
*
* necessary to instantiate instances of struct k_thread.
*/
@@ -23,11 +22,6 @@

#ifndef _ASMLANGUAGE

struct _caller_saved {
};

typedef struct _caller_saved _caller_saved_t;

struct _callee_saved {
};

0 comments on commit 4f99a38

Please sign in to comment.
You can’t perform that action at this time.