* added closing of comment for logs to avoid warning

This commit is contained in:
Jonas Maebe 2002-09-08 09:16:15 +00:00
parent fb08ac116d
commit 8df1299d70
3 changed files with 360 additions and 348 deletions

View File

@ -22,18 +22,18 @@
EXCEPNO = 56 EXCEPNO = 56
PREVEXC = 60 PREVEXC = 60
/* Length 64 bytes plus non-used FPU */ /* Length 64 bytes plus non-used FPU */
.data .data
.balign 8 .balign 8
.comm exception_stack, 8000 .comm exception_stack, 8000
.text .text
.balign 16,,7 .balign 16,,7
.macro EXCEPTION_ENTRY number .macro EXCEPTION_ENTRY number
pushl \number pushl \number
jmp exception_handler jmp exception_handler
.endm .endm
.global ___djgpp_exception_table .global ___djgpp_exception_table
___djgpp_exception_table: ___djgpp_exception_table:
EXCEPTION_ENTRY $18 EXCEPTION_ENTRY $18
EXCEPTION_ENTRY $19 EXCEPTION_ENTRY $19
@ -56,19 +56,19 @@ EXCEPTION_ENTRY $15
EXCEPTION_ENTRY $16 EXCEPTION_ENTRY $16
EXCEPTION_ENTRY $17 EXCEPTION_ENTRY $17
/* This code is called any time an exception occurs in the 32 bit protected /* This code is called any time an exception occurs in the 32 bit protected
;* mode code. The exception number is pushed on the stack. This is called ;* mode code. The exception number is pushed on the stack. This is called
;* on a locked stack with interrupts disabled. Don't try to terminate. ;* on a locked stack with interrupts disabled. Don't try to terminate.
;* ;*
;* [ * | SS ] * Don't modify ;* [ * | SS ] * Don't modify
;* [ ESP ] ;* [ ESP ]
;* [ EFLAGS ] ;* [ EFLAGS ]
;* [ * | CS ] * Don't modify ;* [ * | CS ] * Don't modify
;* [ EIP ] ;* [ EIP ]
;* [ ERR CODE ] ;* [ ERR CODE ]
;* [ * |RET CS*] * Don't modify ;* [ * |RET CS*] * Don't modify
;* [ RET EIP* ] * Don't modify ;* [ RET EIP* ] * Don't modify
;* [ EXCEPTION # ] (And later EBP) ;* [ EXCEPTION # ] (And later EBP)
;*/ ;*/
/* ;WARNING WARNING WARNING /* ;WARNING WARNING WARNING
;The mechanism for passing signals between the debugger ;The mechanism for passing signals between the debugger
@ -79,374 +79,374 @@ EXCEPTION_ENTRY $17
;these two instructions, or you will break signal support in ;these two instructions, or you will break signal support in
;the debuggers!! */ ;the debuggers!! */
exception_handler: exception_handler:
pushl %ebx pushl %ebx
pushl %ds pushl %ds
.byte 0x2e /* CS: */ .byte 0x2e /* CS: */
cmpb $0, forced cmpb $0, forced
je not_forced je not_forced
call limitFix call limitFix
.byte 0x2e /* CS: */ .byte 0x2e /* CS: */
movzbl forced,%ebx movzbl forced,%ebx
movl %ebx,8(%esp) /* replace EXCEPNO */ movl %ebx,8(%esp) /* replace EXCEPNO */
cmpb $0x75, %bl cmpb $0x75, %bl
jne not_forced jne not_forced
movzwl ___djgpp_fpu_state,%ebx movzwl ___djgpp_fpu_state,%ebx
movl %ebx,20(%esp) /* set ERRCODE to FPU state */ movl %ebx,20(%esp) /* set ERRCODE to FPU state */
not_forced: not_forced:
movw %cs:___djgpp_our_DS, %ds movw %cs:___djgpp_our_DS, %ds
movl $0x10000, forced /* its zero now, flag inuse */ movl $0x10000, forced /* its zero now, flag inuse */
movl $exception_state, %ebx movl $exception_state, %ebx
popl DS(%ebx) popl DS(%ebx)
popl EBX(%ebx) popl EBX(%ebx)
popl EXCEPNO(%ebx) popl EXCEPNO(%ebx)
movl %esi, ESI(%ebx) movl %esi, ESI(%ebx)
movl %edi, EDI(%ebx) movl %edi, EDI(%ebx)
movl %ebp, EBP(%ebx) movl %ebp, EBP(%ebx)
movl %eax, EAX(%ebx) movl %eax, EAX(%ebx)
movl %ecx, ECX(%ebx) movl %ecx, ECX(%ebx)
movl %edx, EDX(%ebx) movl %edx, EDX(%ebx)
movw %es, ES(%ebx) movw %es, ES(%ebx)
movw %fs, FS(%ebx) movw %fs, FS(%ebx)
movw %gs, GS(%ebx) movw %gs, GS(%ebx)
movl ___djgpp_exception_state_ptr, %eax movl ___djgpp_exception_state_ptr, %eax
movl %eax, PREVEXC(%ebx) movl %eax, PREVEXC(%ebx)
/* Stack clean at this point, DS:[EBX] points to exception_state, all /* Stack clean at this point, DS:[EBX] points to exception_state, all
register information saved. Now get the info on stack. */ register information saved. Now get the info on stack. */
pushl %ebp pushl %ebp
movl %esp, %ebp /* load ebp with stack for easy access */ movl %esp, %ebp /* load ebp with stack for easy access */
movl 12(%ebp), %eax
movl %eax, ERRCODE(%ebx)
movl 16(%ebp), %eax
movl %eax, EIP(%ebx)
movl 20(%ebp), %eax
movw %ax, CS(%ebx)
movl 24(%ebp), %eax
movl %eax, EFLAGS(%ebx)
andb $0xfe, %ah /* Clear trace flag */
movl %eax, 24(%ebp) /* and restore on stack */
movl 28(%ebp), %eax movl 12(%ebp), %eax
movl %eax, ESP(%ebx) movl %eax, ERRCODE(%ebx)
movl 32(%ebp), %eax movl 16(%ebp), %eax
movw %ax, SS(%ebx) movl %eax, EIP(%ebx)
movl 20(%ebp), %eax
movw %ax, CS(%ebx)
movl 24(%ebp), %eax
movl %eax, EFLAGS(%ebx)
andb $0xfe, %ah /* Clear trace flag */
movl %eax, 24(%ebp) /* and restore on stack */
movl $dpmi_exception_proc1, 16(%ebp) /* where to return */ movl 28(%ebp), %eax
movw %cs, 20(%ebp) movl %eax, ESP(%ebx)
movl 32(%ebp), %eax
movw %ax, SS(%ebx)
movl $dpmi_exception_proc1, 16(%ebp) /* where to return */
movw %cs, 20(%ebp)
/* Change to our local stack on return from exception (maybe stack exception) */ /* Change to our local stack on return from exception (maybe stack exception) */
movw %ds, %ax movw %ds, %ax
cmpb $12,EXCEPNO(%ebx) /* Stack fault ? */ cmpb $12,EXCEPNO(%ebx) /* Stack fault ? */
je 1f je 1f
cmpw %ax,32(%ebp) cmpw %ax,32(%ebp)
je stack_ok je stack_ok
.byte 0x2e /* CS: */ .byte 0x2e /* CS: */
movw ___djgpp_ds_alias,%di movw ___djgpp_ds_alias,%di
cmpw %di,32(%ebp) /* if it's DS alias, switch to normal DS */ cmpw %di,32(%ebp) /* if it's DS alias, switch to normal DS */
jne 1f jne 1f
movw %ax,32(%ebp) movw %ax,32(%ebp)
jmp stack_ok jmp stack_ok
1: movl $exception_stack+8000, 28(%ebp) 1: movl $exception_stack+8000, 28(%ebp)
movw %ax, 32(%ebp) movw %ax, 32(%ebp)
stack_ok: stack_ok:
/* Now copy the exception structure to the new stack before returning */ /* Now copy the exception structure to the new stack before returning */
movw %ax, %es movw %ax, %es
movl %ebx,%esi movl %ebx,%esi
movl 28(%ebp), %edi movl 28(%ebp), %edi
subl $92, %edi /* 64 plus extra for longjmp */ subl $92, %edi /* 64 plus extra for longjmp */
movl %edi, 28(%ebp) movl %edi, 28(%ebp)
movl %edi, ___djgpp_exception_state_ptr movl %edi, ___djgpp_exception_state_ptr
movl $16, %ecx movl $16, %ecx
cld cld
rep rep
movsl movsl
movl EAX(%ebx), %eax /* restore regs */ movl EAX(%ebx), %eax /* restore regs */
movl ESI(%ebx), %esi movl ESI(%ebx), %esi
movl EDI(%ebx), %edi movl EDI(%ebx), %edi
movl ECX(%ebx), %ecx movl ECX(%ebx), %ecx
movw ES(%ebx), %es movw ES(%ebx), %es
popl %ebp popl %ebp
pushl EBX(%ebx) pushl EBX(%ebx)
pushl DS(%ebx) pushl DS(%ebx)
movb $0, forced+2 /* flag non-use */ movb $0, forced+2 /* flag non-use */
popl %ds popl %ds
popl %ebx popl %ebx
lret lret
/* Code to fix fake exception, EBX destroyed. Note, app_DS may == our_DS! */ /* Code to fix fake exception, EBX destroyed. Note, app_DS may == our_DS! */
.balign 16,,7 .balign 16,,7
limitFix: limitFix:
pushl %eax pushl %eax
pushl %ecx pushl %ecx
pushl %edx pushl %edx
.byte 0x2e /* CS: */ .byte 0x2e /* CS: */
movl ___djgpp_app_DS, %ebx /* avoid size prefix */ movl ___djgpp_app_DS, %ebx /* avoid size prefix */
.byte 0x2e /* CS: */ .byte 0x2e /* CS: */
movl ds_limit, %edx movl ds_limit, %edx
movl %edx, %ecx movl %edx, %ecx
shrl $16, %ecx shrl $16, %ecx
movw $0x0008, %ax movw $0x0008, %ax
int $0x31 /* Set segment limit */ int $0x31 /* Set segment limit */
popl %edx popl %edx
popl %ecx popl %ecx
popl %eax popl %eax
ret ret
/* This local routine preprocesses a return request to the C code. It checks /* This local routine preprocesses a return request to the C code. It checks
to make sure the DS & SS are set OK for C code. If not, it sets them up */ to make sure the DS & SS are set OK for C code. If not, it sets them up */
.balign 16,,7 .balign 16,,7
dpmi_exception_proc1: dpmi_exception_proc1:
cld cld
.byte 0x2e /* CS: !!! */ .byte 0x2e /* CS: !!! */
movw ___djgpp_our_DS, %bx /* to be sure */ movw ___djgpp_our_DS, %bx /* to be sure */
movw %bx, %ds movw %bx, %ds
movw %bx, %es movw %bx, %es
/* Note: SS:ESP should be set properly by exception routine */ /* Note: SS:ESP should be set properly by exception routine */
jmp ___djgpp_exception_processor jmp ___djgpp_exception_processor
/* This code is called by a user routine wishing to save an interrupt /* This code is called by a user routine wishing to save an interrupt
;* state. It will return with a clean stack, our DS,ES,SS. ;* state. It will return with a clean stack, our DS,ES,SS.
;* Minor bug: uses static exception_state for a short window without ;* Minor bug: uses static exception_state for a short window without
;* interrupts guaranteed disabled. ;* interrupts guaranteed disabled.
;* ;*
;* [ EFLAGS ] ;* [ EFLAGS ]
;* [ * | CS ] ;* [ * | CS ]
;* [ EIP ] ;* [ EIP ]
;* [ CALLING EIP ] ;* [ CALLING EIP ]
;*/ ;*/
.balign 16,,7 .balign 16,,7
.globl ___djgpp_save_interrupt_regs .globl ___djgpp_save_interrupt_regs
___djgpp_save_interrupt_regs: ___djgpp_save_interrupt_regs:
pushl %esi pushl %esi
pushl %ds pushl %ds
movw %cs:___djgpp_our_DS, %ds movw %cs:___djgpp_our_DS, %ds
movl $exception_state, %esi movl $exception_state, %esi
popl DS(%esi) /* Trashes ES but OK */ popl DS(%esi) /* Trashes ES but OK */
popl ESI(%esi) popl ESI(%esi)
movl %edi, EDI(%esi) movl %edi, EDI(%esi)
movl %ebp, EBP(%esi) movl %ebp, EBP(%esi)
movl %eax, EAX(%esi) movl %eax, EAX(%esi)
movl %ebx, EBX(%esi) movl %ebx, EBX(%esi)
movl %ecx, ECX(%esi) movl %ecx, ECX(%esi)
movl %edx, EDX(%esi) movl %edx, EDX(%esi)
popl %edx /* Save calling EIP */ popl %edx /* Save calling EIP */
popl EIP(%esi) popl EIP(%esi)
popl %eax popl %eax
movw %ax,CS(%esi) /* Don't pop, nukes DS */ movw %ax,CS(%esi) /* Don't pop, nukes DS */
popl EFLAGS(%esi) popl EFLAGS(%esi)
movl %esp, ESP(%esi) movl %esp, ESP(%esi)
movw %es, ES(%esi) movw %es, ES(%esi)
movw %fs, FS(%esi) movw %fs, FS(%esi)
movw %gs, GS(%esi) movw %gs, GS(%esi)
movw %ss, SS(%esi) movw %ss, SS(%esi)
movl ___djgpp_exception_state_ptr, %eax movl ___djgpp_exception_state_ptr, %eax
movl %eax, PREVEXC(%esi) movl %eax, PREVEXC(%esi)
cld cld
movw %ds, %ax movw %ds, %ax
movw %ax, %es movw %ax, %es
movw %ss, %bx movw %ss, %bx
cmpw %ax, %bx /* is SS = DS ? */ cmpw %ax, %bx /* is SS = DS ? */
je Lss_ok je Lss_ok
movw %ax, %ss /* set new SS:ESP */ movw %ax, %ss /* set new SS:ESP */
movl $exception_stack+8000, %esp movl $exception_stack+8000, %esp
Lss_ok: subl $92, %esp /* 64 plus extra for longjmp */ Lss_ok: subl $92, %esp /* 64 plus extra for longjmp */
movl %esp, %edi movl %esp, %edi
movl $16, %ecx movl $16, %ecx
movl %edi, ___djgpp_exception_state_ptr movl %edi, ___djgpp_exception_state_ptr
rep rep
movsl /* Copy structure to stack */ movsl /* Copy structure to stack */
jmp *%edx /* A "return" */ jmp *%edx /* A "return" */
.balign 8 /* We will touch this; it must be locked */ .balign 8 /* We will touch this; it must be locked */
.global ___djgpp_hw_lock_start .global ___djgpp_hw_lock_start
___djgpp_hw_lock_start: ___djgpp_hw_lock_start:
/* src/debug/common/dbgcom.c knows that `ds_limit' is stored /* src/debug/common/dbgcom.c knows that `ds_limit' is stored
4 bytes before `forced' and relies on that. Do NOT change that! */ 4 bytes before `forced' and relies on that. Do NOT change that! */
ds_limit: .long 0 ds_limit: .long 0
forced: .long 0 forced: .long 0
.global ___djgpp_cbrk_count .global ___djgpp_cbrk_count
___djgpp_cbrk_count: .long 0 ___djgpp_cbrk_count: .long 0
.global ___djgpp_timer_countdown .global ___djgpp_timer_countdown
___djgpp_timer_countdown: .long 0 ___djgpp_timer_countdown: .long 0
.global ___djgpp_our_DS .global ___djgpp_our_DS
___djgpp_our_DS: .word 0 ___djgpp_our_DS: .word 0
.global ___djgpp_app_DS .global ___djgpp_app_DS
___djgpp_app_DS: .word 0 ___djgpp_app_DS: .word 0
.global ___djgpp_dos_sel .global ___djgpp_dos_sel
___djgpp_dos_sel: .word 0 ___djgpp_dos_sel: .word 0
.global ___djgpp_hwint_flags .global ___djgpp_hwint_flags
___djgpp_hwint_flags: .word 0 ___djgpp_hwint_flags: .word 0
.global ___djgpp_sigint_key .global ___djgpp_sigint_key
___djgpp_sigint_key: .word 0 /* scan code and kb status */ ___djgpp_sigint_key: .word 0 /* scan code and kb status */
.global ___djgpp_sigint_mask .global ___djgpp_sigint_mask
___djgpp_sigint_mask: .word 0 /* kb status mask */ ___djgpp_sigint_mask: .word 0 /* kb status mask */
.global ___djgpp_sigquit_key .global ___djgpp_sigquit_key
___djgpp_sigquit_key: .word 0 ___djgpp_sigquit_key: .word 0
.global ___djgpp_sigquit_mask .global ___djgpp_sigquit_mask
___djgpp_sigquit_mask: .word 0 ___djgpp_sigquit_mask: .word 0
.global ___djgpp_old_kbd .global ___djgpp_old_kbd
___djgpp_old_kbd: .long 0,0 ___djgpp_old_kbd: .long 0,0
.global ___djgpp_old_timer .global ___djgpp_old_timer
___djgpp_old_timer: .long 0,0 ___djgpp_old_timer: .long 0,0
.global ___djgpp_exception_state_ptr .global ___djgpp_exception_state_ptr
___djgpp_exception_state_ptr: .long 0 ___djgpp_exception_state_ptr: .long 0
exception_state: .space 64 exception_state: .space 64
.global ___djgpp_ds_alias .global ___djgpp_ds_alias
___djgpp_ds_alias: .word 0 /* used in dpmi/api/d0303.s (alloc rmcb) */ ___djgpp_ds_alias: .word 0 /* used in dpmi/api/d0303.s (alloc rmcb) */
.global ___djgpp_fpu_state .global ___djgpp_fpu_state
___djgpp_fpu_state: .word 0 ___djgpp_fpu_state: .word 0
.balign 16,,7 .balign 16,,7
.global ___djgpp_npx_hdlr .global ___djgpp_npx_hdlr
___djgpp_npx_hdlr: ___djgpp_npx_hdlr:
fnstsw ___djgpp_fpu_state fnstsw ___djgpp_fpu_state
fnclex fnclex
pushl %eax pushl %eax
xorl %eax,%eax xorl %eax,%eax
outb %al,$0x0f0 outb %al,$0x0f0
movb $0x20,%al movb $0x20,%al
outb %al,$0x0a0 outb %al,$0x0a0
outb %al,$0x020 outb %al,$0x020
movb $0x75,%al movb $0x75,%al
hw_to_excp: hw_to_excp:
call ___djgpp_hw_exception call ___djgpp_hw_exception
popl %eax popl %eax
sti sti
iret iret
.balign 16,,7 .balign 16,,7
.global ___djgpp_kbd_hdlr .global ___djgpp_kbd_hdlr
___djgpp_kbd_hdlr: ___djgpp_kbd_hdlr:
pushl %eax pushl %eax
pushl %ebx pushl %ebx
pushl %ds pushl %ds
.byte 0x2e /* CS: */ .byte 0x2e /* CS: */
testb $1, ___djgpp_hwint_flags /* Disable? */ testb $1, ___djgpp_hwint_flags /* Disable? */
jne Lkbd_chain jne Lkbd_chain
movw %cs:___djgpp_dos_sel, %ds /* Conventional mem selector */ movw %cs:___djgpp_dos_sel, %ds /* Conventional mem selector */
/* movw $0x7021,0xb0f00 */ /* Test code - write to mono */ /* movw $0x7021,0xb0f00 */ /* Test code - write to mono */
/* Check Keyboard status bits */ /* Check Keyboard status bits */
movb 0x417,%ah /* Get KB status byte */ movb 0x417,%ah /* Get KB status byte */
testb $1,%ah testb $1,%ah
je 6f je 6f
orb $2,%ah /* If RShift is set, set LShift as well */ orb $2,%ah /* If RShift is set, set LShift as well */
6: 6:
inb $0x60,%al /* Read the scan code */ inb $0x60,%al /* Read the scan code */
99: 99:
movb %ah,%bh /* Save KB status */ movb %ah,%bh /* Save KB status */
andb %cs:___djgpp_sigint_mask, %ah /* Mask off irrelevant bits */ andb %cs:___djgpp_sigint_mask, %ah /* Mask off irrelevant bits */
cmpw %cs:___djgpp_sigint_key, %ax /* Test for SIGINT */ cmpw %cs:___djgpp_sigint_key, %ax /* Test for SIGINT */
jne 7f jne 7f
movb $0x79,%bh /* SIGINT */ movb $0x79,%bh /* SIGINT */
jmp 98f jmp 98f
7: 7:
movb %bh,%ah /* Restore KB status */ movb %bh,%ah /* Restore KB status */
andb %cs:___djgpp_sigquit_mask, %ah /* Mask off irrelevant bits */ andb %cs:___djgpp_sigquit_mask, %ah /* Mask off irrelevant bits */
cmpw %cs:___djgpp_sigquit_key, %ax /* Test for SIGQUIT*/ cmpw %cs:___djgpp_sigquit_key, %ax /* Test for SIGQUIT*/
jne Lkbd_chain jne Lkbd_chain
movb $0x7a,%bh /* SIGQUIT */ movb $0x7a,%bh /* SIGQUIT */
/* Clear interrupt, (later: remove byte from controller?) /* Clear interrupt, (later: remove byte from controller?)
movb $0x20,%al movb $0x20,%al
outb %al,$0x020 */ outb %al,$0x020 */
98: 98:
movb %bh,%al movb %bh,%al
call ___djgpp_hw_exception call ___djgpp_hw_exception
Lkbd_chain: Lkbd_chain:
popl %ds popl %ds
popl %ebx popl %ebx
popl %eax popl %eax
ljmp %cs:___djgpp_old_kbd ljmp %cs:___djgpp_old_kbd
.balign 16,,7 .balign 16,,7
.global ___djgpp_kbd_hdlr_pc98 .global ___djgpp_kbd_hdlr_pc98
___djgpp_kbd_hdlr_pc98: ___djgpp_kbd_hdlr_pc98:
pushl %eax pushl %eax
pushl %ebx pushl %ebx
pushl %ds pushl %ds
.byte 0x2e /* CS: */ .byte 0x2e /* CS: */
testb $1, ___djgpp_hwint_flags /* Disable? */ testb $1, ___djgpp_hwint_flags /* Disable? */
jne Lkbd_chain jne Lkbd_chain
/* Check CTRL state */ /* Check CTRL state */
movw %cs:___djgpp_dos_sel, %ds /* Conventional mem selector */ movw %cs:___djgpp_dos_sel, %ds /* Conventional mem selector */
movb 0x053a,%al /* Get KB status byte */ movb 0x053a,%al /* Get KB status byte */
/* Convert PC98 style status byte to PC/AT style */ /* Convert PC98 style status byte to PC/AT style */
movb %al,%ah movb %al,%ah
andb $0x09,%ah /* GRPH(=ALT), SHIFT(=R-Shift) */ andb $0x09,%ah /* GRPH(=ALT), SHIFT(=R-Shift) */
testb $0x02,%al testb $0x02,%al
je 981f je 981f
orb $0x40,%ah /* CAPS(=Caps Lock) */ orb $0x40,%ah /* CAPS(=Caps Lock) */
981: testb $0x10,%al 981: testb $0x10,%al
je 982f je 982f
orb $0x04,%ah /* CTRL(=Ctrl) */ orb $0x04,%ah /* CTRL(=Ctrl) */
982: testb $0x01,%al 982: testb $0x01,%al
je 983f je 983f
orb $0x02,%ah /* SHIFT(=L-Shift) */ orb $0x02,%ah /* SHIFT(=L-Shift) */
983: testb $0x04,%al 983: testb $0x04,%al
je 984f je 984f
orb $0x20,%ah /* KANA(=NUM Lock) */ orb $0x20,%ah /* KANA(=NUM Lock) */
984: inb $0x41,%al /* Read the scan code */ 984: inb $0x41,%al /* Read the scan code */
jmp 99b jmp 99b
.balign 16,,7 .balign 16,,7
.global ___djgpp_timer_hdlr .global ___djgpp_timer_hdlr
___djgpp_timer_hdlr: ___djgpp_timer_hdlr:
.byte 0x2e /* CS: */ .byte 0x2e /* CS: */
cmpl $0,___djgpp_timer_countdown cmpl $0,___djgpp_timer_countdown
je 4f je 4f
pushl %ds pushl %ds
movw %cs:___djgpp_ds_alias, %ds movw %cs:___djgpp_ds_alias, %ds
decl ___djgpp_timer_countdown decl ___djgpp_timer_countdown
popl %ds popl %ds
jmp 3f jmp 3f
4: 4:
pushl %eax pushl %eax
movb $0x78,%al movb $0x78,%al
call ___djgpp_hw_exception call ___djgpp_hw_exception
popl %eax popl %eax
3: 3:
.byte 0x2e /* CS: */ .byte 0x2e /* CS: */
testb $4, ___djgpp_hwint_flags /* IRET or chain? */ testb $4, ___djgpp_hwint_flags /* IRET or chain? */
jne 2f jne 2f
ljmp %cs:___djgpp_old_timer ljmp %cs:___djgpp_old_timer
2: 2:
pushl %eax pushl %eax
movb $0x20,%al /* EOI the interrupt */ movb $0x20,%al /* EOI the interrupt */
outb %al,$0x020 outb %al,$0x020
popl %eax popl %eax
iret iret
/* On entry ES is the DS alias selector */ /* On entry ES is the DS alias selector */
.balign 16,,7 .balign 16,,7
.global ___djgpp_cbrk_hdlr /* A RMCB handler for 0x1b */ .global ___djgpp_cbrk_hdlr /* A RMCB handler for 0x1b */
___djgpp_cbrk_hdlr: ___djgpp_cbrk_hdlr:
cld cld
lodsl /* EAX = DS:[esi] CS:IP */ lodsl /* EAX = DS:[esi] CS:IP */
movl %eax, %es:0x2a(%edi) /* store in structure */ movl %eax, %es:0x2a(%edi) /* store in structure */
lodsl /* AX = FLAGS */ lodsl /* AX = FLAGS */
movw %ax, %es:0x20(%edi) movw %ax, %es:0x20(%edi)
addw $6, %es:0x2e(%edi) /* Adjust RM SP */ addw $6, %es:0x2e(%edi) /* Adjust RM SP */
movb $0x1b,%al movb $0x1b,%al
.byte 0x2e /* CS: */ .byte 0x2e /* CS: */
testb $2, ___djgpp_hwint_flags /* Count, don't kill */ testb $2, ___djgpp_hwint_flags /* Count, don't kill */
jne 1f jne 1f
call ___djgpp_hw_exception call ___djgpp_hw_exception
iret iret
1: 1:
incl %es:___djgpp_cbrk_count incl %es:___djgpp_cbrk_count
iret iret
.global ___djgpp_i24 /* Int 24 handler if needed */ .global ___djgpp_i24 /* Int 24 handler if needed */
.global ___djgpp_iret /* Int 23 handler if needed */ .global ___djgpp_iret /* Int 23 handler if needed */
___djgpp_i24: ___djgpp_i24:
movb $3,%al movb $3,%al
___djgpp_iret: ___djgpp_iret:
iret iret
/* Code to stop execution ASAP, EAX destroyed. Make DS/ES/SS invalid. /* Code to stop execution ASAP, EAX destroyed. Make DS/ES/SS invalid.
Fake exception value is passed in AL and moved into the "forced" variable. Fake exception value is passed in AL and moved into the "forced" variable.
@ -454,38 +454,42 @@ ___djgpp_iret:
control away from via longjmp or exit(), common with SIGINT, SIGFPE, or control away from via longjmp or exit(), common with SIGINT, SIGFPE, or
if we want EIP information on timers. */ if we want EIP information on timers. */
.balign 16,,7 .balign 16,,7
.global ___djgpp_hw_exception .global ___djgpp_hw_exception
___djgpp_hw_exception: ___djgpp_hw_exception:
.byte 0x2e /* CS: */ .byte 0x2e /* CS: */
cmpl $0, forced /* Already flagged? */ cmpl $0, forced /* Already flagged? */
jne already_forced jne already_forced
pushl %ebx pushl %ebx
pushl %ecx pushl %ecx
pushl %edx pushl %edx
pushl %ds pushl %ds
movw %cs:___djgpp_our_DS, %ds movw %cs:___djgpp_our_DS, %ds
movl ___djgpp_app_DS, %ebx /* avoid size prefix */ movl ___djgpp_app_DS, %ebx /* avoid size prefix */
lsl %ebx, %ecx lsl %ebx, %ecx
movl %ecx, ds_limit /* Save current limit */ movl %ecx, ds_limit /* Save current limit */
movb %al, forced /* Indicate a fake exception */ movb %al, forced /* Indicate a fake exception */
xorl %ecx, %ecx xorl %ecx, %ecx
movw $0xfff, %dx /* 4K limit is null page ! */ movw $0xfff, %dx /* 4K limit is null page ! */
movw $0x0008, %ax movw $0x0008, %ax
int $0x31 /* Set segment limit */ int $0x31 /* Set segment limit */
5: popl %ds 5: popl %ds
popl %edx popl %edx
popl %ecx popl %ecx
popl %ebx popl %ebx
already_forced: already_forced:
ret ret
.global ___djgpp_hw_lock_end .global ___djgpp_hw_lock_end
___djgpp_hw_lock_end: ___djgpp_hw_lock_end:
ret /* LD does weird things */ ret /* LD does weird things */
/* /*
$Log$ $Log$
Revision 1.5 2002-09-07 16:01:18 peter Revision 1.6 2002-09-08 09:16:15 jonas
* added closing of comment for logs to avoid warning
Revision 1.5 2002/09/07 16:01:18 peter
* old logs removed and tabs fixed * old logs removed and tabs fixed
*/

View File

@ -50,6 +50,10 @@ Lexit:
ret ret
/* /*
$Log$ $Log$
Revision 1.3 2002-09-07 16:01:18 peter Revision 1.4 2002-09-08 09:16:15 jonas
* added closing of comment for logs to avoid warning
Revision 1.3 2002/09/07 16:01:18 peter
* old logs removed and tabs fixed * old logs removed and tabs fixed
*/

View File

@ -935,9 +935,13 @@ ___PROXY_LEN:
/* /*
$Log$ $Log$
Revision 1.5 2002-09-07 16:01:19 peter Revision 1.6 2002-09-08 09:16:15 jonas
* added closing of comment for logs to avoid warning
Revision 1.5 2002/09/07 16:01:19 peter
* old logs removed and tabs fixed * old logs removed and tabs fixed
Revision 1.4 2002/02/03 09:51:41 peter Revision 1.4 2002/02/03 09:51:41 peter
* merged winxp fixes * merged winxp fixes
*/