mirror of https://github.com/FDOS/kernel.git
intr: avoid random trace in (init_)call_intr
This commit is contained in:
parent
3ef6d61609
commit
1c2f541689
|
@ -42,6 +42,8 @@
|
||||||
%endif
|
%endif
|
||||||
push ds
|
push ds
|
||||||
pushf
|
pushf
|
||||||
|
; Flags are preserved across the entire
|
||||||
|
; function call, particularly IF.
|
||||||
|
|
||||||
arg nr, {rp,%1}
|
arg nr, {rp,%1}
|
||||||
mov ax, [.nr] ; interrupt number
|
mov ax, [.nr] ; interrupt number
|
||||||
|
@ -53,17 +55,36 @@ arg nr, {rp,%1}
|
||||||
%else
|
%else
|
||||||
mov bx, [.rp] ; regpack structure
|
mov bx, [.rp] ; regpack structure
|
||||||
%endif
|
%endif
|
||||||
mov ax, [bx]
|
|
||||||
mov cx, [bx+4]
|
|
||||||
mov dx, [bx+6]
|
mov dx, [bx+6]
|
||||||
mov si, [bx+8]
|
mov si, [bx+8]
|
||||||
mov di, [bx+10]
|
mov di, [bx+10]
|
||||||
mov bp, [bx+12]
|
mov bp, [bx+12]
|
||||||
push word [bx+14] ; ds
|
push word [bx+14] ; ds
|
||||||
mov es, [bx+16]
|
mov es, [bx+16]
|
||||||
push word [bx+22] ; flags
|
pushf
|
||||||
popf
|
pop cx
|
||||||
|
and cx, 0F02Ah
|
||||||
|
; Get the current reserved bits from the FL
|
||||||
|
; register. Hardens against possible weirdness
|
||||||
|
; around eg the NEC V20/V30 MD flag.
|
||||||
|
|
||||||
|
mov ax, [bx + 22] ; flags
|
||||||
|
and ax, ~ 0F72Ah
|
||||||
|
; Clear most of the top bits of the FL input.
|
||||||
|
; Particularly, clear DF, IF, and TF. Callers
|
||||||
|
; often do not initialise all of the iregs
|
||||||
|
; structure passed to us. Avoid weirdness
|
||||||
|
; when DF would be set (DN) or when TF would
|
||||||
|
; enable tracing randomly.
|
||||||
|
|
||||||
|
or ax, cx
|
||||||
|
; Set reserved bits to same as current FL.
|
||||||
|
|
||||||
|
push ax
|
||||||
|
mov ax, [bx]
|
||||||
|
mov cx, [bx+4]
|
||||||
mov bx, [bx+2]
|
mov bx, [bx+2]
|
||||||
|
popf ; set live FL
|
||||||
pop ds
|
pop ds
|
||||||
int 0
|
int 0
|
||||||
%%intr_1:
|
%%intr_1:
|
||||||
|
|
Loading…
Reference in New Issue