# Linux Kernel Module Cheat

###### 33.10.3.1.3. ARMv8 spinlock pattern

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka16277.html

           sev
       1:  wfe
       2:  ldaxr  w1, [w0]
           cbnz   w1, %1b
           stxr   w1, w2, [w0]
           cbnz   w1, %2b

It is the STXR from the unlock on another core that automatically wakes up the spinlock afterwards: https://stackoverflow.com/questions/32276313/how-is-a-spin-lock-woken-up-in-linux-arm64