Browse Source

Allow external code to update hidden memory regions.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
859da6bd32
2 changed files with 47 additions and 25 deletions
  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 View File

17
 
17
 
18
 #include <realmode.h>
18
 #include <realmode.h>
19
 #include <biosint.h>
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
 /* Linker-defined symbols */
22
 /* Linker-defined symbols */
38
 extern char _text[];
23
 extern char _text[];
45
 extern struct segoff __text16 ( int15_vector );
30
 extern struct segoff __text16 ( int15_vector );
46
 #define int15_vector __use_text16 ( int15_vector )
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
  * List of hidden regions
34
  * List of hidden regions
58
  *
35
  *
61
 struct hidden_region __data16_array ( hidden_regions, [] ) = {
38
 struct hidden_region __data16_array ( hidden_regions, [] ) = {
62
 	[TEXT] = { 0, 0 },
39
 	[TEXT] = { 0, 0 },
63
 	[BASEMEM] = { 0, ( 640 * 1024 ) },
40
 	[BASEMEM] = { 0, ( 640 * 1024 ) },
41
+	[EXTMEM] = { 0, 0 },
64
 	{ 0, 0, } /* Terminator */
42
 	{ 0, 0, } /* Terminator */
65
 };
43
 };
66
-#define hidden_regions __use_data16 ( hidden_regions )
67
 
44
 
68
 /**
45
 /**
69
  * Hide Etherboot
46
  * Hide Etherboot

+ 45
- 0
src/include/gpxe/hidemem.h View File

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…
Cancel
Save