Selaa lähdekoodia

Don't zero freed base memory; one block will contain librm.

tags/v0.9.3
Michael Brown 19 vuotta sitten
vanhempi
commit
e29e6456b0
1 muutettua tiedostoa jossa 4 lisäystä ja 17 poistoa
  1. 4
    17
      src/arch/i386/firmware/pcbios/basemem.c

+ 4
- 17
src/arch/i386/firmware/pcbios/basemem.c Näytä tiedosto

22
 #define fbms ( * ( ( uint16_t * ) phys_to_virt ( 0x413 ) ) )
22
 #define fbms ( * ( ( uint16_t * ) phys_to_virt ( 0x413 ) ) )
23
 #define FBMS_MAX ( 640 )
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
 /* Local prototypes */
25
 /* Local prototypes */
37
 static void free_unused_base_memory ( void );
26
 static void free_unused_base_memory ( void );
38
 
27
 
188
 		      free_block->size_kb, ( fbms << 6 ),
177
 		      free_block->size_kb, ( fbms << 6 ),
189
 		      ( fbms + free_block->size_kb ) << 6 );
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
 }

Loading…
Peruuta
Tallenna