ARM64 架构体系中 , 不能使用 bootmem
引导内存分配器 , 使用的是 memblock
分配器 ;
memblock 分配器 定义在 Linux 内核源码的 linux-4.12\include\linux\memblock.h#48 位置 ;
struct memblock {
bool bottom_up; /* is bottom up direction? */
phys_addr_t current_limit;
struct memblock_type memory;
struct memblock_type reserved;
#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
struct memblock_type physmem;
#endif
};
源码路径 : linux-4.12\include\linux\memblock.h#48
bottom_up
成员表示 内存分配方式 ,
bool bottom_up; /* is bottom up direction? */
current_limit
成员表示 可分配内存的 最大物理地址 ;
phys_addr_t current_limit;
memory
成员 表示 内存类型 , 该内存 包括 已分配 和 未分配 的内存 ;
struct memblock_type memory;
reserved
成员 表示 预留类型 , 该内存只包含 已分配内存 ;
struct memblock_type reserved;
physmem
成员 表示 物理内存类型 ;
#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
struct memblock_type physmem;
#endif
物理内存类型 与 内存类型 :
mem
内核参数 指定可用内存大小范围 , 该范围之外的内存不可使用 , 即内核无法使用所有的内存 ;