Possible multithreading/ISR safe handling of ICR:
Code: Select all
icr_send:
cli
test ICR,DeliveryStatusBit
jz icr_ready
sti
pause
jmp icr_send
icr_ready:
mov ICR+4,edx
mov ICR,eax
sti
Code: Select all
icr_send:
cli
test ICR,DeliveryStatusBit
jz icr_ready
sti
pause
jmp icr_send
icr_ready:
mov ICR+4,edx
mov ICR,eax
sti