ソースを参照

Move include/image.h to include/gpxe/image.h

tags/v0.9.3
Michael Brown 18年前
コミット
4fc9333159
6個のファイルの変更65行の追加35行の削除
  1. 3
    4
      src/arch/i386/image/nbi.c
  2. 0
    1
      src/core/config.c
  3. 2
    3
      src/core/image.c
  4. 0
    1
      src/core/main.c
  5. 60
    0
      src/include/gpxe/image.h
  6. 0
    26
      src/include/image.h

+ 3
- 4
src/arch/i386/image/nbi.c ファイルの表示

@@ -1,13 +1,12 @@
1
-#include "image.h"
1
+#warning "This file is obsolete"
2
+#if 0
3
+
2 4
 #include "memsizes.h"
3 5
 #include "realmode.h"
4 6
 #include "gateA20.h"
5 7
 #include "etherboot.h"
6 8
 #include "errno.h"
7 9
 
8
-#warning "This file is obsolete"
9
-#if 0
10
-
11 10
 /** @file
12 11
  *
13 12
  * NBI image format.

+ 0
- 1
src/core/config.c ファイルの表示

@@ -8,7 +8,6 @@
8 8
 #include "etherboot.h"
9 9
 #include "dev.h"
10 10
 #include "console.h"
11
-#include "image.h"
12 11
 
13 12
 #include "config/general.h"
14 13
 

+ 2
- 3
src/core/image.c ファイルの表示

@@ -1,8 +1,9 @@
1 1
 #include "dev.h"
2 2
 #include <gpxe/buffer.h>
3
-#include "image.h"
4 3
 #include <console.h>
5 4
 
5
+#if 0
6
+
6 7
 static struct image images[0] __image_start;
7 8
 static struct image images_end[0] __image_end;
8 9
 
@@ -18,8 +19,6 @@ void print_images ( void ) {
18 19
 	}
19 20
 }
20 21
 
21
-#if 0
22
-
23 22
 /*
24 23
  * Identify the image format
25 24
  *

+ 0
- 1
src/core/main.c ファイルの表示

@@ -25,7 +25,6 @@ Literature dealing with the network protocols:
25 25
 #include "cmdline.h"
26 26
 #include "console.h"
27 27
 #include <gpxe/init.h>
28
-#include "image.h"
29 28
 #include <stdarg.h>
30 29
 
31 30
 #include <gpxe/device.h>

+ 60
- 0
src/include/gpxe/image.h ファイルの表示

@@ -0,0 +1,60 @@
1
+#ifndef _GPXE_IMAGE_H
2
+#define _GPXE_IMAGE_H
3
+
4
+/**
5
+ * @file
6
+ *
7
+ * Executable/loadable image formats
8
+ *
9
+ */
10
+
11
+#include <gpxe/tables.h>
12
+
13
+/** An executable or loadable image */
14
+struct image {
15
+	/** Raw file image */
16
+	userptr_t image;
17
+	/** Length of raw file image */
18
+	size_t len;
19
+
20
+	/** Execute method
21
+	 *
22
+	 * Filled in by the image loader.  If NULL, then the image
23
+	 * cannot be executed.
24
+	 */
25
+	int ( * execute ) ( struct image *image );
26
+	/** Entry point */
27
+	physaddr_t entry;
28
+};
29
+
30
+/** An executable or loadable image type */
31
+struct image_type {
32
+	/** Name of this image type */
33
+	char *name;
34
+	/** Load image into memory
35
+	 *
36
+	 * @v image		Executable/loadable image
37
+	 * @ret rc		Return status code
38
+	 *
39
+	 * Load the image into memory.  The file image may be
40
+	 * discarded after this call; the method must preserve any
41
+	 * information it may require later (e.g. the execution
42
+	 * address) within the @c image structure.
43
+	 */
44
+	int ( * load ) ( struct image *image );
45
+};
46
+
47
+/** An executable or loadable image type */
48
+#define __image_type __table ( struct image_type, image_types, 01 )
49
+
50
+/**
51
+ * An unverifiable executable or loadable image type
52
+ *
53
+ * This should be used to mark image types for which there are no
54
+ * signature or other checks that can be used to verify the validity
55
+ * of the image (such as PXE images).  These will then be tried last
56
+ * in the list of image types.
57
+ */
58
+#define __default_image_type __table ( struct image_type, image_types, 02 )
59
+
60
+#endif /* _GPXE_IMAGE_H */

+ 0
- 26
src/include/image.h ファイルの表示

@@ -1,26 +0,0 @@
1
-#ifndef IMAGE_H
2
-#define IMAGE_H
3
-
4
-#include "stdint.h"
5
-#include "io.h"
6
-#include <gpxe/tables.h>
7
-#include "dev.h"
8
-
9
-struct image {
10
-	char *name;
11
-	int ( * probe ) ( physaddr_t data, off_t len, void **context );
12
-	int ( * load ) ( physaddr_t data, off_t len, void *context );
13
-	int ( * boot ) ( void *context );
14
-};
15
-
16
-#define __image_start		__table_start ( struct image, image )
17
-#define __image			__table ( struct image, image, 01 )
18
-#define __default_image		__table ( struct image, image, 02 )
19
-#define __image_end		__table_end ( struct image, image )
20
-
21
-/* Functions in image.c */
22
-
23
-extern void print_images ( void );
24
-extern int autoload ( struct dev *dev, struct image **image, void **context );
25
-
26
-#endif /* IMAGE_H */

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