arm-trusted-firmware/bl31
Andrew Thoelke ee7b35c4e1 Re-design bakery lock memory allocation and algorithm
This patch unifies the bakery lock api's across coherent and normal
memory implementation of locks by using same data type `bakery_lock_t`
and similar arguments to functions.

A separate section `bakery_lock` has been created and used to allocate
memory for bakery locks using `DEFINE_BAKERY_LOCK`. When locks are
allocated in normal memory, each lock for a core has to spread
across multiple cache lines. By using the total size allocated in a
separate cache line for a single core at compile time, the memory for
other core locks is allocated at link time by multiplying the single
core locks size with (PLATFORM_CORE_COUNT - 1). The normal memory lock
algorithm now uses lock address instead of the `id` in the per_cpu_data.
For locks allocated in coherent memory, it moves locks from
tzfw_coherent_memory to bakery_lock section.

The bakery locks are allocated as part of bss or in coherent memory
depending on usage of coherent memory. Both these regions are
initialised to zero as part of run_time_init before locks are used.
Hence, bakery_lock_init() is made an empty function as the lock memory
is already initialised to zero.

The above design lead to the removal of psci bakery locks from
non_cpu_power_pd_node to psci_locks.

NOTE: THE BAKERY LOCK API WHEN USE_COHERENT_MEM IS NOT SET HAS CHANGED.
THIS IS A BREAKING CHANGE FOR ALL PLATFORM PORTS THAT ALLOCATE BAKERY
LOCKS IN NORMAL MEMORY.

Change-Id: Ic3751c0066b8032dcbf9d88f1d4dc73d15f61d8b
2015-09-11 16:19:21 +01:00
..
aarch64 PSCI: Migrate TF to the new platform API and CM helpers 2015-08-13 23:48:06 +01:00
bl31.ld.S Re-design bakery lock memory allocation and algorithm 2015-09-11 16:19:21 +01:00
bl31.mk PSCI: Switch to the new PSCI frameworks 2015-08-13 23:47:57 +01:00
bl31_main.c PSCI: Migrate TF to the new platform API and CM helpers 2015-08-13 23:48:06 +01:00
context_mgmt.c PSCI: Introduce new platform and CM helper APIs 2015-08-13 16:17:58 +01:00
cpu_data_array.c Rework the crash reporting in BL3-1 to use less stack 2014-07-28 11:03:20 +01:00
interrupt_mgmt.c Demonstrate model for routing IRQs to EL3 2015-01-26 15:29:32 +00:00
runtime_svc.c Enable type-checking of arguments passed to printf() et al. 2015-03-06 13:07:43 +00:00