assert ( undiisr_irq == 0 );
undiisr_irq = irq;
- hook_bios_interrupt ( IRQ_INT ( irq ),
- ( ( unsigned int ) undiisr ),
+ hook_bios_interrupt ( IRQ_INT ( irq ), ( ( intptr_t ) undiisr ),
&undiisr_next_handler );
}
assert ( irq <= IRQ_MAX );
- unhook_bios_interrupt ( IRQ_INT ( irq ),
- ( ( unsigned int ) undiisr ),
+ unhook_bios_interrupt ( IRQ_INT ( irq ), ( ( intptr_t ) undiisr ),
&undiisr_next_handler );
undiisr_irq = 0;
}
: : "i" ( bios_inject ) );
/* Hook INT 16 */
- hook_bios_interrupt ( 0x16, ( ( unsigned int ) int16_wrapper ),
+ hook_bios_interrupt ( 0x16, ( ( intptr_t ) int16_wrapper ),
&int16_vector );
}
static void bios_inject_shutdown ( int booting __unused ) {
/* Unhook INT 16 */
- unhook_bios_interrupt ( 0x16, ( ( unsigned int ) int16_wrapper ),
+ unhook_bios_interrupt ( 0x16, ( ( intptr_t ) int16_wrapper ),
&int16_vector );
}
"ljmp *%%cs:real_int15_vector\n\t" )
: : "i" ( sizeof ( e820map ) ) );
- hook_bios_interrupt ( 0x15, ( unsigned int ) int15_fakee820,
+ hook_bios_interrupt ( 0x15, ( intptr_t ) int15_fakee820,
&real_int15_vector );
}
void unfake_e820 ( void ) {
- unhook_bios_interrupt ( 0x15, ( unsigned int ) int15_fakee820,
+ unhook_bios_interrupt ( 0x15, ( intptr_t ) int15_fakee820,
&real_int15_vector );
}
}
/* Hook INT 15 */
- hook_bios_interrupt ( 0x15, ( unsigned int ) int15,
- &int15_vector );
+ hook_bios_interrupt ( 0x15, ( intptr_t ) int15, &int15_vector );
/* Dump memory map after mangling */
DBG ( "Hidden iPXE from system memory map\n" );
}
/* Try to unhook INT 15 */
- if ( ( rc = unhook_bios_interrupt ( 0x15, ( unsigned int ) int15,
+ if ( ( rc = unhook_bios_interrupt ( 0x15, ( intptr_t ) int15,
&int15_vector ) ) != 0 ) {
DBG ( "Cannot unhook INT15: %s\n", strerror ( rc ) );
/* Leave it hooked; there's nothing else we can do,
DBG ( "Booting from boot sector at %04x:%04x\n", segment, offset );
/* Hook INTs 18 and 19 to capture failure paths */
- hook_bios_interrupt ( 0x18, ( unsigned int ) bootsector_exec_fail,
+ hook_bios_interrupt ( 0x18, ( intptr_t ) bootsector_exec_fail,
&int18_vector );
- hook_bios_interrupt ( 0x19, ( unsigned int ) bootsector_exec_fail,
+ hook_bios_interrupt ( 0x19, ( intptr_t ) bootsector_exec_fail,
&int19_vector );
/* Boot the loaded sector
DBG ( "Booted disk returned via INT 18 or 19\n" );
/* Unhook INTs 18 and 19 */
- unhook_bios_interrupt ( 0x18, ( unsigned int ) bootsector_exec_fail,
+ unhook_bios_interrupt ( 0x18, ( intptr_t ) bootsector_exec_fail,
&int18_vector );
- unhook_bios_interrupt ( 0x19, ( unsigned int ) bootsector_exec_fail,
+ unhook_bios_interrupt ( 0x19, ( intptr_t ) bootsector_exec_fail,
&int19_vector );
return -ECANCELED;
"iret\n\t" )
: : "i" ( int13 ) );
- hook_bios_interrupt ( 0x13, ( unsigned int ) int13_wrapper,
- &int13_vector );
+ hook_bios_interrupt ( 0x13, ( intptr_t ) int13_wrapper, &int13_vector );
}
/**
* Unhook INT 13 handler
*/
static void int13_unhook_vector ( void ) {
- unhook_bios_interrupt ( 0x13, ( unsigned int ) int13_wrapper,
+ unhook_bios_interrupt ( 0x13, ( intptr_t ) int13_wrapper,
&int13_vector );
}
"i" ( CMOS_ADDRESS ), "i" ( CMOS_DATA ),
"i" ( RTC_STATUS_C ) );
- hook_bios_interrupt ( RTC_INT, ( unsigned int ) rtc_isr,
- &rtc_old_handler );
+ hook_bios_interrupt ( RTC_INT, ( intptr_t ) rtc_isr, &rtc_old_handler );
}
/**
static void rtc_unhook_isr ( void ) {
int rc;
- rc = unhook_bios_interrupt ( RTC_INT, ( unsigned int ) rtc_isr,
+ rc = unhook_bios_interrupt ( RTC_INT, ( intptr_t ) rtc_isr,
&rtc_old_handler );
assert ( rc == 0 ); /* Should always be able to unhook */
}
/* Ensure INT 1A is hooked */
if ( ! int_1a_hooked ) {
- hook_bios_interrupt ( 0x1a, ( unsigned int ) pxe_int_1a,
+ hook_bios_interrupt ( 0x1a, ( intptr_t ) pxe_int_1a,
&pxe_int_1a_vector );
devices_get();
int_1a_hooked = 1;
/* Ensure INT 1A is unhooked, if possible */
if ( int_1a_hooked ) {
if ( ( rc = unhook_bios_interrupt ( 0x1a,
- (unsigned int) pxe_int_1a,
+ ( intptr_t ) pxe_int_1a,
&pxe_int_1a_vector ))!= 0){
DBGC ( &pxe_netdev, "PXE could not unhook INT 1A: %s\n",
strerror ( rc ) );
"iret\n\t" )
: : "i" ( int20 ) );
- hook_bios_interrupt ( 0x20, ( unsigned int ) int20_wrapper,
- &int20_vector );
+ hook_bios_interrupt ( 0x20, ( intptr_t ) int20_wrapper, &int20_vector );
__asm__ __volatile__ (
TEXT16_CODE ( "\nint21_wrapper:\n\t"
"iret\n\t" )
: : "i" ( int21 ) );
- hook_bios_interrupt ( 0x21, ( unsigned int ) int21_wrapper,
- &int21_vector );
+ hook_bios_interrupt ( 0x21, ( intptr_t ) int21_wrapper, &int21_vector );
__asm__ __volatile__ (
TEXT16_CODE ( "\nint22_wrapper:\n\t"
"iret\n\t" )
: : "i" ( int22) );
- hook_bios_interrupt ( 0x22, ( unsigned int ) int22_wrapper,
- &int22_vector );
+ hook_bios_interrupt ( 0x22, ( intptr_t ) int22_wrapper, &int22_vector );
}
/**
*/
void unhook_comboot_interrupts ( ) {
- unhook_bios_interrupt ( 0x20, ( unsigned int ) int20_wrapper,
+ unhook_bios_interrupt ( 0x20, ( intptr_t ) int20_wrapper,
&int20_vector );
- unhook_bios_interrupt ( 0x21, ( unsigned int ) int21_wrapper,
+ unhook_bios_interrupt ( 0x21, ( intptr_t ) int21_wrapper,
&int21_vector );
- unhook_bios_interrupt ( 0x22, ( unsigned int ) int22_wrapper,
+ unhook_bios_interrupt ( 0x22, ( intptr_t ) int22_wrapper,
&int22_vector );
}