1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 #ifndef _MEMBLOCK_TEST_H 3 #define _MEMBLOCK_TEST_H 4 5 #include <stdlib.h> 6 #include <assert.h> 7 #include <linux/types.h> 8 #include <linux/memblock.h> 9 #include <linux/sizes.h> 10 11 #define MEM_SIZE SZ_16K 12 13 /* 14 * Available memory registered with memblock needs to be valid for allocs 15 * test to run. This is a convenience wrapper for memory allocated in 16 * dummy_physical_memory_init() that is later registered with memblock 17 * in setup_memblock(). 18 */ 19 struct test_memory { 20 void *base; 21 }; 22 23 struct region { 24 phys_addr_t base; 25 phys_addr_t size; 26 }; 27 28 void reset_memblock_regions(void); 29 void reset_memblock_attributes(void); 30 void setup_memblock(void); 31 void dummy_physical_memory_init(void); 32 void dummy_physical_memory_cleanup(void); 33 34 #endif 35