Преглед на файлове

Allow external code to update hidden memory regions.

tags/v0.9.3
Michael Brown преди 18 години
родител
ревизия
859da6bd32
променени са 2 файла, в които са добавени 47 реда и са изтрити 25 реда
  1. 2
    25
      src/arch/i386/firmware/pcbios/hidemem.c
  2. 45
    0
      src/include/gpxe/hidemem.h

+ 2
- 25
src/arch/i386/firmware/pcbios/hidemem.c Целия файл

@@ -17,22 +17,7 @@
17 17
 
18 18
 #include <realmode.h>
19 19
 #include <biosint.h>
20
-
21
-/**
22
- * A hidden region of Etherboot
23
- *
24
- * This represents a region that will be edited out of the system's
25
- * memory map.
26
- *
27
- * This structure is accessed by assembly code, so must not be
28
- * changed.
29
- */
30
-struct hidden_region {
31
-	/* Physical start address */
32
-	uint32_t start;
33
-	/* Physical end address */
34
-	uint32_t end;
35
-};
20
+#include <gpxe/hidemem.h>
36 21
 
37 22
 /* Linker-defined symbols */
38 23
 extern char _text[];
@@ -45,14 +30,6 @@ extern void int15();
45 30
 extern struct segoff __text16 ( int15_vector );
46 31
 #define int15_vector __use_text16 ( int15_vector )
47 32
 
48
-/**
49
- * Unique IDs for hidden regions
50
- */
51
-enum {
52
-	TEXT = 0,
53
-	BASEMEM,
54
-};
55
-
56 33
 /**
57 34
  * List of hidden regions
58 35
  *
@@ -61,9 +38,9 @@ enum {
61 38
 struct hidden_region __data16_array ( hidden_regions, [] ) = {
62 39
 	[TEXT] = { 0, 0 },
63 40
 	[BASEMEM] = { 0, ( 640 * 1024 ) },
41
+	[EXTMEM] = { 0, 0 },
64 42
 	{ 0, 0, } /* Terminator */
65 43
 };
66
-#define hidden_regions __use_data16 ( hidden_regions )
67 44
 
68 45
 /**
69 46
  * Hide Etherboot

+ 45
- 0
src/include/gpxe/hidemem.h Целия файл

@@ -0,0 +1,45 @@
1
+#ifndef _GPXE_HIDEMEM_H
2
+#define _GPXE_HIDEMEM_H
3
+
4
+/**
5
+ * @file
6
+ *
7
+ * Hidden memory regions
8
+ *
9
+ */
10
+
11
+/**
12
+ * A hidden region of Etherboot
13
+ *
14
+ * This represents a region that will be edited out of the system's
15
+ * memory map.
16
+ *
17
+ * This structure is accessed by assembly code, so must not be
18
+ * changed.
19
+ */
20
+struct hidden_region {
21
+	/* Physical start address */
22
+	physaddr_t start;
23
+	/* Physical end address */
24
+	physaddr_t end;
25
+};
26
+
27
+/**
28
+ * Unique IDs for hidden regions
29
+ */
30
+enum {
31
+	TEXT = 0,
32
+	BASEMEM,
33
+	EXTMEM,
34
+};
35
+
36
+extern struct hidden_region __data16_array ( hidden_regions, [] );
37
+#define hidden_regions __use_data16 ( hidden_regions )
38
+
39
+static inline void hide_region ( unsigned int region,
40
+				 physaddr_t start, physaddr_t end ) {
41
+	hidden_regions[region].start = start;
42
+	hidden_regions[region].end = end;
43
+}
44
+
45
+#endif /* _GPXE_HIDEMEM_H */

Loading…
Отказ
Запис