avr/modules/network: disable interrupts on alloc/release.
This commit is contained in:
@@ -42,6 +42,22 @@ NET_Buffer_Init:
|
||||
; @clobbers R16, R17, X
|
||||
|
||||
NET_Buffer_Alloc:
|
||||
push r15
|
||||
in r15, SREG
|
||||
cli
|
||||
rcall NET_Buffer_Alloc_noIrq
|
||||
brcc NET_Buffer_Alloc_error
|
||||
out SREG, r15
|
||||
pop r15
|
||||
sec
|
||||
ret
|
||||
NET_Buffer_Alloc_error:
|
||||
out SREG, r15
|
||||
pop r15
|
||||
clc
|
||||
ret
|
||||
|
||||
NET_Buffer_Alloc_noIrq:
|
||||
ldi xl, LOW(netBuffers)
|
||||
ldi xh, HIGH(netBuffers)
|
||||
m_fixedbuf_reserve NET_BUFFERS_SIZE, NET_BUFFERS_NUM
|
||||
@@ -61,7 +77,12 @@ NET_Buffer_Alloc_end:
|
||||
; @clobbers R16
|
||||
|
||||
NET_Buffer_ReleaseByAddr:
|
||||
m_fixedbuf_release
|
||||
push r15
|
||||
in r15, SREG
|
||||
cli
|
||||
m_fixedbuf_release
|
||||
out SREG, r15
|
||||
pop r15
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user