Lines Matching refs:thread
173 return task->thread.regs->msr | task->thread.fpexc_mode; in get_user_msr()
178 task->thread.regs->msr &= ~MSR_DEBUGCHANGE; in set_user_msr()
179 task->thread.regs->msr |= msr & MSR_DEBUGCHANGE; in set_user_msr()
186 *data = task->thread.dscr; in get_user_dscr()
192 task->thread.dscr = dscr; in set_user_dscr()
193 task->thread.dscr_inherit = 1; in set_user_dscr()
214 task->thread.regs->trap = trap & 0xfff0; in set_user_trap()
223 if ((task->thread.regs == NULL) || !data) in ptrace_get_reg()
235 *data = ((unsigned long *)task->thread.regs)[regno]; in ptrace_get_reg()
247 if (task->thread.regs == NULL) in ptrace_put_reg()
258 ((unsigned long *)task->thread.regs)[regno] = data; in ptrace_put_reg()
270 if (target->thread.regs == NULL) in gpr_get()
273 if (!FULL_REGS(target->thread.regs)) { in gpr_get()
276 target->thread.regs->gpr[i] = NV_REG_POISON; in gpr_get()
280 target->thread.regs, in gpr_get()
295 &target->thread.regs->orig_gpr3, in gpr_get()
312 if (target->thread.regs == NULL) in gpr_set()
315 CHECK_FULL_REGS(target->thread.regs); in gpr_set()
318 target->thread.regs, in gpr_set()
334 &target->thread.regs->orig_gpr3, in gpr_set()
373 buf[i] = target->thread.TS_FPR(i); in fpr_get()
374 buf[32] = target->thread.fp_state.fpscr; in fpr_get()
382 &target->thread.fp_state, 0, -1); in fpr_get()
402 target->thread.TS_FPR(i) = buf[i]; in fpr_set()
403 target->thread.fp_state.fpscr = buf[32]; in fpr_set()
410 &target->thread.fp_state, 0, -1); in fpr_set()
432 return target->thread.used_vr ? regset->n : 0; in vr_active()
447 &target->thread.vr_state, 0, in vr_get()
458 vrsave.word = target->thread.vrsave; in vr_get()
478 &target->thread.vr_state, 0, in vr_set()
489 vrsave.word = target->thread.vrsave; in vr_set()
493 target->thread.vrsave = vrsave.word; in vr_set()
511 return target->thread.used_vsr ? regset->n : 0; in vsr_active()
524 buf[i] = target->thread.fp_state.fpr[i][TS_VSRLOWOFFSET]; in vsr_get()
543 target->thread.fp_state.fpr[i][TS_VSRLOWOFFSET] = buf[i]; in vsr_set()
566 return target->thread.used_spe ? regset->n : 0; in evr_active()
578 &target->thread.evr, in evr_get()
579 0, sizeof(target->thread.evr)); in evr_get()
586 &target->thread.acc, in evr_get()
587 sizeof(target->thread.evr), -1); in evr_get()
601 &target->thread.evr, in evr_set()
602 0, sizeof(target->thread.evr)); in evr_set()
609 &target->thread.acc, in evr_set()
610 sizeof(target->thread.evr), -1); in evr_set()
681 const unsigned long *regs = &target->thread.regs->gpr[0]; in gpr32_get()
687 if (target->thread.regs == NULL) in gpr32_get()
690 if (!FULL_REGS(target->thread.regs)) { in gpr32_get()
693 target->thread.regs->gpr[i] = NV_REG_POISON; in gpr32_get()
738 unsigned long *regs = &target->thread.regs->gpr[0]; in gpr32_set()
743 if (target->thread.regs == NULL) in gpr32_set()
746 CHECK_FULL_REGS(target->thread.regs); in gpr32_set()
854 struct pt_regs *regs = task->thread.regs; in user_enable_single_step()
858 task->thread.debug.dbcr0 &= ~DBCR0_BT; in user_enable_single_step()
859 task->thread.debug.dbcr0 |= DBCR0_IDM | DBCR0_IC; in user_enable_single_step()
871 struct pt_regs *regs = task->thread.regs; in user_enable_block_step()
875 task->thread.debug.dbcr0 &= ~DBCR0_IC; in user_enable_block_step()
876 task->thread.debug.dbcr0 = DBCR0_IDM | DBCR0_BT; in user_enable_block_step()
888 struct pt_regs *regs = task->thread.regs; in user_disable_single_step()
898 task->thread.debug.dbcr0 &= ~(DBCR0_IC|DBCR0_BT); in user_disable_single_step()
902 if (!DBCR_ACTIVE_EVENTS(task->thread.debug.dbcr0, in user_disable_single_step()
903 task->thread.debug.dbcr1)) { in user_disable_single_step()
907 task->thread.debug.dbcr0 &= ~DBCR0_IDM; in user_disable_single_step()
940 struct thread_struct *thread = &(task->thread); in ptrace_set_debugreg() local
979 bp = thread->ptrace_bps[0]; in ptrace_set_debugreg()
983 thread->ptrace_bps[0] = NULL; in ptrace_set_debugreg()
999 thread->ptrace_bps[0] = bp; in ptrace_set_debugreg()
1000 thread->hw_brk = hw_brk; in ptrace_set_debugreg()
1010 thread->ptrace_bps[0] = bp = register_user_hw_breakpoint(&attr, in ptrace_set_debugreg()
1013 thread->ptrace_bps[0] = NULL; in ptrace_set_debugreg()
1018 task->thread.hw_brk = hw_brk; in ptrace_set_debugreg()
1026 task->thread.debug.dac1 = data & ~0x3UL; in ptrace_set_debugreg()
1028 if (task->thread.debug.dac1 == 0) { in ptrace_set_debugreg()
1030 if (!DBCR_ACTIVE_EVENTS(task->thread.debug.dbcr0, in ptrace_set_debugreg()
1031 task->thread.debug.dbcr1)) { in ptrace_set_debugreg()
1032 task->thread.regs->msr &= ~MSR_DE; in ptrace_set_debugreg()
1033 task->thread.debug.dbcr0 &= ~DBCR0_IDM; in ptrace_set_debugreg()
1045 task->thread.debug.dbcr0 |= DBCR0_IDM; in ptrace_set_debugreg()
1054 task->thread.regs->msr |= MSR_DE; in ptrace_set_debugreg()
1075 int slot1_in_use = ((child->thread.debug.dbcr0 & DBCR0_IAC1) != 0); in set_instruction_bp()
1076 int slot2_in_use = ((child->thread.debug.dbcr0 & DBCR0_IAC2) != 0); in set_instruction_bp()
1077 int slot3_in_use = ((child->thread.debug.dbcr0 & DBCR0_IAC3) != 0); in set_instruction_bp()
1078 int slot4_in_use = ((child->thread.debug.dbcr0 & DBCR0_IAC4) != 0); in set_instruction_bp()
1097 child->thread.debug.iac1 = bp_info->addr; in set_instruction_bp()
1098 child->thread.debug.iac2 = bp_info->addr2; in set_instruction_bp()
1099 child->thread.debug.dbcr0 |= DBCR0_IAC1; in set_instruction_bp()
1108 child->thread.debug.iac3 = bp_info->addr; in set_instruction_bp()
1109 child->thread.debug.iac4 = bp_info->addr2; in set_instruction_bp()
1110 child->thread.debug.dbcr0 |= DBCR0_IAC3; in set_instruction_bp()
1130 child->thread.debug.iac1 = bp_info->addr; in set_instruction_bp()
1131 child->thread.debug.dbcr0 |= DBCR0_IAC1; in set_instruction_bp()
1137 child->thread.debug.iac2 = bp_info->addr; in set_instruction_bp()
1138 child->thread.debug.dbcr0 |= DBCR0_IAC2; in set_instruction_bp()
1142 child->thread.debug.iac3 = bp_info->addr; in set_instruction_bp()
1143 child->thread.debug.dbcr0 |= DBCR0_IAC3; in set_instruction_bp()
1146 child->thread.debug.iac4 = bp_info->addr; in set_instruction_bp()
1147 child->thread.debug.dbcr0 |= DBCR0_IAC4; in set_instruction_bp()
1153 child->thread.debug.dbcr0 |= DBCR0_IDM; in set_instruction_bp()
1154 child->thread.regs->msr |= MSR_DE; in set_instruction_bp()
1163 if ((child->thread.debug.dbcr0 & DBCR0_IAC1) == 0) in del_instruction_bp()
1168 child->thread.debug.iac2 = 0; in del_instruction_bp()
1171 child->thread.debug.iac1 = 0; in del_instruction_bp()
1172 child->thread.debug.dbcr0 &= ~DBCR0_IAC1; in del_instruction_bp()
1175 if ((child->thread.debug.dbcr0 & DBCR0_IAC2) == 0) in del_instruction_bp()
1181 child->thread.debug.iac2 = 0; in del_instruction_bp()
1182 child->thread.debug.dbcr0 &= ~DBCR0_IAC2; in del_instruction_bp()
1186 if ((child->thread.debug.dbcr0 & DBCR0_IAC3) == 0) in del_instruction_bp()
1191 child->thread.debug.iac4 = 0; in del_instruction_bp()
1194 child->thread.debug.iac3 = 0; in del_instruction_bp()
1195 child->thread.debug.dbcr0 &= ~DBCR0_IAC3; in del_instruction_bp()
1198 if ((child->thread.debug.dbcr0 & DBCR0_IAC4) == 0) in del_instruction_bp()
1204 child->thread.debug.iac4 = 0; in del_instruction_bp()
1205 child->thread.debug.dbcr0 &= ~DBCR0_IAC4; in del_instruction_bp()
1235 child->thread.debug.dac1 = (unsigned long)bp_info->addr; in set_dac()
1238 child->thread.debug.dvc1 = in set_dac()
1240 child->thread.debug.dbcr2 |= in set_dac()
1246 } else if (child->thread.debug.dbcr2 & DBCR2_DAC12MODE) { in set_dac()
1256 child->thread.debug.dac2 = (unsigned long)bp_info->addr; in set_dac()
1259 child->thread.debug.dvc2 = in set_dac()
1261 child->thread.debug.dbcr2 |= in set_dac()
1268 child->thread.debug.dbcr0 |= DBCR0_IDM; in set_dac()
1269 child->thread.regs->msr |= MSR_DE; in set_dac()
1280 child->thread.debug.dac1 = 0; in del_dac()
1283 if (child->thread.debug.dbcr2 & DBCR2_DAC12MODE) { in del_dac()
1284 child->thread.debug.dac2 = 0; in del_dac()
1285 child->thread.debug.dbcr2 &= ~DBCR2_DAC12MODE; in del_dac()
1287 child->thread.debug.dbcr2 &= ~(DBCR2_DVC1M | DBCR2_DVC1BE); in del_dac()
1290 child->thread.debug.dvc1 = 0; in del_dac()
1297 if (child->thread.debug.dbcr2 & DBCR2_DAC12MODE) in del_dac()
1300 child->thread.debug.dbcr2 &= ~(DBCR2_DVC2M | DBCR2_DVC2BE); in del_dac()
1303 child->thread.debug.dvc2 = 0; in del_dac()
1305 child->thread.debug.dac2 = 0; in del_dac()
1347 if (child->thread.debug.dbcr0 & in set_dac_range()
1352 child->thread.debug.dbcr0 |= (DBCR0_DAC1R | DBCR0_IDM); in set_dac_range()
1354 child->thread.debug.dbcr0 |= (DBCR0_DAC1W | DBCR0_IDM); in set_dac_range()
1355 child->thread.debug.dac1 = bp_info->addr; in set_dac_range()
1356 child->thread.debug.dac2 = bp_info->addr2; in set_dac_range()
1358 child->thread.debug.dbcr2 |= DBCR2_DAC12M; in set_dac_range()
1360 child->thread.debug.dbcr2 |= DBCR2_DAC12MX; in set_dac_range()
1362 child->thread.debug.dbcr2 |= DBCR2_DAC12MM; in set_dac_range()
1363 child->thread.regs->msr |= MSR_DE; in set_dac_range()
1374 struct thread_struct *thread = &(child->thread); in ppc_set_hwdebug() local
1445 bp = thread->ptrace_bps[0]; in ppc_set_hwdebug()
1455 thread->ptrace_bps[0] = bp = register_user_hw_breakpoint(&attr, in ppc_set_hwdebug()
1458 thread->ptrace_bps[0] = NULL; in ppc_set_hwdebug()
1468 if (child->thread.hw_brk.address) in ppc_set_hwdebug()
1471 child->thread.hw_brk = brk; in ppc_set_hwdebug()
1481 struct thread_struct *thread = &(child->thread); in ppc_del_hwdebug() local
1493 if (!DBCR_ACTIVE_EVENTS(child->thread.debug.dbcr0, in ppc_del_hwdebug()
1494 child->thread.debug.dbcr1)) { in ppc_del_hwdebug()
1495 child->thread.debug.dbcr0 &= ~DBCR0_IDM; in ppc_del_hwdebug()
1496 child->thread.regs->msr &= ~MSR_DE; in ppc_del_hwdebug()
1505 bp = thread->ptrace_bps[0]; in ppc_del_hwdebug()
1508 thread->ptrace_bps[0] = NULL; in ppc_del_hwdebug()
1513 if (child->thread.hw_brk.address == 0) in ppc_del_hwdebug()
1516 child->thread.hw_brk.address = 0; in ppc_del_hwdebug()
1517 child->thread.hw_brk.type = 0; in ppc_del_hwdebug()
1541 || (child->thread.regs == NULL)) in arch_ptrace()
1548 CHECK_FULL_REGS(child->thread.regs); in arch_ptrace()
1558 memcpy(&tmp, &child->thread.TS_FPR(fpidx), in arch_ptrace()
1561 tmp = child->thread.fp_state.fpscr; in arch_ptrace()
1576 || (child->thread.regs == NULL)) in arch_ptrace()
1583 CHECK_FULL_REGS(child->thread.regs); in arch_ptrace()
1591 memcpy(&child->thread.TS_FPR(fpidx), &data, in arch_ptrace()
1594 child->thread.fp_state.fpscr = data; in arch_ptrace()
1673 ret = put_user(child->thread.debug.dac1, datalp); in arch_ptrace()
1675 dabr_fake = ((child->thread.hw_brk.address & (~HW_BRK_TYPE_DABR)) | in arch_ptrace()
1676 (child->thread.hw_brk.type & HW_BRK_TYPE_DABR)); in arch_ptrace()