- DBG ( "Trying to free %d bytes base memory at %4.4lx:%4.4lx "
- "from %d kB free\n", size,
- ( virt_to_phys ( ptr - remainder ) >> 4 ),
- ( virt_to_phys ( ptr - remainder ) & 0xf ) + remainder,
- fbms );
-
- /* Mark every kilobyte within this block as free. This is
- * overkill for normal purposes, but helps when something has
- * allocated base memory with a granularity finer than the
- * BIOS granularity of 1kB. PXE ROMs tend to do this when
- * they allocate their own memory. This method allows us to
- * free their blocks (admittedly in a rather dangerous,
- * tread-on-anything-either-side sort of way, but there's no
- * other way to do it).
- *
- * Since we're marking every kB as free, there's actually no
- * need for recording the size of the blocks. However, we
- * keep this in so that debug messages are friendlier. It
- * probably adds around 8 bytes to the overall code size.
- */
- for ( ; size_kb > 0 ; free_block++, size_kb-- ) {
- /* Mark this block as unused */
- free_block->header.magic = FREE_BLOCK_MAGIC;
- free_block->header.size_kb = size_kb;
- }
-
- /* Free up unused base memory */
- free_unused_base_memory();
-
- /* Update our memory map */
- get_memsizes();
-}
-
-/* Do the actual freeing of memory. This is split out from
- * free_base_memory() so that it may be called separately. It
- * should be called whenever base memory is deallocated by an external
- * entity (if we can detect that it has done so) so that we get the
- * chance to free up our own blocks.