mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-27 02:16:51 +00:00
refactor(xtensa): Rename specreg.h register macros
This commit renames all registers in xtensa/specreg.h to by adding the prefix XT_REG_. This is done to avoid naming collisions with similar variable names. A new register file, viz., xt_specreg.h is created. The previous names are still available to use but have been deprecated. Closes https://github.com/espressif/esp-idf/issues/12723 Merges https://github.com/espressif/esp-idf/pull/16040
This commit is contained in:

committed by
Sudeep Mohanty

parent
2f4c5d278e
commit
d0ceef20f4
@@ -77,7 +77,7 @@
|
||||
Macro spinlock_take
|
||||
|
||||
This macro will repeatedley attempt to atomically set a spinlock variable
|
||||
using the s32c1i instruciton. A spinlock is considered free if its value is 0.
|
||||
using the s32c1i instruction. A spinlock is considered free if its value is 0.
|
||||
|
||||
Entry:
|
||||
- "reg_A/B" as scratch registers
|
||||
@@ -96,9 +96,9 @@
|
||||
movi \reg_A, \lock_var /* reg_A = &lock_var */
|
||||
.L_spinlock_loop:
|
||||
movi \reg_B, 0 /* Load spinlock free value (0) into SCOMPARE1 */
|
||||
wsr \reg_B, SCOMPARE1
|
||||
wsr \reg_B, XT_REG_SCOMPARE1
|
||||
rsync /* Ensure that SCOMPARE1 is set before s32c1i executes */
|
||||
rsr \reg_B, PRID /* Load the current core's ID into reg_B */
|
||||
rsr \reg_B, XT_REG_PRID /* Load the current core's ID into reg_B */
|
||||
s32c1i \reg_B, \reg_A, 0 /* Attempt *lock_var = reg_B */
|
||||
bnez \reg_B, .L_spinlock_loop /* If the write was successful (i.e., lock was free), 0 will have been written back to reg_B */
|
||||
|
||||
|
Reference in New Issue
Block a user