Lines Matching refs:i
146 size_t i; in alloc_slot() local
148 for (i = 0; i < n; ++i) { in alloc_slot()
149 if (!slot[i]) { in alloc_slot()
150 slot[i] = bp; in alloc_slot()
151 return i; in alloc_slot()
183 int i; in arch_install_hw_breakpoint() local
187 i = alloc_slot(this_cpu_ptr(bp_on_reg), XCHAL_NUM_IBREAK, bp); in arch_install_hw_breakpoint()
188 if (i < 0) in arch_install_hw_breakpoint()
189 return i; in arch_install_hw_breakpoint()
190 set_ibreak_regs(i, bp); in arch_install_hw_breakpoint()
194 i = alloc_slot(this_cpu_ptr(wp_on_reg), XCHAL_NUM_DBREAK, bp); in arch_install_hw_breakpoint()
195 if (i < 0) in arch_install_hw_breakpoint()
196 return i; in arch_install_hw_breakpoint()
197 set_dbreak_regs(i, bp); in arch_install_hw_breakpoint()
205 size_t i; in free_slot() local
207 for (i = 0; i < n; ++i) { in free_slot()
208 if (slot[i] == bp) { in free_slot()
209 slot[i] = NULL; in free_slot()
210 return i; in free_slot()
219 int i; in arch_uninstall_hw_breakpoint() local
225 i = free_slot(this_cpu_ptr(bp_on_reg), XCHAL_NUM_IBREAK, bp); in arch_uninstall_hw_breakpoint()
226 if (i >= 0) { in arch_uninstall_hw_breakpoint()
228 WSR(ibreakenable & ~(1 << i), SREG_IBREAKENABLE); in arch_uninstall_hw_breakpoint()
232 i = free_slot(this_cpu_ptr(wp_on_reg), XCHAL_NUM_DBREAK, bp); in arch_uninstall_hw_breakpoint()
233 if (i >= 0) in arch_uninstall_hw_breakpoint()
234 xtensa_wsr(0, SREG_DBREAKC + i); in arch_uninstall_hw_breakpoint()
244 int i; in flush_ptrace_hw_breakpoint() local
247 for (i = 0; i < XCHAL_NUM_IBREAK; ++i) { in flush_ptrace_hw_breakpoint()
248 if (t->ptrace_bp[i]) { in flush_ptrace_hw_breakpoint()
249 unregister_hw_breakpoint(t->ptrace_bp[i]); in flush_ptrace_hw_breakpoint()
250 t->ptrace_bp[i] = NULL; in flush_ptrace_hw_breakpoint()
253 for (i = 0; i < XCHAL_NUM_DBREAK; ++i) { in flush_ptrace_hw_breakpoint()
254 if (t->ptrace_wp[i]) { in flush_ptrace_hw_breakpoint()
255 unregister_hw_breakpoint(t->ptrace_wp[i]); in flush_ptrace_hw_breakpoint()
256 t->ptrace_wp[i] = NULL; in flush_ptrace_hw_breakpoint()
274 int i; in restore_dbreak() local
276 for (i = 0; i < XCHAL_NUM_DBREAK; ++i) { in restore_dbreak()
277 struct perf_event *bp = this_cpu_ptr(wp_on_reg)[i]; in restore_dbreak()
280 set_dbreak_regs(i, bp); in restore_dbreak()
288 int i; in check_hw_breakpoint() local
291 for (i = 0; i < XCHAL_NUM_IBREAK; ++i) { in check_hw_breakpoint()
292 if (bp[i] && !bp[i]->attr.disabled && in check_hw_breakpoint()
293 regs->pc == bp[i]->attr.bp_addr) in check_hw_breakpoint()
294 perf_bp_event(bp[i], regs); in check_hw_breakpoint()