1 // SPDX-License-Identifier: GPL-2.0-or-later 2 #include "tests/common.h" 3 #include <string.h> 4 5 #define INIT_MEMBLOCK_REGIONS 128 6 #define INIT_MEMBLOCK_RESERVED_REGIONS INIT_MEMBLOCK_REGIONS 7 8 void reset_memblock(void) 9 { 10 memset(memblock.memory.regions, 0, 11 memblock.memory.cnt * sizeof(struct memblock_region)); 12 memset(memblock.reserved.regions, 0, 13 memblock.reserved.cnt * sizeof(struct memblock_region)); 14 15 memblock.memory.cnt = 1; 16 memblock.memory.max = INIT_MEMBLOCK_REGIONS; 17 memblock.memory.name = "memory"; 18 memblock.memory.total_size = 0; 19 20 memblock.reserved.cnt = 1; 21 memblock.reserved.max = INIT_MEMBLOCK_RESERVED_REGIONS; 22 memblock.reserved.name = "reserved"; 23 memblock.reserved.total_size = 0; 24 25 memblock.bottom_up = false; 26 memblock.current_limit = MEMBLOCK_ALLOC_ANYWHERE; 27 } 28