200-free-mem-below-kernel-offset.patch 461 B

123456789101112131415
  1. --- a/arch/mips/ar7/memory.c
  2. +++ b/arch/mips/ar7/memory.c
  3. @@ -66,5 +66,11 @@ void __init prom_meminit(void)
  4. void __init prom_free_prom_memory(void)
  5. {
  6. - /* Nothing to free */
  7. + /* adapted from arch/mips/txx9/generic/setup.c */
  8. + unsigned long saddr = PHYS_OFFSET + PAGE_SIZE;
  9. + unsigned long eaddr = __pa_symbol(&_text);
  10. +
  11. + /* free memory between prom-record and kernel _text base */
  12. + if (saddr < eaddr)
  13. + free_init_pages("prom memory", saddr, eaddr);
  14. }