xref: /linux/tools/testing/memblock/internal.h (revision 8b7b85384fad6e21e8a28628e7ebacb5a6329de4)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #ifndef _MM_INTERNAL_H
3 #define _MM_INTERNAL_H
4 
5 /*
6  * Enable memblock_dbg() messages
7  */
8 #ifdef MEMBLOCK_DEBUG
9 static int memblock_debug = 1;
10 #endif
11 
12 #define pr_warn_ratelimited(fmt, ...)    printf(fmt, ##__VA_ARGS__)
13 
14 bool mirrored_kernelcore = false;
15 
16 struct page {};
17 
18 void memblock_free_pages(unsigned long pfn, unsigned int order)
19 {
20 }
21 
22 static inline void accept_memory(phys_addr_t start, unsigned long size)
23 {
24 }
25 
26 static inline unsigned long free_reserved_area(void *start, void *end,
27 					       int poison, const char *s)
28 {
29 	return 0;
30 }
31 
32 #define for_each_valid_pfn(pfn, start_pfn, end_pfn)                     \
33        for ((pfn) = (start_pfn); (pfn) < (end_pfn); (pfn)++)
34 
35 static inline void init_deferred_page(unsigned long pfn, int nid)
36 {
37 }
38 
39 #define __SetPageReserved(p)	((void)(p))
40 
41 #endif
42