mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 18:29:13 +02:00
+ disable interrupts as a form of 'locking' in InterLockedDecrement and
InterLockedIncrement git-svn-id: trunk@27401 -
This commit is contained in:
parent
2dd9a36bdc
commit
14ecc118ec
@ -213,10 +213,13 @@ function InterLockedDecrement (var Target: longint) : longint;nostackframe;assem
|
|||||||
asm
|
asm
|
||||||
mov si, sp
|
mov si, sp
|
||||||
mov bx, ss:[si + 2 + extra_param_offset] // Target
|
mov bx, ss:[si + 2 + extra_param_offset] // Target
|
||||||
|
pushf
|
||||||
|
cli
|
||||||
sub word [bx], 1
|
sub word [bx], 1
|
||||||
sbb word [bx+2], 0
|
sbb word [bx+2], 0
|
||||||
mov ax, [bx]
|
mov ax, [bx]
|
||||||
mov dx, [bx+2]
|
mov dx, [bx+2]
|
||||||
|
popf
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{TODO: fix, use smallint?}
|
{TODO: fix, use smallint?}
|
||||||
@ -224,10 +227,13 @@ function InterLockedIncrement (var Target: longint) : longint;nostackframe;assem
|
|||||||
asm
|
asm
|
||||||
mov si, sp
|
mov si, sp
|
||||||
mov bx, ss:[si + 2 + extra_param_offset] // Target
|
mov bx, ss:[si + 2 + extra_param_offset] // Target
|
||||||
|
pushf
|
||||||
|
cli
|
||||||
add word [bx], 1
|
add word [bx], 1
|
||||||
adc word [bx+2], 0
|
adc word [bx+2], 0
|
||||||
mov ax, [bx]
|
mov ax, [bx]
|
||||||
mov dx, [bx+2]
|
mov dx, [bx+2]
|
||||||
|
popf
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{TODO: fix, use smallint?}
|
{TODO: fix, use smallint?}
|
||||||
|
Loading…
Reference in New Issue
Block a user