Lock on all processors for AP startup sequence on x86
Posted: Thu Oct 16, 2014 3:18 am
Hi
I've implemented the SMP startup sequence for the AP's in my kernel. Now inside my AP startup code, I need to have a section that is locked across all processors, so I can assign a different stack for each AP. There is only one instance of this code (in lower memory at 0x1000), so I tried to implement the lock like this:
The problem is that NASM tells me that I have an invalid combination of opcode and operands at both of the locked instructions. What is the problem here?
Thank you!
I've implemented the SMP startup sequence for the AP's in my kernel. Now inside my AP startup code, I need to have a section that is locked across all processors, so I can assign a different stack for each AP. There is only one instance of this code (in lower memory at 0x1000), so I tried to implement the lock like this:
Code: Select all
; Inter-core synchronization
interlock:
dd 0x00000000
acquireLock:
lock bts [interlock], 0
jc acquireLock
ret
releaseLock:
lock btr [interlock], 0
ret
The problem is that NASM tells me that I have an invalid combination of opcode and operands at both of the locked instructions. What is the problem here?
Thank you!