소스 검색

[image] Move the register_and_{select|boot}_image() functions to imgmgmt.c

These functions are used only as the "action" parameters to
imgdownload() or imgfetch(), and so belong in imgmgmt.c rather than
image.c

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 년 전
부모
커밋
d17a84a056
4개의 변경된 파일41개의 추가작업 그리고 41개의 파일을 삭제
  1. 0
    39
      src/core/image.c
  2. 0
    2
      src/include/ipxe/image.h
  3. 2
    0
      src/include/usr/imgmgmt.h
  4. 39
    0
      src/usr/imgmgmt.c

+ 0
- 39
src/core/image.c 파일 보기

@@ -286,42 +286,3 @@ struct image * image_find_selected ( void ) {
286 286
 	}
287 287
 	return NULL;
288 288
 }
289
-
290
-/**
291
- * Register and select an image
292
- *
293
- * @v image		Executable image
294
- * @ret rc		Return status code
295
- */
296
-int register_and_select_image ( struct image *image ) {
297
-	int rc;
298
-
299
-	if ( ( rc = register_image ( image ) ) != 0 )
300
-		return rc;
301
-
302
-	if ( ( rc = image_probe ( image ) ) != 0 )
303
-		return rc;
304
-
305
-	if ( ( rc = image_select ( image ) ) != 0 )
306
-		return rc;
307
-
308
-	return 0;
309
-}
310
-
311
-/**
312
- * Register and boot an image
313
- *
314
- * @v image		Image
315
- * @ret rc		Return status code
316
- */
317
-int register_and_boot_image ( struct image *image ) {
318
-	int rc;
319
-
320
-	if ( ( rc = register_and_select_image ( image ) ) != 0 )
321
-		return rc;
322
-
323
-	if ( ( rc = image_exec ( image ) ) != 0 )
324
-		return rc;
325
-
326
-	return 0;
327
-}

+ 0
- 2
src/include/ipxe/image.h 파일 보기

@@ -143,8 +143,6 @@ extern int image_probe ( struct image *image );
143 143
 extern int image_exec ( struct image *image );
144 144
 extern int image_select ( struct image *image );
145 145
 extern struct image * image_find_selected ( void );
146
-extern int register_and_select_image ( struct image *image );
147
-extern int register_and_boot_image ( struct image *image );
148 146
 
149 147
 /**
150 148
  * Increment reference count on an image

+ 2
- 0
src/include/usr/imgmgmt.h 파일 보기

@@ -11,6 +11,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
11 11
 
12 12
 #include <ipxe/image.h>
13 13
 
14
+extern int register_and_select_image ( struct image *image );
15
+extern int register_and_boot_image ( struct image *image );
14 16
 extern int imgdownload ( struct image *image, struct uri *uri,
15 17
 			 int ( * action ) ( struct image *image ) );
16 18
 extern int imgfetch ( struct image *image, const char *uri_string,

+ 39
- 0
src/usr/imgmgmt.c 파일 보기

@@ -35,6 +35,45 @@ FILE_LICENCE ( GPL2_OR_LATER );
35 35
  *
36 36
  */
37 37
 
38
+/**
39
+ * Register and select an image
40
+ *
41
+ * @v image		Executable image
42
+ * @ret rc		Return status code
43
+ */
44
+int register_and_select_image ( struct image *image ) {
45
+	int rc;
46
+
47
+	if ( ( rc = register_image ( image ) ) != 0 )
48
+		return rc;
49
+
50
+	if ( ( rc = image_probe ( image ) ) != 0 )
51
+		return rc;
52
+
53
+	if ( ( rc = image_select ( image ) ) != 0 )
54
+		return rc;
55
+
56
+	return 0;
57
+}
58
+
59
+/**
60
+ * Register and boot an image
61
+ *
62
+ * @v image		Image
63
+ * @ret rc		Return status code
64
+ */
65
+int register_and_boot_image ( struct image *image ) {
66
+	int rc;
67
+
68
+	if ( ( rc = register_and_select_image ( image ) ) != 0 )
69
+		return rc;
70
+
71
+	if ( ( rc = image_exec ( image ) ) != 0 )
72
+		return rc;
73
+
74
+	return 0;
75
+}
76
+
38 77
 /**
39 78
  * Download an image
40 79
  *

Loading…
취소
저장