ソースを参照

[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年前
コミット
c2965b0fe7

+ 0
- 1
src/arch/i386/image/pxe_image.c ファイルの表示

@@ -47,7 +47,6 @@ static int pxe_exec ( struct image *image ) {
47 47
 	int rc;
48 48
 
49 49
 	/* Ensure that PXE stack is ready to use */
50
-	pxe_init_structures();
51 50
 	pxe_hook_int1a();
52 51
 
53 52
 	/* Arbitrarily pick the most recently opened network device */

+ 0
- 1
src/arch/i386/include/pxe_call.h ファイルの表示

@@ -30,7 +30,6 @@ extern struct s_PXENV __text16 ( pxenv );
30 30
 
31 31
 extern void pxe_hook_int1a ( void );
32 32
 extern int pxe_unhook_int1a ( void );
33
-extern void pxe_init_structures ( void );
34 33
 extern int pxe_start_nbp ( void );
35 34
 extern __asmcall void pxe_api_call ( struct i386_all_regs *ix86 );
36 35
 

+ 7
- 1
src/arch/i386/interface/pxe/pxe_call.c ファイルの表示

@@ -19,6 +19,7 @@
19 19
 FILE_LICENCE ( GPL2_OR_LATER );
20 20
 
21 21
 #include <gpxe/uaccess.h>
22
+#include <gpxe/init.h>
22 23
 #include <registers.h>
23 24
 #include <biosint.h>
24 25
 #include <pxe.h>
@@ -403,7 +404,7 @@ static uint8_t pxe_checksum ( void *data, size_t size ) {
403 404
  * Initialise !PXE and PXENV+ structures
404 405
  *
405 406
  */
406
-void pxe_init_structures ( void ) {
407
+static void pxe_init_structures ( void ) {
407 408
 	uint32_t rm_cs_phys = ( rm_cs << 4 );
408 409
 	uint32_t rm_ds_phys = ( rm_ds << 4 );
409 410
 
@@ -429,6 +430,11 @@ void pxe_init_structures ( void ) {
429 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 439
  * Start PXE NBP at 0000:7c00
434 440
  *

+ 0
- 3
src/arch/i386/interface/pxe/pxe_loader.c ファイルの表示

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

読み込み中…
キャンセル
保存