162306a36Sopenharmony_ci#ifndef meminit_h
262306a36Sopenharmony_ci#define meminit_h
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci/*
562306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
662306a36Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
762306a36Sopenharmony_ci * for more details.
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci/*
1262306a36Sopenharmony_ci * Entries defined so far:
1362306a36Sopenharmony_ci * 	- boot param structure itself
1462306a36Sopenharmony_ci * 	- memory map
1562306a36Sopenharmony_ci * 	- initrd (optional)
1662306a36Sopenharmony_ci * 	- command line string
1762306a36Sopenharmony_ci * 	- kernel code & data
1862306a36Sopenharmony_ci * 	- crash dumping code reserved region
1962306a36Sopenharmony_ci * 	- Kernel memory map built from EFI memory map
2062306a36Sopenharmony_ci * 	- ELF core header
2162306a36Sopenharmony_ci *
2262306a36Sopenharmony_ci * More could be added if necessary
2362306a36Sopenharmony_ci */
2462306a36Sopenharmony_ci#define IA64_MAX_RSVD_REGIONS 9
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_cistruct rsvd_region {
2762306a36Sopenharmony_ci	u64 start;	/* virtual address of beginning of element */
2862306a36Sopenharmony_ci	u64 end;	/* virtual address of end of element + 1 */
2962306a36Sopenharmony_ci};
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ciextern struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1];
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ciextern void find_memory (void);
3462306a36Sopenharmony_ciextern void reserve_memory (void);
3562306a36Sopenharmony_ciextern void find_initrd (void);
3662306a36Sopenharmony_ciextern int filter_rsvd_memory (u64 start, u64 end, void *arg);
3762306a36Sopenharmony_ciextern int filter_memory (u64 start, u64 end, void *arg);
3862306a36Sopenharmony_ciextern unsigned long efi_memmap_init(u64 *s, u64 *e);
3962306a36Sopenharmony_ciextern int find_max_min_low_pfn (u64, u64, void *);
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ciextern unsigned long vmcore_find_descriptor_size(unsigned long address);
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci/*
4462306a36Sopenharmony_ci * For rounding an address to the next IA64_GRANULE_SIZE or order
4562306a36Sopenharmony_ci */
4662306a36Sopenharmony_ci#define GRANULEROUNDDOWN(n)	((n) & ~(IA64_GRANULE_SIZE-1))
4762306a36Sopenharmony_ci#define GRANULEROUNDUP(n)	(((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1))
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci#ifdef CONFIG_NUMA
5062306a36Sopenharmony_ci  extern void call_pernode_memory (unsigned long start, unsigned long len, void *func);
5162306a36Sopenharmony_ci#else
5262306a36Sopenharmony_ci# define call_pernode_memory(start, len, func)	(*func)(start, len, 0)
5362306a36Sopenharmony_ci#endif
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci#define IGNORE_PFN0	1	/* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ciextern int register_active_ranges(u64 start, u64 len, int nid);
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#endif /* meminit_h */
60