mirror of
https://github.com/ipxe/ipxe
synced 2025-12-28 02:28:57 +03:00
[comboot] Use built-in interrupt reflector
We now have the ability to handle interrupts while in protected mode, and so no longer need to set up a dedicated interrupt descriptor table while running COM32 executables. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -189,20 +189,3 @@ int __asmcall com32_cfarcall ( uint32_t proc, physaddr_t stack, size_t stacksz )
|
||||
|
||||
return eax;
|
||||
}
|
||||
|
||||
/**
|
||||
* IRQ handler
|
||||
*/
|
||||
void __asmcall com32_irq ( uint32_t vector ) {
|
||||
uint32_t *ivt_entry = phys_to_virt( vector * 4 );
|
||||
|
||||
__asm__ __volatile__ (
|
||||
REAL_CODE ( "pushfw\n\t"
|
||||
"pushw %%cs\n\t"
|
||||
"pushw $com32_irq_return\n\t"
|
||||
"pushl %0\n\t"
|
||||
"lret\n"
|
||||
"com32_irq_return:\n\t" )
|
||||
: /* no outputs */
|
||||
: "r" ( *ivt_entry ) );
|
||||
}
|
||||
|
||||
@@ -23,26 +23,6 @@ FILE_LICENCE ( GPL2_OR_LATER )
|
||||
.arch i386
|
||||
.code32
|
||||
|
||||
/*
|
||||
* This code is entered after running the following sequence out of
|
||||
* the interrupt jump buffer:
|
||||
*
|
||||
* pushal
|
||||
* movb $vector, %al
|
||||
* jmp com32_irq_wrapper
|
||||
*/
|
||||
|
||||
.globl com32_irq_wrapper
|
||||
com32_irq_wrapper:
|
||||
|
||||
movzbl %al,%eax
|
||||
pushl %eax
|
||||
movl $com32_irq, %eax
|
||||
call com32_wrapper
|
||||
popl %eax
|
||||
popal
|
||||
iret
|
||||
|
||||
.globl com32_farcall_wrapper
|
||||
com32_farcall_wrapper:
|
||||
|
||||
@@ -69,9 +49,6 @@ com32_wrapper:
|
||||
/* Switch to internal virtual address space */
|
||||
call _phys_to_virt
|
||||
|
||||
/* Switch to internal IDT (if we have one for debugging) */
|
||||
lidt com32_internal_idtr
|
||||
|
||||
mov %eax, (com32_helper_function)
|
||||
|
||||
/* Save external COM32 stack pointer */
|
||||
@@ -99,9 +76,6 @@ com32_wrapper:
|
||||
movl %esp, (com32_internal_esp)
|
||||
movl (com32_external_esp), %esp
|
||||
|
||||
/* Switch to com32 IDT */
|
||||
lidt com32_external_idtr
|
||||
|
||||
/* Switch to external flat physical address space */
|
||||
call _virt_to_phys
|
||||
|
||||
|
||||
Reference in New Issue
Block a user