meminit.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef meminit_h
  2. #define meminit_h
  3. /*
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. */
  8. /*
  9. * Entries defined so far:
  10. * - boot param structure itself
  11. * - memory map
  12. * - initrd (optional)
  13. * - command line string
  14. * - kernel code & data
  15. * - crash dumping code reserved region
  16. * - Kernel memory map built from EFI memory map
  17. * - ELF core header
  18. * - xen start info if CONFIG_XEN
  19. *
  20. * More could be added if necessary
  21. */
  22. #define IA64_MAX_RSVD_REGIONS 9
  23. struct rsvd_region {
  24. unsigned long start; /* virtual address of beginning of element */
  25. unsigned long end; /* virtual address of end of element + 1 */
  26. };
  27. extern struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1];
  28. extern int num_rsvd_regions;
  29. extern void find_memory (void);
  30. extern void reserve_memory (void);
  31. extern void find_initrd (void);
  32. extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg);
  33. extern int filter_memory (unsigned long start, unsigned long end, void *arg);
  34. extern unsigned long efi_memmap_init(unsigned long *s, unsigned long *e);
  35. extern int find_max_min_low_pfn (unsigned long , unsigned long, void *);
  36. extern unsigned long vmcore_find_descriptor_size(unsigned long address);
  37. extern int reserve_elfcorehdr(unsigned long *start, unsigned long *end);
  38. /*
  39. * For rounding an address to the next IA64_GRANULE_SIZE or order
  40. */
  41. #define GRANULEROUNDDOWN(n) ((n) & ~(IA64_GRANULE_SIZE-1))
  42. #define GRANULEROUNDUP(n) (((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1))
  43. #ifdef CONFIG_NUMA
  44. extern void call_pernode_memory (unsigned long start, unsigned long len, void *func);
  45. #else
  46. # define call_pernode_memory(start, len, func) (*func)(start, len, 0)
  47. #endif
  48. #define IGNORE_PFN0 1 /* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */
  49. extern int register_active_ranges(u64 start, u64 len, int nid);
  50. #ifdef CONFIG_VIRTUAL_MEM_MAP
  51. # define LARGE_GAP 0x40000000 /* Use virtual mem map if hole is > than this */
  52. extern unsigned long vmalloc_end;
  53. extern struct page *vmem_map;
  54. extern int find_largest_hole (u64 start, u64 end, void *arg);
  55. extern int create_mem_map_page_table (u64 start, u64 end, void *arg);
  56. extern int vmemmap_find_next_valid_pfn(int, int);
  57. #else
  58. static inline int vmemmap_find_next_valid_pfn(int node, int i)
  59. {
  60. return i + 1;
  61. }
  62. #endif
  63. #endif /* meminit_h */