Browse Source

[pxe] Make pxe_init_structures() an initialisation function

pxe_init_structures() fills in the fields of the !PXE and PXENV+
structures that aren't known until gPXE starts up.  Once gPXE is
started, these values will never change.

Make pxe_init_structures() an initialisation function so that PXE
users don't have to worry about calling it.
tags/v0.9.8
Michael Brown 15 years ago
parent
commit
c2965b0fe7

+ 0
- 1
src/arch/i386/image/pxe_image.c View File

47
 	int rc;
47
 	int rc;
48
 
48
 
49
 	/* Ensure that PXE stack is ready to use */
49
 	/* Ensure that PXE stack is ready to use */
50
-	pxe_init_structures();
51
 	pxe_hook_int1a();
50
 	pxe_hook_int1a();
52
 
51
 
53
 	/* Arbitrarily pick the most recently opened network device */
52
 	/* Arbitrarily pick the most recently opened network device */

+ 0
- 1
src/arch/i386/include/pxe_call.h View File

30
 
30
 
31
 extern void pxe_hook_int1a ( void );
31
 extern void pxe_hook_int1a ( void );
32
 extern int pxe_unhook_int1a ( void );
32
 extern int pxe_unhook_int1a ( void );
33
-extern void pxe_init_structures ( void );
34
 extern int pxe_start_nbp ( void );
33
 extern int pxe_start_nbp ( void );
35
 extern __asmcall void pxe_api_call ( struct i386_all_regs *ix86 );
34
 extern __asmcall void pxe_api_call ( struct i386_all_regs *ix86 );
36
 
35
 

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

19
 FILE_LICENCE ( GPL2_OR_LATER );
19
 FILE_LICENCE ( GPL2_OR_LATER );
20
 
20
 
21
 #include <gpxe/uaccess.h>
21
 #include <gpxe/uaccess.h>
22
+#include <gpxe/init.h>
22
 #include <registers.h>
23
 #include <registers.h>
23
 #include <biosint.h>
24
 #include <biosint.h>
24
 #include <pxe.h>
25
 #include <pxe.h>
403
  * Initialise !PXE and PXENV+ structures
404
  * Initialise !PXE and PXENV+ structures
404
  *
405
  *
405
  */
406
  */
406
-void pxe_init_structures ( void ) {
407
+static void pxe_init_structures ( void ) {
407
 	uint32_t rm_cs_phys = ( rm_cs << 4 );
408
 	uint32_t rm_cs_phys = ( rm_cs << 4 );
408
 	uint32_t rm_ds_phys = ( rm_ds << 4 );
409
 	uint32_t rm_ds_phys = ( rm_ds << 4 );
409
 
410
 
429
 	pxenv.Checksum -= pxe_checksum ( &pxenv, sizeof ( pxenv ) );
430
 	pxenv.Checksum -= pxe_checksum ( &pxenv, sizeof ( pxenv ) );
430
 }
431
 }
431
 
432
 
433
+/** PXE structure initialiser */
434
+struct init_fn pxe_init_fn __init_fn ( INIT_NORMAL ) = {
435
+	.initialise = pxe_init_structures,
436
+};
437
+
432
 /**
438
 /**
433
  * Start PXE NBP at 0000:7c00
439
  * Start PXE NBP at 0000:7c00
434
  *
440
  *

+ 0
- 3
src/arch/i386/interface/pxe/pxe_loader.c View File

39
 	DBG ( "[PXENV_UNDI_LOADER to CS %04x DS %04x]",
39
 	DBG ( "[PXENV_UNDI_LOADER to CS %04x DS %04x]",
40
 	      undi_loader->UNDI_CS, undi_loader->UNDI_DS );
40
 	      undi_loader->UNDI_CS, undi_loader->UNDI_DS );
41
 
41
 
42
-	/* Set up PXE data structures */
43
-	pxe_init_structures();
44
-
45
 	/* Fill in UNDI loader structure */
42
 	/* Fill in UNDI loader structure */
46
 	undi_loader->PXEptr.segment = rm_cs;
43
 	undi_loader->PXEptr.segment = rm_cs;
47
 	undi_loader->PXEptr.offset = __from_text16 ( &ppxe );
44
 	undi_loader->PXEptr.offset = __from_text16 ( &ppxe );

Loading…
Cancel
Save