small cleanuo to smp asm files
This commit is contained in:
@@ -23,18 +23,11 @@ _tx_thread_smp_protect:
|
||||
|
||||
/* Try to get the protection. */
|
||||
LWU t4, 0(t1) // Pickup protection flag
|
||||
beqz t4, _get_protection // If clear, try to claim it
|
||||
|
||||
/* Protection is busy. Restore interrupts and retry. */
|
||||
csrw mstatus, a0 // Restore interrupts
|
||||
j _tx_thread_smp_protect // Restart the protection attempt
|
||||
|
||||
_get_protection:
|
||||
bnez t4, _protection_busy // If set, protection is busy
|
||||
li t4, 1 // Build lock value
|
||||
amoswap.w.aq t5, t4, (t1) // Attempt to get protection
|
||||
bnez t5, _protection_busy // If old value != 0, retry
|
||||
|
||||
_got_protection:
|
||||
fence rw, rw // Ensure lock acquisition is visible
|
||||
sw t2, 4(t1) // Save owning hart
|
||||
|
||||
|
||||
Reference in New Issue
Block a user