]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[bios] Use intptr_t when casting .text16 function pointers
authorMichael Brown <mcb30@ipxe.org>
Tue, 16 Feb 2016 16:24:30 +0000 (16:24 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 16 Feb 2016 19:32:32 +0000 (19:32 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/drivers/net/undinet.c
src/arch/i386/firmware/pcbios/bios_console.c
src/arch/i386/firmware/pcbios/fakee820.c
src/arch/i386/firmware/pcbios/hidemem.c
src/arch/i386/image/bootsector.c
src/arch/i386/interface/pcbios/int13.c
src/arch/i386/interface/pcbios/rtc_entropy.c
src/arch/i386/interface/pxe/pxe_call.c
src/arch/i386/interface/syslinux/comboot_call.c

index 6450665ff749d41039b6e465fabb22c1171865cd..e273ae0a28c945859ed39d991cd36db3be110b6e 100644 (file)
@@ -143,8 +143,7 @@ static void undinet_hook_isr ( unsigned int irq ) {
        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 );
 }
 
@@ -157,8 +156,7 @@ static void undinet_unhook_isr ( unsigned int irq ) {
 
        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;
 }
index 2e252ecbdbfa10c70469375c9cb8aa44174c63d3..ee6cdce2f261cf8df0627f2ad4c32ac3af36135b 100644 (file)
@@ -543,7 +543,7 @@ static void bios_inject_startup ( void ) {
                : : "i" ( bios_inject ) );
 
        /* Hook INT 16 */
-       hook_bios_interrupt ( 0x16, ( ( unsigned int ) int16_wrapper ),
+       hook_bios_interrupt ( 0x16, ( ( intptr_t ) int16_wrapper ),
                              &int16_vector );
 }
 
@@ -555,7 +555,7 @@ static void bios_inject_startup ( void ) {
 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 );
 }
 
index 15f4d772f4c8e18ddc1a78d8fc3f169cc80d743f..8b083c4f008ff14b480610b0f63fb4f7e39bdafb 100644 (file)
@@ -88,11 +88,11 @@ void fake_e820 ( void ) {
                              "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 );
 }
index 253c601ffcad1bc53b81437e29f0fbc2f50d92b6..9f9e4f5f726c43136934fca1c1de790386ca483c 100644 (file)
@@ -179,8 +179,7 @@ static void hide_etherboot ( void ) {
        }
 
        /* 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" );
@@ -210,7 +209,7 @@ static void unhide_etherboot ( int flags __unused ) {
        }
 
        /* 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,
index dba87613cc80aad6c773734eddfb720a8b2edc67..67dad04f81ccea513aad6fae36fedc3e8a663759 100644 (file)
@@ -71,9 +71,9 @@ int call_bootsector ( unsigned int segment, unsigned int offset,
        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
@@ -132,9 +132,9 @@ int call_bootsector ( unsigned int segment, unsigned int offset,
        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;
index f0450da9066a4fc9203871417c67eedb522e4f95..6ba129218009b481ed1400275b93c9d4e402beb6 100644 (file)
@@ -1516,15 +1516,14 @@ static void int13_hook_vector ( void ) {
                             "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 );
 }
 
index 9aab03c03207364f8a2d95e530eec95385ba2b7a..89b7975818306b1536e8b3b67bf96afbafcef759 100644 (file)
@@ -77,8 +77,7 @@ static void rtc_hook_isr ( void ) {
                  "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 );
 }
 
 /**
@@ -88,7 +87,7 @@ static void rtc_hook_isr ( void ) {
 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 */
 }
index 414b356d524d95f286b585f0b8899799c7a162d2..dd5f8849c51f67a3b51d64bdce7c85396dc9c378 100644 (file)
@@ -278,7 +278,7 @@ void pxe_activate ( struct net_device *netdev ) {
 
        /* 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;
@@ -311,7 +311,7 @@ int pxe_deactivate ( void ) {
        /* 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 ) );
index d70340c6554796d8e4d926d00f33509e9dbddb31..22848006cf9c7a91c5a16c4dbf57f706245b399e 100644 (file)
@@ -668,8 +668,7 @@ void hook_comboot_interrupts ( ) {
                              "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"
@@ -681,8 +680,7 @@ void hook_comboot_interrupts ( ) {
                              "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"
@@ -694,8 +692,7 @@ void hook_comboot_interrupts ( ) {
                              "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 );
 }
 
 /**
@@ -703,13 +700,13 @@ void hook_comboot_interrupts ( ) {
  */
 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 );
 }