lock.s (408B)
1 .file "lock.s" 2 /* 3 * Those functions are currently not used for two reasons: 4 * 1- We don't have caches and mmu enabled 5 * 2- We are executing only one execution thread. 6 */ 7 8 .TEXT 9 .GLOBL lock 10 11 lock: 12 MOV W2,#1 13 SEVL 14 1: 15 WFE 16 MOV W1,WZR 17 CASA W1,W2,[x0] 18 CBNZ W1,1B 19 RET 20 21 .TEXT 22 .GLOBL unlock 23 24 unlock: 25 STLR WZR,[X0] 26 SEV 27 RET 28 29 .TEXT 30 .GLOBL trylock 31 32 trylock: // TODO: implement trylock 33 MOV W0,#1 34 RET