setup_arch_post.h 936 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * machine_specific_memory_setup - Hook for machine specific memory setup.
  3. *
  4. * Description:
  5. * This is included late in kernel/setup.c so that it can make
  6. * use of all of the static functions.
  7. **/
  8. static char * __init machine_specific_memory_setup(void)
  9. {
  10. char *who;
  11. who = "BIOS-e820";
  12. /*
  13. * Try to copy the BIOS-supplied E820-map.
  14. *
  15. * Otherwise fake a memory map; one section from 0k->640k,
  16. * the next section from 1mb->appropriate_mem_k
  17. */
  18. sanitize_e820_map(E820_MAP, &E820_MAP_NR);
  19. if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) {
  20. unsigned long mem_size;
  21. /* compare results from other methods and take the greater */
  22. if (ALT_MEM_K < EXT_MEM_K) {
  23. mem_size = EXT_MEM_K;
  24. who = "BIOS-88";
  25. } else {
  26. mem_size = ALT_MEM_K;
  27. who = "BIOS-e801";
  28. }
  29. e820.nr_map = 0;
  30. add_memory_region(0, LOWMEMSIZE(), E820_RAM);
  31. add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
  32. }
  33. return who;
  34. }