| 151 | } |
| 152 | |
| 153 | int |
| 154 | undef_insn(u_int el, struct trapframe *frame) |
| 155 | { |
| 156 | struct undef_handler *uh; |
| 157 | uint32_t insn; |
| 158 | int ret; |
| 159 | |
| 160 | KASSERT(el < 2, ("Invalid exception level %u", el)); |
| 161 | |
| 162 | if (el == 0) { |
| 163 | ret = fueword32((uint32_t *)frame->tf_elr, &insn); |
| 164 | if (ret != 0) |
| 165 | panic("Unable to read userspace faulting instruction"); |
| 166 | } else { |
| 167 | insn = *(uint32_t *)frame->tf_elr; |
| 168 | } |
| 169 | |
| 170 | LIST_FOREACH(uh, &undef_handlers[el], uh_link) { |
| 171 | ret = uh->uh_handler(frame->tf_elr, insn, frame, frame->tf_esr); |
| 172 | if (ret) |
| 173 | return (1); |
| 174 | } |
| 175 | |
| 176 | return (0); |
| 177 | } |
no test coverage detected