Lines Matching +full:time +full:- +full:slots

1 // SPDX-License-Identifier: GPL-2.0
13 * Return the number of slots covered by this entry, i.e., the number of
25 if (md->type != EFI_CONVENTIONAL_MEMORY) in get_entry_num_slots()
28 if (md->attribute & EFI_MEMORY_HOT_PLUGGABLE) in get_entry_num_slots()
32 (md->attribute & EFI_MEMORY_SP)) in get_entry_num_slots()
35 region_end = min(md->phys_addr + md->num_pages * EFI_PAGE_SIZE - 1, in get_entry_num_slots()
40 first_slot = round_up(max(md->phys_addr, alloc_min), align); in get_entry_num_slots()
41 last_slot = round_down(region_end - size + 1, align); in get_entry_num_slots()
46 return ((unsigned long)(last_slot - first_slot) >> align_shift) + 1; in get_entry_num_slots()
55 #define MD_NUM_SLOTS(md) ((md)->virt_addr)
84 /* count the suitable slots in each memory map entry */ in efi_random_alloc()
85 for (map_offset = 0; map_offset < map->map_size; map_offset += map->desc_size) { in efi_random_alloc()
86 efi_memory_desc_t *md = (void *)map->map + map_offset; in efi_random_alloc()
87 unsigned long slots; in efi_random_alloc() local
89 slots = get_entry_num_slots(md, size, ilog2(align), alloc_min, in efi_random_alloc()
91 MD_NUM_SLOTS(md) = slots; in efi_random_alloc()
92 total_slots += slots; in efi_random_alloc()
93 if (md->attribute & EFI_MEMORY_MORE_RELIABLE) in efi_random_alloc()
94 total_mirrored_slots += slots; in efi_random_alloc()
97 /* consider only mirrored slots for randomization if any exist */ in efi_random_alloc()
106 * it corresponds with exactly one of the suitable slots we recorded in efi_random_alloc()
107 * when iterating over the memory map the first time around. in efi_random_alloc()
110 * slots of each entry at each iteration, until we have found the entry in efi_random_alloc()
116 for (map_offset = 0; map_offset < map->map_size; map_offset += map->desc_size) { in efi_random_alloc()
117 efi_memory_desc_t *md = (void *)map->map + map_offset; in efi_random_alloc()
122 !(md->attribute & EFI_MEMORY_MORE_RELIABLE)) in efi_random_alloc()
126 target_slot -= MD_NUM_SLOTS(md); in efi_random_alloc()
130 target = round_up(max_t(u64, md->phys_addr, alloc_min), align) + target_slot * align; in efi_random_alloc()