Lines Matching refs:index

64 	unsigned int index;  in print_pmp_entries()  local
67 for (index = pmp_start; index < pmp_end; index++) { in print_pmp_entries()
70 switch (pmp_n_cfg[index] & PMP_A) { in print_pmp_entries()
72 start = (index == 0) ? 0 : (pmp_addr[index - 1] << 2); in print_pmp_entries()
73 end = (pmp_addr[index] << 2) - 1; in print_pmp_entries()
76 start = pmp_addr[index] << 2; in print_pmp_entries()
80 tmp = (pmp_addr[index] << 2) | 0x3; in print_pmp_entries()
91 LOG_DBG("%3d: "PR_ADDR" 0x%02x", index, in print_pmp_entries()
92 pmp_addr[index], in print_pmp_entries()
93 pmp_n_cfg[index]); in print_pmp_entries()
97 index, pmp_addr[index], pmp_n_cfg[index], in print_pmp_entries()
99 (pmp_n_cfg[index] & PMP_R) ? 'R' : '-', in print_pmp_entries()
100 (pmp_n_cfg[index] & PMP_W) ? 'W' : '-', in print_pmp_entries()
101 (pmp_n_cfg[index] & PMP_X) ? 'X' : '-', in print_pmp_entries()
102 (pmp_n_cfg[index] & PMP_L) ? " LOCKED" : ""); in print_pmp_entries()
161 unsigned int index = *index_p; in set_pmp_entry() local
167 if (index >= index_limit) { in set_pmp_entry()
171 ((index == 0 && start == 0) || in set_pmp_entry()
172 (index != 0 && pmp_addr[index - 1] == PMP_ADDR(start)))) { in set_pmp_entry()
174 pmp_addr[index] = PMP_ADDR(start + size); in set_pmp_entry()
175 pmp_n_cfg[index] = perm | PMP_TOR; in set_pmp_entry()
176 index += 1; in set_pmp_entry()
178 pmp_addr[index] = PMP_ADDR(start); in set_pmp_entry()
179 pmp_n_cfg[index] = perm | PMP_NA4; in set_pmp_entry()
180 index += 1; in set_pmp_entry()
185 pmp_addr[index] = PMP_ADDR_NAPOT(start, size); in set_pmp_entry()
186 pmp_n_cfg[index] = perm | PMP_NAPOT; in set_pmp_entry()
187 index += 1; in set_pmp_entry()
188 } else if (PMP_TOR_SUPPORTED && index + 1 >= index_limit) { in set_pmp_entry()
192 pmp_addr[index] = PMP_ADDR(start); in set_pmp_entry()
193 pmp_n_cfg[index] = 0; in set_pmp_entry()
194 index += 1; in set_pmp_entry()
195 pmp_addr[index] = PMP_ADDR(start + size); in set_pmp_entry()
196 pmp_n_cfg[index] = perm | PMP_TOR; in set_pmp_entry()
197 index += 1; in set_pmp_entry()
203 *index_p = index; in set_pmp_entry()
289 unsigned int index; in write_pmp_entries() local
291 for (index = end; index % PMPCFG_STRIDE != 0; index++) { in write_pmp_entries()
292 pmp_n_cfg[index] = 0; in write_pmp_entries()
353 unsigned int index = 0; in z_riscv_pmp_init() local
356 set_pmp_entry(&index, PMP_R | PMP_X | PMP_L, in z_riscv_pmp_init()
366 set_pmp_entry(&index, PMP_NONE | PMP_L, in z_riscv_pmp_init()
379 set_pmp_entry(&index, PMP_NONE | PMP_L, in z_riscv_pmp_init()
390 set_pmp_mprv_catchall(&index, pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr)); in z_riscv_pmp_init()
393 write_pmp_entries(0, index, true, pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr)); in z_riscv_pmp_init()
399 index--; in z_riscv_pmp_init()
402 set_pmp_entry(&index, PMP_NONE | PMP_L, in z_riscv_pmp_init()
407 set_pmp_entry(&index, PMP_NONE | PMP_L, in z_riscv_pmp_init()
413 write_pmp_entries(0, index, true, pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr)); in z_riscv_pmp_init()
417 write_pmp_entries(0, index, true, pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr)); in z_riscv_pmp_init()
427 pmp_addr[index - 1] = -1L; in z_riscv_pmp_init()
432 __ASSERT(global_pmp_end_index == index, ""); in z_riscv_pmp_init()
434 __ASSERT(global_pmp_last_addr == pmp_addr[index - 1], ""); in z_riscv_pmp_init()
439 global_pmp_last_addr = pmp_addr[index - 1]; in z_riscv_pmp_init()
440 global_pmp_end_index = index; in z_riscv_pmp_init()
480 unsigned int index = z_riscv_pmp_thread_init(PMP_M_MODE(thread)); in z_riscv_pmp_stackguard_prepare() local
492 set_pmp_entry(&index, PMP_NONE, in z_riscv_pmp_stackguard_prepare()
495 set_pmp_mprv_catchall(&index, PMP_M_MODE(thread)); in z_riscv_pmp_stackguard_prepare()
498 thread->arch.m_mode_pmp_end_index = index; in z_riscv_pmp_stackguard_prepare()
540 unsigned int index = global_pmp_end_index; in z_riscv_pmp_stackguard_disable() local
552 set_pmp_mprv_catchall(&index, pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr)); in z_riscv_pmp_stackguard_disable()
555 write_pmp_entries(global_pmp_end_index, index, in z_riscv_pmp_stackguard_disable()
585 unsigned int index = z_riscv_pmp_thread_init(PMP_U_MODE(thread)); in z_riscv_pmp_usermode_prepare() local
590 set_pmp_entry(&index, PMP_R | PMP_W, in z_riscv_pmp_usermode_prepare()
594 thread->arch.u_mode_pmp_domain_offset = index; in z_riscv_pmp_usermode_prepare()
595 thread->arch.u_mode_pmp_end_index = index; in z_riscv_pmp_usermode_prepare()
605 unsigned int index = thread->arch.u_mode_pmp_domain_offset; in resync_pmp_domain() local
629 ok = set_pmp_entry(&index, part->attr.pmp_attr, in resync_pmp_domain()
636 thread->arch.u_mode_pmp_end_index = index; in resync_pmp_domain()