feat: modification de la gestion des contextes pour un usage plus étendu

This commit is contained in:
Nicolas Hordé 2007-03-28 15:52:40 +00:00
parent 5af55420ca
commit 4e91970166
1 changed files with 42 additions and 22 deletions

View File

@ -272,29 +272,49 @@ endp installirqhandler
interruptionbloc db '/interrupts',0 interruptionbloc db '/interrupts',0
PROC savecontext far PROC savecontext FAR
ARG @pointer:word ARG @pointer:word
USES si USES eax,si,ds
push [word ptr ss:bp]
push esi
pushfd pushfd
push eax
push ebx
push ecx
push edx
push esi
push edi
push ds
push es
push fs
push gs
push ss
mov si,[@pointer] mov si,[@pointer]
pop [dword ptr cs:(regs si).seflags] mov ds,[ss:bp+4]
pop [dword ptr cs:(regs si).sesi] mov eax,ebp
pop bp mov ax,[word ptr ss:bp]
mov [cs:(regs si).seax],eax push eax
mov [cs:(regs si).sebx],ebx push [word ptr ss:bp+4]
mov [cs:(regs si).secx],ecx xor eax,eax
mov [cs:(regs si).sedx],edx mov ax,[word ptr ss:bp+2]
mov [cs:(regs si).sedi],edi push eax
mov [cs:(regs si).sebp],ebp mov ax,bp
mov [cs:(regs si).sesp],esp add ax,4
mov [cs:(regs si).scs],cs push eax
mov [cs:(regs si).sds],ds pop [(regs si).sesp]
mov [cs:(regs si).ses],es pop [(regs si).seip]
mov [cs:(regs si).sfs],fs pop [(regs si).scs]
mov [cs:(regs si).sgs],gs pop [(regs si).sebp]
mov [cs:(regs si).sss],ss pop [(regs si).sss]
pop [(regs si).sgs]
pop [(regs si).sfs]
pop [(regs si).ses]
pop [(regs si).sds]
pop [(regs si).sedi]
pop [(regs si).sesi]
pop [(regs si).sedx]
pop [(regs si).secx]
pop [(regs si).sebx]
pop [(regs si).seax]
pop [(regs si).seflags]
ret ret
endp savecontext endp savecontext