|
@@ -22,17 +22,6 @@
|
22
|
22
|
#define fbms ( * ( ( uint16_t * ) phys_to_virt ( 0x413 ) ) )
|
23
|
23
|
#define FBMS_MAX ( 640 )
|
24
|
24
|
|
25
|
|
-/* Structure that we use to represent a free block of base memory
|
26
|
|
- */
|
27
|
|
-#define FREE_BLOCK_MAGIC ( ('!'<<0) + ('F'<<8) + ('R'<<16) + ('E'<<24) )
|
28
|
|
-union free_base_memory_block {
|
29
|
|
- struct {
|
30
|
|
- uint32_t magic;
|
31
|
|
- uint16_t size_kb;
|
32
|
|
- };
|
33
|
|
- char bytes[1024];
|
34
|
|
-};
|
35
|
|
-
|
36
|
25
|
/* Local prototypes */
|
37
|
26
|
static void free_unused_base_memory ( void );
|
38
|
27
|
|
|
@@ -188,12 +177,10 @@ static void free_unused_base_memory ( void ) {
|
188
|
177
|
free_block->size_kb, ( fbms << 6 ),
|
189
|
178
|
( fbms + free_block->size_kb ) << 6 );
|
190
|
179
|
|
191
|
|
- /* Zero out freed block. We do this in case
|
192
|
|
- * the block contained any structures that
|
193
|
|
- * might be located by scanning through
|
194
|
|
- * memory.
|
|
180
|
+ /* Do not zero out the freed block, because it might
|
|
181
|
+ * be the one containing librm, in which case we're
|
|
182
|
+ * going to have severe problems the next time we use
|
|
183
|
+ * DBG() or, failing that, call get_memsizes().
|
195
|
184
|
*/
|
196
|
|
- memset ( free_block, 0, free_block->size_kb << 10 );
|
197
|
|
-
|
198
|
185
|
}
|
199
|
186
|
}
|