Browse Source

[bios] Use intptr_t when casting .text16 function pointers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
15fadab533

+ 2
- 4
src/arch/i386/drivers/net/undinet.c View File

143
 	assert ( undiisr_irq == 0 );
143
 	assert ( undiisr_irq == 0 );
144
 
144
 
145
 	undiisr_irq = irq;
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
 			      &undiisr_next_handler );
147
 			      &undiisr_next_handler );
149
 }
148
 }
150
 
149
 
157
 
156
 
158
 	assert ( irq <= IRQ_MAX );
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
 				&undiisr_next_handler );
160
 				&undiisr_next_handler );
163
 	undiisr_irq = 0;
161
 	undiisr_irq = 0;
164
 }
162
 }

+ 2
- 2
src/arch/i386/firmware/pcbios/bios_console.c View File

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

+ 2
- 2
src/arch/i386/firmware/pcbios/fakee820.c View File

88
 			      "ljmp *%%cs:real_int15_vector\n\t" )
88
 			      "ljmp *%%cs:real_int15_vector\n\t" )
89
 		: : "i" ( sizeof ( e820map ) ) );
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
 			      &real_int15_vector );
92
 			      &real_int15_vector );
93
 }
93
 }
94
 
94
 
95
 void unfake_e820 ( void ) {
95
 void unfake_e820 ( void ) {
96
-	unhook_bios_interrupt ( 0x15, ( unsigned int ) int15_fakee820,
96
+	unhook_bios_interrupt ( 0x15, ( intptr_t ) int15_fakee820,
97
 				&real_int15_vector );
97
 				&real_int15_vector );
98
 }
98
 }

+ 2
- 3
src/arch/i386/firmware/pcbios/hidemem.c View File

179
 	}
179
 	}
180
 
180
 
181
 	/* Hook INT 15 */
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
 	/* Dump memory map after mangling */
184
 	/* Dump memory map after mangling */
186
 	DBG ( "Hidden iPXE from system memory map\n" );
185
 	DBG ( "Hidden iPXE from system memory map\n" );
210
 	}
209
 	}
211
 
210
 
212
 	/* Try to unhook INT 15 */
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
 					    &int15_vector ) ) != 0 ) {
213
 					    &int15_vector ) ) != 0 ) {
215
 		DBG ( "Cannot unhook INT15: %s\n", strerror ( rc ) );
214
 		DBG ( "Cannot unhook INT15: %s\n", strerror ( rc ) );
216
 		/* Leave it hooked; there's nothing else we can do,
215
 		/* Leave it hooked; there's nothing else we can do,

+ 4
- 4
src/arch/i386/image/bootsector.c View File

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

+ 2
- 3
src/arch/i386/interface/pcbios/int13.c View File

1516
 			     "iret\n\t" )
1516
 			     "iret\n\t" )
1517
 	       : : "i" ( int13 ) );
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
  * Unhook INT 13 handler
1523
  * Unhook INT 13 handler
1525
  */
1524
  */
1526
 static void int13_unhook_vector ( void ) {
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
 				&int13_vector );
1527
 				&int13_vector );
1529
 }
1528
 }
1530
 
1529
 

+ 2
- 3
src/arch/i386/interface/pcbios/rtc_entropy.c View File

77
 		  "i" ( CMOS_ADDRESS ), "i" ( CMOS_DATA ),
77
 		  "i" ( CMOS_ADDRESS ), "i" ( CMOS_DATA ),
78
 		  "i" ( RTC_STATUS_C ) );
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
 static void rtc_unhook_isr ( void ) {
87
 static void rtc_unhook_isr ( void ) {
89
 	int rc;
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
 				     &rtc_old_handler );
91
 				     &rtc_old_handler );
93
 	assert ( rc == 0 ); /* Should always be able to unhook */
92
 	assert ( rc == 0 ); /* Should always be able to unhook */
94
 }
93
 }

+ 2
- 2
src/arch/i386/interface/pxe/pxe_call.c View File

278
 
278
 
279
 	/* Ensure INT 1A is hooked */
279
 	/* Ensure INT 1A is hooked */
280
 	if ( ! int_1a_hooked ) {
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
 				      &pxe_int_1a_vector );
282
 				      &pxe_int_1a_vector );
283
 		devices_get();
283
 		devices_get();
284
 		int_1a_hooked = 1;
284
 		int_1a_hooked = 1;
311
 	/* Ensure INT 1A is unhooked, if possible */
311
 	/* Ensure INT 1A is unhooked, if possible */
312
 	if ( int_1a_hooked ) {
312
 	if ( int_1a_hooked ) {
313
 		if ( ( rc = unhook_bios_interrupt ( 0x1a,
313
 		if ( ( rc = unhook_bios_interrupt ( 0x1a,
314
-						    (unsigned int) pxe_int_1a,
314
+						    ( intptr_t ) pxe_int_1a,
315
 						    &pxe_int_1a_vector ))!= 0){
315
 						    &pxe_int_1a_vector ))!= 0){
316
 			DBGC ( &pxe_netdev, "PXE could not unhook INT 1A: %s\n",
316
 			DBGC ( &pxe_netdev, "PXE could not unhook INT 1A: %s\n",
317
 			       strerror ( rc ) );
317
 			       strerror ( rc ) );

+ 6
- 9
src/arch/i386/interface/syslinux/comboot_call.c View File

668
 		              "iret\n\t" )
668
 		              "iret\n\t" )
669
 		          : : "i" ( int20 ) );
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
 	__asm__ __volatile__ (
673
 	__asm__ __volatile__ (
675
 		TEXT16_CODE ( "\nint21_wrapper:\n\t"
674
 		TEXT16_CODE ( "\nint21_wrapper:\n\t"
681
 		              "iret\n\t" )
680
 		              "iret\n\t" )
682
 		          : : "i" ( int21 ) );
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
 	__asm__  __volatile__ (
685
 	__asm__  __volatile__ (
688
 		TEXT16_CODE ( "\nint22_wrapper:\n\t"
686
 		TEXT16_CODE ( "\nint22_wrapper:\n\t"
694
 		              "iret\n\t" )
692
 		              "iret\n\t" )
695
 		          : : "i" ( int22) );
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
  */
700
  */
704
 void unhook_comboot_interrupts ( ) {
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
 				&int20_vector );
704
 				&int20_vector );
708
 
705
 
709
-	unhook_bios_interrupt ( 0x21, ( unsigned int ) int21_wrapper,
706
+	unhook_bios_interrupt ( 0x21, ( intptr_t ) int21_wrapper,
710
 				&int21_vector );
707
 				&int21_vector );
711
 
708
 
712
-	unhook_bios_interrupt ( 0x22, ( unsigned int ) int22_wrapper,
709
+	unhook_bios_interrupt ( 0x22, ( intptr_t ) int22_wrapper,
713
 				&int22_vector );
710
 				&int22_vector );
714
 }
711
 }
715
 
712
 

Loading…
Cancel
Save