17f30491cSTony Luck #ifndef meminit_h 27f30491cSTony Luck #define meminit_h 37f30491cSTony Luck 47f30491cSTony Luck /* 57f30491cSTony Luck * This file is subject to the terms and conditions of the GNU General Public 67f30491cSTony Luck * License. See the file "COPYING" in the main directory of this archive 77f30491cSTony Luck * for more details. 87f30491cSTony Luck */ 97f30491cSTony Luck 107f30491cSTony Luck 117f30491cSTony Luck /* 127f30491cSTony Luck * Entries defined so far: 137f30491cSTony Luck * - boot param structure itself 147f30491cSTony Luck * - memory map 157f30491cSTony Luck * - initrd (optional) 167f30491cSTony Luck * - command line string 177f30491cSTony Luck * - kernel code & data 187f30491cSTony Luck * - crash dumping code reserved region 197f30491cSTony Luck * - Kernel memory map built from EFI memory map 207f30491cSTony Luck * - ELF core header 21627308c9SIsaku Yamahata * - xen start info if CONFIG_XEN 227f30491cSTony Luck * 237f30491cSTony Luck * More could be added if necessary 247f30491cSTony Luck */ 25627308c9SIsaku Yamahata #define IA64_MAX_RSVD_REGIONS 9 267f30491cSTony Luck 277f30491cSTony Luck struct rsvd_region { 28*e088a4adSMatthew Wilcox u64 start; /* virtual address of beginning of element */ 29*e088a4adSMatthew Wilcox u64 end; /* virtual address of end of element + 1 */ 307f30491cSTony Luck }; 317f30491cSTony Luck 327f30491cSTony Luck extern struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1]; 337f30491cSTony Luck extern int num_rsvd_regions; 347f30491cSTony Luck 357f30491cSTony Luck extern void find_memory (void); 367f30491cSTony Luck extern void reserve_memory (void); 377f30491cSTony Luck extern void find_initrd (void); 38*e088a4adSMatthew Wilcox extern int filter_rsvd_memory (u64 start, u64 end, void *arg); 39*e088a4adSMatthew Wilcox extern int filter_memory (u64 start, u64 end, void *arg); 40*e088a4adSMatthew Wilcox extern unsigned long efi_memmap_init(u64 *s, u64 *e); 41*e088a4adSMatthew Wilcox extern int find_max_min_low_pfn (u64, u64, void *); 427f30491cSTony Luck 437f30491cSTony Luck extern unsigned long vmcore_find_descriptor_size(unsigned long address); 44*e088a4adSMatthew Wilcox extern int reserve_elfcorehdr(u64 *start, u64 *end); 457f30491cSTony Luck 467f30491cSTony Luck /* 477f30491cSTony Luck * For rounding an address to the next IA64_GRANULE_SIZE or order 487f30491cSTony Luck */ 497f30491cSTony Luck #define GRANULEROUNDDOWN(n) ((n) & ~(IA64_GRANULE_SIZE-1)) 507f30491cSTony Luck #define GRANULEROUNDUP(n) (((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1)) 517f30491cSTony Luck 527f30491cSTony Luck #ifdef CONFIG_NUMA 537f30491cSTony Luck extern void call_pernode_memory (unsigned long start, unsigned long len, void *func); 547f30491cSTony Luck #else 557f30491cSTony Luck # define call_pernode_memory(start, len, func) (*func)(start, len, 0) 567f30491cSTony Luck #endif 577f30491cSTony Luck 587f30491cSTony Luck #define IGNORE_PFN0 1 /* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */ 597f30491cSTony Luck 607f30491cSTony Luck extern int register_active_ranges(u64 start, u64 len, int nid); 617f30491cSTony Luck 627f30491cSTony Luck #ifdef CONFIG_VIRTUAL_MEM_MAP 637f30491cSTony Luck # define LARGE_GAP 0x40000000 /* Use virtual mem map if hole is > than this */ 647f30491cSTony Luck extern unsigned long vmalloc_end; 657f30491cSTony Luck extern struct page *vmem_map; 667f30491cSTony Luck extern int find_largest_hole(u64 start, u64 end, void *arg); 677f30491cSTony Luck extern int create_mem_map_page_table(u64 start, u64 end, void *arg); 687f30491cSTony Luck extern int vmemmap_find_next_valid_pfn(int, int); 697f30491cSTony Luck #else 707f30491cSTony Luck static inline int vmemmap_find_next_valid_pfn(int node, int i) 717f30491cSTony Luck { 727f30491cSTony Luck return i + 1; 737f30491cSTony Luck } 747f30491cSTony Luck #endif 757f30491cSTony Luck #endif /* meminit_h */ 76