diff options
| author | Andrew Thoelke <andrew.thoelke@arm.com> | 2014-06-02 11:40:35 +0100 |
|---|---|---|
| committer | Andrew Thoelke <andrew.thoelke@arm.com> | 2014-06-16 21:30:32 +0100 |
| commit | 5e910074245fa180cfbe70d3c8bceeff1eaa026e (patch) | |
| tree | 8547c9ddb62604838baf4b904e1a121335fe0f20 /bl31/context_mgmt.c | |
| parent | dbc64b39c9193f0b582d706bcf0d04e0a7bf4944 (diff) | |
Per-cpu data cache restructuring
This patch prepares the per-cpu pointer cache for wider use by:
* renaming the structure to cpu_data and placing in new header
* providing accessors for this CPU, or other CPUs
* splitting the initialization of the TPIDR pointer from the
initialization of the cpu_data content
* moving the crash stack initialization to a crash stack function
* setting the TPIDR pointer very early during boot
Change-Id: Icef9004ff88f8eb241d48c14be3158087d7e49a3
Diffstat (limited to 'bl31/context_mgmt.c')
| -rw-r--r-- | bl31/context_mgmt.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/bl31/context_mgmt.c b/bl31/context_mgmt.c index 122a0d4b..59be748c 100644 --- a/bl31/context_mgmt.c +++ b/bl31/context_mgmt.c @@ -51,9 +51,6 @@ typedef struct { static context_info_t cm_context_info[PLATFORM_CORE_COUNT]; -/* The per_cpu_ptr_cache_t space allocation */ -static per_cpu_ptr_cache_t per_cpu_ptr_cache_space[PLATFORM_CORE_COUNT]; - /******************************************************************************* * Context management library initialisation routine. This library is used by * runtime services to share pointers to 'cpu_context' structures for the secure @@ -295,34 +292,3 @@ void cm_set_next_eret_context(uint32_t security_state) "msr spsel, #0\n" : : "r" (ctx)); } - -/************************************************************************ - * The following function is used to populate the per cpu pointer cache. - * The pointer will be stored in the tpidr_el3 register. - *************************************************************************/ -void cm_init_pcpu_ptr_cache() -{ - unsigned long mpidr = read_mpidr(); - uint32_t linear_id = platform_get_core_pos(mpidr); - per_cpu_ptr_cache_t *pcpu_ptr_cache; - - pcpu_ptr_cache = &per_cpu_ptr_cache_space[linear_id]; - assert(pcpu_ptr_cache); -#if CRASH_REPORTING - pcpu_ptr_cache->crash_stack = get_crash_stack(mpidr); -#endif - - cm_set_pcpu_ptr_cache(pcpu_ptr_cache); -} - - -void cm_set_pcpu_ptr_cache(const void *pcpu_ptr) -{ - write_tpidr_el3((unsigned long)pcpu_ptr); -} - -void *cm_get_pcpu_ptr_cache(void) -{ - return (void *)read_tpidr_el3(); -} - |
