summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2005-04-09 18:14:37 +0200
committerMichael Brown2005-04-09 18:14:37 +0200
commite29e6456b0b9fae42f05a0be6c86eb630939c9b7 (patch)
tree2326951d3b157c1f8bb805b6341642e7c080fdd0
parentAllow ourselves to be freed by basemem.c without being damaged. (diff)
downloadipxe-e29e6456b0b9fae42f05a0be6c86eb630939c9b7.tar.gz
ipxe-e29e6456b0b9fae42f05a0be6c86eb630939c9b7.tar.xz
ipxe-e29e6456b0b9fae42f05a0be6c86eb630939c9b7.zip
Don't zero freed base memory; one block will contain librm.
-rw-r--r--src/arch/i386/firmware/pcbios/basemem.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/arch/i386/firmware/pcbios/basemem.c b/src/arch/i386/firmware/pcbios/basemem.c
index 11fa6dce..8e65b8da 100644
--- a/src/arch/i386/firmware/pcbios/basemem.c
+++ b/src/arch/i386/firmware/pcbios/basemem.c
@@ -22,17 +22,6 @@
#define fbms ( * ( ( uint16_t * ) phys_to_virt ( 0x413 ) ) )
#define FBMS_MAX ( 640 )
-/* Structure that we use to represent a free block of base memory
- */
-#define FREE_BLOCK_MAGIC ( ('!'<<0) + ('F'<<8) + ('R'<<16) + ('E'<<24) )
-union free_base_memory_block {
- struct {
- uint32_t magic;
- uint16_t size_kb;
- };
- char bytes[1024];
-};
-
/* Local prototypes */
static void free_unused_base_memory ( void );
@@ -188,12 +177,10 @@ static void free_unused_base_memory ( void ) {
free_block->size_kb, ( fbms << 6 ),
( fbms + free_block->size_kb ) << 6 );
- /* Zero out freed block. We do this in case
- * the block contained any structures that
- * might be located by scanning through
- * memory.
+ /* Do not zero out the freed block, because it might
+ * be the one containing librm, in which case we're
+ * going to have severe problems the next time we use
+ * DBG() or, failing that, call get_memsizes().
*/
- memset ( free_block, 0, free_block->size_kb << 10 );
-
}
}