Skip to content

Commit

Permalink
core: arm: kernel: make thread_core_local public
Browse files Browse the repository at this point in the history
Move the struture of thread_core_local from thread_private.h
to thread.h to make it public.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
  • Loading branch information
MrVan authored and jforissier committed Sep 18, 2017
1 parent 1b181fb commit df34b18
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
29 changes: 29 additions & 0 deletions core/arch/arm/include/kernel/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,33 @@
#define THREAD_RPC_MAX_NUM_PARAMS 4

#ifndef ASM

#ifdef ARM64
/*
* struct thread_core_local needs to have alignment suitable for a stack
* pointer since SP_EL1 points to this
*/
#define THREAD_CORE_LOCAL_ALIGNED __aligned(16)
#else
#define THREAD_CORE_LOCAL_ALIGNED
#endif

struct thread_core_local {
vaddr_t tmp_stack_va_end;
int curr_thread;
uint32_t flags;
vaddr_t abt_stack_va_end;
#ifdef ARM32
uint32_t r[2];
#endif
#ifdef ARM64
uint64_t x[4];
#endif
#ifdef CFG_TEE_CORE_DEBUG
unsigned int locked_count; /* Number of spinlocks held */
#endif
} THREAD_CORE_LOCAL_ALIGNED;

struct thread_vector_table {
uint32_t std_smc_entry;
uint32_t fast_smc_entry;
Expand Down Expand Up @@ -252,6 +279,8 @@ struct thread_handlers {
void thread_init_primary(const struct thread_handlers *handlers);
void thread_init_per_cpu(void);

struct thread_core_local *thread_get_core_local(void);

/*
* Sets the stacks to be used by the different threads. Use THREAD_ID_0 for
* first stack, THREAD_ID_0 + 1 for the next and so on.
Expand Down
2 changes: 1 addition & 1 deletion core/arch/arm/kernel/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

struct thread_ctx threads[CFG_NUM_THREADS];

static struct thread_core_local thread_core_local[CFG_TEE_CORE_NB_CORE];
struct thread_core_local thread_core_local[CFG_TEE_CORE_NB_CORE];

#ifdef CFG_WITH_STACK_CANARIES
#ifdef ARM32
Expand Down
29 changes: 0 additions & 29 deletions core/arch/arm/kernel/thread_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,33 +117,6 @@ struct thread_ctx {
struct mutex_head mutexes;
struct thread_specific_data tsd;
};

#ifdef ARM64
/*
* struct thread_core_local need to have alignment suitable for a stack
* pointer since SP_EL1 points to this
*/
#define THREAD_CORE_LOCAL_ALIGNED __aligned(16)
#else
#define THREAD_CORE_LOCAL_ALIGNED
#endif

struct thread_core_local {
vaddr_t tmp_stack_va_end;
int curr_thread;
uint32_t flags;
vaddr_t abt_stack_va_end;
#ifdef ARM32
uint32_t r[2];
#endif
#ifdef ARM64
uint64_t x[4];
#endif
#ifdef CFG_TEE_CORE_DEBUG
unsigned int locked_count; /* Number of spinlocks held */
#endif
} THREAD_CORE_LOCAL_ALIGNED;

#endif /*ASM*/

#ifdef ARM64
Expand Down Expand Up @@ -190,8 +163,6 @@ void thread_init_vbar(void);
/* Handles a stdcall, r0-r7 holds the parameters */
void thread_std_smc_entry(void);

struct thread_core_local *thread_get_core_local(void);

/*
* Resumes execution of currently active thread by restoring context and
* jumping to the instruction where to continue execution.
Expand Down

0 comments on commit df34b18

Please sign in to comment.