Lines Matching refs:entries
156 struct xtensa_mpu_entry *check_addr_in_mpu_entries(const struct xtensa_mpu_entry *entries, in check_addr_in_mpu_entries() argument
168 if (addr < xtensa_mpu_entry_start_address_get(&entries[first_enabled_idx])) { in check_addr_in_mpu_entries()
175 s_addr = xtensa_mpu_entry_start_address_get(&entries[idx]); in check_addr_in_mpu_entries()
176 e_addr = xtensa_mpu_entry_start_address_get(&entries[idx + 1]); in check_addr_in_mpu_entries()
179 ret = &entries[idx]; in check_addr_in_mpu_entries()
185 s_addr = xtensa_mpu_entry_start_address_get(&entries[idx]); in check_addr_in_mpu_entries()
188 ret = &entries[idx]; in check_addr_in_mpu_entries()
218 static inline uint8_t find_first_enabled_entry(const struct xtensa_mpu_entry *entries) in find_first_enabled_entry() argument
224 if (entries[first_enabled_idx].as.p.enable) { in find_first_enabled_entry()
268 static void sort_entries(struct xtensa_mpu_entry *entries) in sort_entries() argument
270 qsort(entries, XTENSA_MPU_NUM_ENTRIES, sizeof(entries[0]), compare_entries); in sort_entries()
274 entries[idx].at.p.segment = idx; in sort_entries()
288 static uint8_t consolidate_entries(struct xtensa_mpu_entry *entries, in consolidate_entries() argument
298 struct xtensa_mpu_entry *entry_0 = &entries[idx_0]; in consolidate_entries()
299 struct xtensa_mpu_entry *entry_1 = &entries[idx_1]; in consolidate_entries()
351 struct xtensa_mpu_entry *entry_rd = &entries[read_idx]; in consolidate_entries()
357 entry_wr = &entries[write_idx]; in consolidate_entries()
370 struct xtensa_mpu_entry *e = &entries[idx_0]; in consolidate_entries()
419 struct xtensa_mpu_entry *entries = map->entries; in mpu_map_region_add() local
426 first_enabled_idx = find_first_enabled_entry(entries); in mpu_map_region_add()
435 struct xtensa_mpu_entry *last_entry = &entries[XTENSA_MPU_NUM_ENTRIES - 1]; in mpu_map_region_add()
445 entry_slot_s = &entries[XTENSA_MPU_NUM_ENTRIES - 1]; in mpu_map_region_add()
459 entry_slot_s = &entries[XTENSA_MPU_NUM_ENTRIES - 2]; in mpu_map_region_add()
460 entry_slot_e = &entries[XTENSA_MPU_NUM_ENTRIES - 1]; in mpu_map_region_add()
475 first_enabled_idx = consolidate_entries(entries, first_enabled_idx); in mpu_map_region_add()
484 check_addr_in_mpu_entries(entries, start_addr, first_enabled_idx, in mpu_map_region_add()
487 check_addr_in_mpu_entries(entries, end_addr, first_enabled_idx, in mpu_map_region_add()
536 entry_slot_s = &entries[first_enabled_idx]; in mpu_map_region_add()
555 entry_slot_e = &entries[first_enabled_idx]; in mpu_map_region_add()
567 sort_entries(entries); in mpu_map_region_add()
574 check_addr_in_mpu_entries(entries, start_addr, first_enabled_idx, in mpu_map_region_add()
577 check_addr_in_mpu_entries(entries, end_addr, first_enabled_idx, in mpu_map_region_add()
602 xtensa_mpu_entry_attributes_set(&entries[idx], access_rights, memory_type); in mpu_map_region_add()
659 : : "a"(map->entries[entry].at), "a"(map->entries[entry].as)); in xtensa_mpu_map_write()
694 xtensa_mpu_map_fg_kernel.entries[entry] = ent; in xtensa_mpu_init()
736 consolidate_entries(xtensa_mpu_map_fg_kernel.entries, first_enabled_idx); in xtensa_mpu_init()