diff options
author | Andrew Thoelke <andrew.thoelke@arm.com> | 2014-06-09 12:54:15 +0100 |
---|---|---|
committer | Andrew Thoelke <andrew.thoelke@arm.com> | 2014-06-23 23:16:39 +0100 |
commit | 634ec6c23b4037ec6efc2a594fd6b666339171e9 (patch) | |
tree | e3f54acbd5f76b3467e3de6f457f3d4f3813102b /lib/locks | |
parent | e869310f67344cd1f2b531cff38fa8cb4d319d58 (diff) |
Remove calling CPU mpidr from bakery lock API
The bakery lock code currently expects the calling code to pass
the MPIDR_EL1 of the current CPU.
This is not always done correctly. Also the change to provide
inline access to system registers makes it more efficient for the
bakery lock code to obtain the MPIDR_EL1 directly.
This change removes the mpidr parameter from the bakery lock
interface, and results in a code reduction of 160 bytes for the
ARM FVP port.
Fixes ARM-software/tf-issues#213
Change-Id: I7ec7bd117bcc9794a0d948990fcf3336a367d543
Diffstat (limited to 'lib/locks')
-rw-r--r-- | lib/locks/bakery/bakery_lock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/locks/bakery/bakery_lock.c b/lib/locks/bakery/bakery_lock.c index 4e148b5a..877f5262 100644 --- a/lib/locks/bakery/bakery_lock.c +++ b/lib/locks/bakery/bakery_lock.c @@ -124,12 +124,12 @@ static unsigned int bakery_get_ticket(bakery_lock_t *bakery, unsigned int me) * of others'. The CPU with the highest priority (lowest numerical value) * acquires the lock */ -void bakery_lock_get(unsigned long mpidr, bakery_lock_t *bakery) +void bakery_lock_get(bakery_lock_t *bakery) { unsigned int they, me; unsigned int my_ticket, my_prio, their_ticket; - me = platform_get_core_pos(mpidr); + me = platform_get_core_pos(read_mpidr_el1()); assert_bakery_entry_valid(me, bakery); @@ -176,9 +176,9 @@ void bakery_lock_get(unsigned long mpidr, bakery_lock_t *bakery) /* Release the lock and signal contenders */ -void bakery_lock_release(unsigned long mpidr, bakery_lock_t *bakery) +void bakery_lock_release(bakery_lock_t *bakery) { - unsigned int me = platform_get_core_pos(mpidr); + unsigned int me = platform_get_core_pos(read_mpidr_el1()); assert_bakery_entry_valid(me, bakery); assert(bakery->owner == me); |