Quellcode durchsuchen

Allow ourselves to be freed by basemem.c without being damaged.

tags/v0.9.3
Michael Brown vor 19 Jahren
Ursprung
Commit
1f6dfd7047
1 geänderte Dateien mit 16 neuen und 0 gelöschten Zeilen
  1. 16
    0
      src/arch/i386/transitions/librm.S

+ 16
- 0
src/arch/i386/transitions/librm.S Datei anzeigen

8
 /* Drag in local definitions */
8
 /* Drag in local definitions */
9
 #include "librm.h"
9
 #include "librm.h"
10
 
10
 
11
+/* Drag in FREE_BASEMEM_HEADER_SIZE */
12
+#include "basemem.h"
13
+
11
 /****************************************************************************
14
 /****************************************************************************
12
  * This file defines librm: a block of code that is designed to reside
15
  * This file defines librm: a block of code that is designed to reside
13
  * permanently in base memory and provide the interface between
16
  * permanently in base memory and provide the interface between
129
 	.equ _ ## sym, OFFSET(sym) ; \
132
 	.equ _ ## sym, OFFSET(sym) ; \
130
 	sym
133
 	sym
131
 
134
 
135
+/****************************************************************************
136
+ * Note that the first sizeof(struct free_base_memory_header) bytes of
137
+ * librm will get vapourised by free_base_memory().  Since we need
138
+ * librm to continue working even when this happens, we put some
139
+ * padding here.
140
+ *
141
+ * We must also ensure that the total size of librm is <1kB, otherwise
142
+ * free_base_memory() will stomp somewhere in the middle of us as
143
+ * well...
144
+ ****************************************************************************
145
+ */
146
+	.fill FREE_BASEMEM_HEADER_SIZE, 1, 0
147
+	
132
 /****************************************************************************
148
 /****************************************************************************
133
  * GDT for initial transition to protected mode
149
  * GDT for initial transition to protected mode
134
  *
150
  *

Laden…
Abbrechen
Speichern