Преглед на файлове

[bios] Use intptr_t when casting .text16 function pointers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown преди 8 години
родител
ревизия
15fadab533

+ 2
- 4
src/arch/i386/drivers/net/undinet.c Целия файл

@@ -143,8 +143,7 @@ static void undinet_hook_isr ( unsigned int irq ) {
143 143
 	assert ( undiisr_irq == 0 );
144 144
 
145 145
 	undiisr_irq = irq;
146
-	hook_bios_interrupt ( IRQ_INT ( irq ),
147
-			      ( ( unsigned int ) undiisr ),
146
+	hook_bios_interrupt ( IRQ_INT ( irq ), ( ( intptr_t ) undiisr ),
148 147
 			      &undiisr_next_handler );
149 148
 }
150 149
 
@@ -157,8 +156,7 @@ static void undinet_unhook_isr ( unsigned int irq ) {
157 156
 
158 157
 	assert ( irq <= IRQ_MAX );
159 158
 
160
-	unhook_bios_interrupt ( IRQ_INT ( irq ),
161
-				( ( unsigned int ) undiisr ),
159
+	unhook_bios_interrupt ( IRQ_INT ( irq ), ( ( intptr_t ) undiisr ),
162 160
 				&undiisr_next_handler );
163 161
 	undiisr_irq = 0;
164 162
 }

+ 2
- 2
src/arch/i386/firmware/pcbios/bios_console.c Целия файл

@@ -543,7 +543,7 @@ static void bios_inject_startup ( void ) {
543 543
 		: : "i" ( bios_inject ) );
544 544
 
545 545
 	/* Hook INT 16 */
546
-	hook_bios_interrupt ( 0x16, ( ( unsigned int ) int16_wrapper ),
546
+	hook_bios_interrupt ( 0x16, ( ( intptr_t ) int16_wrapper ),
547 547
 			      &int16_vector );
548 548
 }
549 549
 
@@ -555,7 +555,7 @@ static void bios_inject_startup ( void ) {
555 555
 static void bios_inject_shutdown ( int booting __unused ) {
556 556
 
557 557
 	/* Unhook INT 16 */
558
-	unhook_bios_interrupt ( 0x16, ( ( unsigned int ) int16_wrapper ),
558
+	unhook_bios_interrupt ( 0x16, ( ( intptr_t ) int16_wrapper ),
559 559
 				&int16_vector );
560 560
 }
561 561
 

+ 2
- 2
src/arch/i386/firmware/pcbios/fakee820.c Целия файл

@@ -88,11 +88,11 @@ void fake_e820 ( void ) {
88 88
 			      "ljmp *%%cs:real_int15_vector\n\t" )
89 89
 		: : "i" ( sizeof ( e820map ) ) );
90 90
 
91
-	hook_bios_interrupt ( 0x15, ( unsigned int ) int15_fakee820,
91
+	hook_bios_interrupt ( 0x15, ( intptr_t ) int15_fakee820,
92 92
 			      &real_int15_vector );
93 93
 }
94 94
 
95 95
 void unfake_e820 ( void ) {
96
-	unhook_bios_interrupt ( 0x15, ( unsigned int ) int15_fakee820,
96
+	unhook_bios_interrupt ( 0x15, ( intptr_t ) int15_fakee820,
97 97
 				&real_int15_vector );
98 98
 }

+ 2
- 3
src/arch/i386/firmware/pcbios/hidemem.c Целия файл

@@ -179,8 +179,7 @@ static void hide_etherboot ( void ) {
179 179
 	}
180 180
 
181 181
 	/* Hook INT 15 */
182
-	hook_bios_interrupt ( 0x15, ( unsigned int ) int15,
183
-			      &int15_vector );
182
+	hook_bios_interrupt ( 0x15, ( intptr_t ) int15, &int15_vector );
184 183
 
185 184
 	/* Dump memory map after mangling */
186 185
 	DBG ( "Hidden iPXE from system memory map\n" );
@@ -210,7 +209,7 @@ static void unhide_etherboot ( int flags __unused ) {
210 209
 	}
211 210
 
212 211
 	/* Try to unhook INT 15 */
213
-	if ( ( rc = unhook_bios_interrupt ( 0x15, ( unsigned int ) int15,
212
+	if ( ( rc = unhook_bios_interrupt ( 0x15, ( intptr_t ) int15,
214 213
 					    &int15_vector ) ) != 0 ) {
215 214
 		DBG ( "Cannot unhook INT15: %s\n", strerror ( rc ) );
216 215
 		/* Leave it hooked; there's nothing else we can do,

+ 4
- 4
src/arch/i386/image/bootsector.c Целия файл

@@ -71,9 +71,9 @@ int call_bootsector ( unsigned int segment, unsigned int offset,
71 71
 	DBG ( "Booting from boot sector at %04x:%04x\n", segment, offset );
72 72
 
73 73
 	/* Hook INTs 18 and 19 to capture failure paths */
74
-	hook_bios_interrupt ( 0x18, ( unsigned int ) bootsector_exec_fail,
74
+	hook_bios_interrupt ( 0x18, ( intptr_t ) bootsector_exec_fail,
75 75
 			      &int18_vector );
76
-	hook_bios_interrupt ( 0x19, ( unsigned int ) bootsector_exec_fail,
76
+	hook_bios_interrupt ( 0x19, ( intptr_t ) bootsector_exec_fail,
77 77
 			      &int19_vector );
78 78
 
79 79
 	/* Boot the loaded sector
@@ -132,9 +132,9 @@ int call_bootsector ( unsigned int segment, unsigned int offset,
132 132
 	DBG ( "Booted disk returned via INT 18 or 19\n" );
133 133
 
134 134
 	/* Unhook INTs 18 and 19 */
135
-	unhook_bios_interrupt ( 0x18, ( unsigned int ) bootsector_exec_fail,
135
+	unhook_bios_interrupt ( 0x18, ( intptr_t ) bootsector_exec_fail,
136 136
 				&int18_vector );
137
-	unhook_bios_interrupt ( 0x19, ( unsigned int ) bootsector_exec_fail,
137
+	unhook_bios_interrupt ( 0x19, ( intptr_t ) bootsector_exec_fail,
138 138
 				&int19_vector );
139 139
 	
140 140
 	return -ECANCELED;

+ 2
- 3
src/arch/i386/interface/pcbios/int13.c Целия файл

@@ -1516,15 +1516,14 @@ static void int13_hook_vector ( void ) {
1516 1516
 			     "iret\n\t" )
1517 1517
 	       : : "i" ( int13 ) );
1518 1518
 
1519
-	hook_bios_interrupt ( 0x13, ( unsigned int ) int13_wrapper,
1520
-			      &int13_vector );
1519
+	hook_bios_interrupt ( 0x13, ( intptr_t ) int13_wrapper, &int13_vector );
1521 1520
 }
1522 1521
 
1523 1522
 /**
1524 1523
  * Unhook INT 13 handler
1525 1524
  */
1526 1525
 static void int13_unhook_vector ( void ) {
1527
-	unhook_bios_interrupt ( 0x13, ( unsigned int ) int13_wrapper,
1526
+	unhook_bios_interrupt ( 0x13, ( intptr_t ) int13_wrapper,
1528 1527
 				&int13_vector );
1529 1528
 }
1530 1529
 

+ 2
- 3
src/arch/i386/interface/pcbios/rtc_entropy.c Целия файл

@@ -77,8 +77,7 @@ static void rtc_hook_isr ( void ) {
77 77
 		  "i" ( CMOS_ADDRESS ), "i" ( CMOS_DATA ),
78 78
 		  "i" ( RTC_STATUS_C ) );
79 79
 
80
-	hook_bios_interrupt ( RTC_INT, ( unsigned int ) rtc_isr,
81
-			      &rtc_old_handler );
80
+	hook_bios_interrupt ( RTC_INT, ( intptr_t ) rtc_isr, &rtc_old_handler );
82 81
 }
83 82
 
84 83
 /**
@@ -88,7 +87,7 @@ static void rtc_hook_isr ( void ) {
88 87
 static void rtc_unhook_isr ( void ) {
89 88
 	int rc;
90 89
 
91
-	rc = unhook_bios_interrupt ( RTC_INT, ( unsigned int ) rtc_isr,
90
+	rc = unhook_bios_interrupt ( RTC_INT, ( intptr_t ) rtc_isr,
92 91
 				     &rtc_old_handler );
93 92
 	assert ( rc == 0 ); /* Should always be able to unhook */
94 93
 }

+ 2
- 2
src/arch/i386/interface/pxe/pxe_call.c Целия файл

@@ -278,7 +278,7 @@ void pxe_activate ( struct net_device *netdev ) {
278 278
 
279 279
 	/* Ensure INT 1A is hooked */
280 280
 	if ( ! int_1a_hooked ) {
281
-		hook_bios_interrupt ( 0x1a, ( unsigned int ) pxe_int_1a,
281
+		hook_bios_interrupt ( 0x1a, ( intptr_t ) pxe_int_1a,
282 282
 				      &pxe_int_1a_vector );
283 283
 		devices_get();
284 284
 		int_1a_hooked = 1;
@@ -311,7 +311,7 @@ int pxe_deactivate ( void ) {
311 311
 	/* Ensure INT 1A is unhooked, if possible */
312 312
 	if ( int_1a_hooked ) {
313 313
 		if ( ( rc = unhook_bios_interrupt ( 0x1a,
314
-						    (unsigned int) pxe_int_1a,
314
+						    ( intptr_t ) pxe_int_1a,
315 315
 						    &pxe_int_1a_vector ))!= 0){
316 316
 			DBGC ( &pxe_netdev, "PXE could not unhook INT 1A: %s\n",
317 317
 			       strerror ( rc ) );

+ 6
- 9
src/arch/i386/interface/syslinux/comboot_call.c Целия файл

@@ -668,8 +668,7 @@ void hook_comboot_interrupts ( ) {
668 668
 		              "iret\n\t" )
669 669
 		          : : "i" ( int20 ) );
670 670
 
671
-	hook_bios_interrupt ( 0x20, ( unsigned int ) int20_wrapper,
672
-		                      &int20_vector );
671
+	hook_bios_interrupt ( 0x20, ( intptr_t ) int20_wrapper, &int20_vector );
673 672
 
674 673
 	__asm__ __volatile__ (
675 674
 		TEXT16_CODE ( "\nint21_wrapper:\n\t"
@@ -681,8 +680,7 @@ void hook_comboot_interrupts ( ) {
681 680
 		              "iret\n\t" )
682 681
 		          : : "i" ( int21 ) );
683 682
 
684
-	hook_bios_interrupt ( 0x21, ( unsigned int ) int21_wrapper,
685
-	                      &int21_vector );
683
+	hook_bios_interrupt ( 0x21, ( intptr_t ) int21_wrapper, &int21_vector );
686 684
 
687 685
 	__asm__  __volatile__ (
688 686
 		TEXT16_CODE ( "\nint22_wrapper:\n\t"
@@ -694,8 +692,7 @@ void hook_comboot_interrupts ( ) {
694 692
 		              "iret\n\t" )
695 693
 		          : : "i" ( int22) );
696 694
 
697
-	hook_bios_interrupt ( 0x22, ( unsigned int ) int22_wrapper,
698
-	                      &int22_vector );
695
+	hook_bios_interrupt ( 0x22, ( intptr_t ) int22_wrapper, &int22_vector );
699 696
 }
700 697
 
701 698
 /**
@@ -703,13 +700,13 @@ void hook_comboot_interrupts ( ) {
703 700
  */
704 701
 void unhook_comboot_interrupts ( ) {
705 702
 
706
-	unhook_bios_interrupt ( 0x20, ( unsigned int ) int20_wrapper,
703
+	unhook_bios_interrupt ( 0x20, ( intptr_t ) int20_wrapper,
707 704
 				&int20_vector );
708 705
 
709
-	unhook_bios_interrupt ( 0x21, ( unsigned int ) int21_wrapper,
706
+	unhook_bios_interrupt ( 0x21, ( intptr_t ) int21_wrapper,
710 707
 				&int21_vector );
711 708
 
712
-	unhook_bios_interrupt ( 0x22, ( unsigned int ) int22_wrapper,
709
+	unhook_bios_interrupt ( 0x22, ( intptr_t ) int22_wrapper,
713 710
 				&int22_vector );
714 711
 }
715 712
 

Loading…
Отказ
Запис