arch/x86_64/efi/prep.c
/**
 * Transform and copy the EFI memory map into the boot-independent format, which was
 * allocated and mapped in by setup_memory_map()
 *
 * The address stored in boot_params.map.entries is in the higher-half, while the
 * mem_map->map address is in the lower half. This function is called after the new page
 * tables have come into effect, but before the lower half is unmapped.
 *
 * See arch/x86_64/boot/boot.S for additional context
 */
Transform and copy the EFI memory map into the boot-independent format, which was
allocated and mapped in by setup_memory_map()

The address stored in boot_params.map.entries is in the higher-half, while the
mem_map->map address is in the lower half. This function is called after the new page
tables have come into effect, but before the lower half is unmapped.

See arch/x86_64/boot/boot.S for additional context
Transform and copy the EFI memory map into the boot - independent format which was allocated and mapped in by setup_memory_map () The address stored in boot_params . map . entries is in the higher - half while the mem_map - > map address is in the lower half . This function is called after the new page tables have come into effect but before the lower half is unmapped . See arch / x86_64 / boot / boot . S for additional context
void copy_memory_map(mem_map_t* mem_map)
{
    boot_params_t* boot_params = get_boot_params();
    for(unsigned long i = 0; i < boot_params->map.count; i++) {
        boot_params->map.entries[i].phys_addr = mem_map->map[i].phys_start;
        boot_params->map.entries[i].num_bytes = mem_map->map[i].num_pages * PAGE_SIZE;
        boot_params->map.entries[i].flags = convert_flags(mem_map->map[i].type);
    }
}
void copy_memory_map ( mem_map_t * mem_map ) { boot_params_t * boot_params = get_boot_params ( ) ; for ( unsigned long i = 0 ; i < boot_params -> map . count ; i ++ ) { boot_params -> map . entries [ i ] . phys_addr = mem_map -> map [ i ] . phys_start ; boot_params -> map . entries [ i ] . num_bytes = mem_map -> map [ i ] . num_pages * PAGE_SIZE ; boot_params -> map . entries [ i ] . flags = convert_flags ( mem_map -> map [ i ] . type ) ; } }
Transform and copy the EFI memory map into the boot-independent format, which was
 allocated and mapped in by setup_memory_map()
Transform and copy the EFI memory map into the boot - independent format which was allocated and mapped in by setup_memory_map ()