From 729114cf001774f98334cb40bbf26280d1740d27 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Thu, 22 Mar 2001 20:46:46 +0000 Subject: [PATCH] cli/sti corrections (Bart) and int25, 26 stack corrections (Tom) git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@174 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/apisupt.asm | 15 +++++++-------- kernel/entry.asm | 24 ++++++++++++++---------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/kernel/apisupt.asm b/kernel/apisupt.asm index fe39ebc..c3cf50b 100644 --- a/kernel/apisupt.asm +++ b/kernel/apisupt.asm @@ -27,6 +27,9 @@ ; $Id$ ; ; $Log$ +; Revision 1.5 2001/03/22 20:46:46 bartoldeman +; cli/sti corrections (Bart) and int25, 26 stack corrections (Tom) +; ; Revision 1.4 2001/03/21 02:56:25 bartoldeman ; See history.txt for changes. Bug fixes and HMA support are the main ones. ; @@ -85,7 +88,7 @@ segment HMA_TEXT global _set_stack ; -; void far set_stack(void) - +; void set_stack(void) - ; save current stack and setup our local stack ; _set_stack: @@ -95,7 +98,6 @@ _set_stack: ; we need to get the return values from the stack ; since the current stack will change pop ax ;get return offset - pop bx ;get return segment ; Save the flags so that we can restore correct interrupt ; state later. We need to disable interrupts so that we @@ -125,17 +127,16 @@ _set_stack: add bp, cx ; setup for ret - push bx push ax ; now restore interrupt state push dx popf - retf + ret ; -; void far restore_stack(void) - +; void restore_stack(void) - ; restore foreground stack, throw ours away ; global _restore_stack @@ -144,7 +145,6 @@ _restore_stack: ; we need to get the return values from the stack ; since the current stack will change pop cx ;get return offset - pop bx ;get return segment ; Save the flags so that we can restore correct interrupt ; state later. We need to disable interrupts so that we @@ -169,11 +169,10 @@ _restore_stack: ;mov bp,sp ; setup for ret - push bx push cx ; now restore interrupt state push dx popf - retf + ret diff --git a/kernel/entry.asm b/kernel/entry.asm index 78f8ed1..5577152 100644 --- a/kernel/entry.asm +++ b/kernel/entry.asm @@ -28,6 +28,9 @@ ; $Id$ ; ; $Log$ +; Revision 1.5 2001/03/22 20:46:46 bartoldeman +; cli/sti corrections (Bart) and int25, 26 stack corrections (Tom) +; ; Revision 1.4 2001/03/21 02:56:25 bartoldeman ; See history.txt for changes. Bug fixes and HMA support are the main ones. ; @@ -79,7 +82,7 @@ segment HMA_TEXT extern _int21_syscall:wrt HGROUP extern _int25_handler:wrt HGROUP extern _int26_handler:wrt HGROUP - extern _set_stack:wrt HMA_TEXT + extern _set_stack:wrt HGROUP extern _restore_stack:wrt HGROUP extern _error_tos:wrt DGROUP extern _char_api_tos:wrt DGROUP @@ -260,21 +263,22 @@ int21_reentry: cmp ah,62h jne int21_1 -int21_user: push word [_user_r+2] +int21_user: sti + push word [_user_r+2] push word [_user_r] call _int21_syscall pop cx pop cx jmp int21_ret -int21_1: sti +int21_1: cli cmp byte [_ErrorMode],0 je int21_2 mov bp,ds mov ss,bp mov bp,_error_tos mov sp,bp - cli + sti push word [_user_r+2] push word [_user_r] call _int21_syscall @@ -293,7 +297,7 @@ int21_2: inc byte [_InDOS] mov ss,bp mov bp,_char_api_tos mov sp,bp - cli + sti push word [_user_r+2] push word [_user_r] call _int21_syscall @@ -306,7 +310,7 @@ int21_3: mov ss,bp mov bp,_disk_api_tos mov sp,bp - cli + sti ; ; Push the far pointer to the register frame for ; int21_syscall and remainder of kernel. @@ -395,14 +399,14 @@ reloc_call_low_int25_handler: mov word [_api_sp], _disk_api_tos mov word [_api_ss], ds - call far _set_stack + call _set_stack push word [cs:stkframe+2] push word [cs:stkframe] call _int25_handler add sp, byte 4 - call far _restore_stack + call _restore_stack pop es pop ds @@ -444,14 +448,14 @@ reloc_call_low_int26_handler: mov word [_api_sp], _disk_api_tos mov word [_api_ss], ds - call far _set_stack + call _set_stack push word [cs:stkframe+2] push word [cs:stkframe] call _int26_handler add sp, 4 - call far _restore_stack + call _restore_stack pop es pop ds