Lines Matching refs:tp

264 fasttrap_tracepoint_init(proc_t *p, fasttrap_tracepoint_t *tp, user_addr_t pc,
316 tp->ftt_size = (uint8_t)size;
317 tp->ftt_segment = FASTTRAP_SEG_NONE;
355 if (tp->ftt_segment != FASTTRAP_SEG_NONE)
358 tp->ftt_segment = seg;
378 bcopy(instr, tp->ftt_instr, FASTTRAP_MAX_INSTR_SIZE);
380 tp->ftt_type = FASTTRAP_T_COMMON;
399 tp->ftt_type = FASTTRAP_T_JCC;
400 tp->ftt_code = (instr[start + 1] & 0x0f) | FASTTRAP_JO;
401 tp->ftt_dest = pc + tp->ftt_size +
415 tp->ftt_type = FASTTRAP_T_CALL;
417 tp->ftt_type = FASTTRAP_T_JMP;
420 tp->ftt_code = 2;
422 tp->ftt_code = 1;
436 tp->ftt_scale = FASTTRAP_SIB_SCALE(sib);
438 tp->ftt_index = (index == 4) ?
441 tp->ftt_base = (mod == 0 && base == 5) ?
457 tp->ftt_base = REG_RIP;
460 tp->ftt_base = FASTTRAP_NOREG;
466 tp->ftt_base = regmap[base];
469 tp->ftt_index = FASTTRAP_NOREG;
474 tp->ftt_dest = *(int8_t *)&instr[start + i];
477 tp->ftt_dest = *(int32_t *)&instr[start + i];
479 tp->ftt_dest = 0;
485 tp->ftt_type = FASTTRAP_T_RET;
489 tp->ftt_type = FASTTRAP_T_RET16;
491 tp->ftt_dest = *(uint16_t *)&instr[start + 1];
510 tp->ftt_type = FASTTRAP_T_JCC;
511 tp->ftt_code = instr[start];
512 tp->ftt_dest = pc + tp->ftt_size +
519 tp->ftt_type = FASTTRAP_T_LOOP;
520 tp->ftt_code = instr[start];
521 tp->ftt_dest = pc + tp->ftt_size +
526 tp->ftt_type = FASTTRAP_T_JCXZ;
527 tp->ftt_dest = pc + tp->ftt_size +
532 tp->ftt_type = FASTTRAP_T_CALL;
533 tp->ftt_dest = pc + tp->ftt_size +
536 tp->ftt_code = 0;
540 tp->ftt_type = FASTTRAP_T_JMP;
541 tp->ftt_dest = pc + tp->ftt_size +
546 tp->ftt_type = FASTTRAP_T_JMP;
547 tp->ftt_dest = pc + tp->ftt_size +
553 tp->ftt_type = FASTTRAP_T_PUSHL_EBP;
568 tp->ftt_type = FASTTRAP_T_NOP;
595 if (p_model == DATAMODEL_LP64 && tp->ftt_type == FASTTRAP_T_COMMON) {
623 tp->ftt_ripmode = FASTTRAP_RIP_1 |
628 tp->ftt_ripmode = FASTTRAP_RIP_2 |
634 tp->ftt_modrm = tp->ftt_instr[rmindex];
635 tp->ftt_instr[rmindex] =
646 fasttrap_tracepoint_install(proc_t *p, fasttrap_tracepoint_t *tp)
650 if (uwrite(p, &instr, 1, tp->ftt_pc) != 0)
657 fasttrap_tracepoint_remove(proc_t *p, fasttrap_tracepoint_t *tp)
665 if (uread(p, &instr, 1, tp->ftt_pc) != 0)
669 if (uwrite(p, &tp->ftt_instr[0], 1, tp->ftt_pc) != 0)
695 fasttrap_tracepoint_t *tp;
704 for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) {
705 if (pid == tp->ftt_pid && pc == tp->ftt_pc &&
706 tp->ftt_proc->ftpc_acount != 0)
715 if (tp == NULL) {
720 for (id = tp->ftt_retids; id != NULL; id = id->fti_next) {
726 if (tp->ftt_type != FASTTRAP_T_RET &&
727 tp->ftt_type != FASTTRAP_T_RET16 &&
827 fasttrap_do_seg(fasttrap_tracepoint_t *tp, x86_saved_state_t *rp, user_addr_t *addr) // 64 bit
829 #pragma unused(tp, rp, addr)
837 switch (tp->ftt_segment) {
902 if (tp->ftt_segment == FASTTRAP_SEG_CS) {
963 fasttrap_tracepoint_t *tp, tp_local;
1011 for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) {
1012 if (pid == tp->ftt_pid && pc == tp->ftt_pc &&
1013 tp->ftt_proc->ftpc_acount != 0)
1022 if (tp == NULL) {
1033 if (tp->ftt_ids != NULL) {
1053 for (id = tp->ftt_ids; id != NULL; id = id->fti_next) {
1095 fasttrap_tracepoint_remove(p, tp);
1105 tp_local = *tp;
1107 tp = &tp_local;
1114 regs32->eip = pc + tp->ftt_size;
1139 switch (tp->ftt_type) {
1163 if (tp->ftt_type == FASTTRAP_T_RET16)
1164 addr += tp->ftt_dest;
1175 switch (tp->ftt_code) {
1237 new_pc = tp->ftt_dest;
1239 new_pc = pc + tp->ftt_size;
1248 switch (tp->ftt_code) {
1265 new_pc = tp->ftt_dest;
1267 new_pc = pc + tp->ftt_size;
1276 new_pc = tp->ftt_dest;
1278 new_pc = pc + tp->ftt_size;
1294 new_pc = pc + tp->ftt_size;
1299 new_pc = pc + tp->ftt_size;
1304 if (tp->ftt_code == 0) {
1305 new_pc = tp->ftt_dest;
1307 user_addr_t /* value ,*/ addr = tp->ftt_dest;
1309 if (tp->ftt_base != FASTTRAP_NOREG)
1310 addr += fasttrap_getreg(regs, tp->ftt_base);
1311 if (tp->ftt_index != FASTTRAP_NOREG)
1312 addr += fasttrap_getreg(regs, tp->ftt_index) <<
1313 tp->ftt_scale;
1315 if (tp->ftt_code == 1) {
1322 if (tp->ftt_segment != FASTTRAP_SEG_NONE &&
1323 fasttrap_do_seg(tp, regs, &addr) != 0) {
1348 if (tp->ftt_type == FASTTRAP_T_CALL) {
1350 int ret = fasttrap_suword32(addr, (uint32_t)(pc + tp->ftt_size));
1378 * jmp <pc + tp->ftt_size> 5
1388 * <pc + tp->ftt_size> 8
1415 ASSERT(tp->ftt_size < FASTTRAP_MAX_INSTR_SIZE);
1418 bcopy(tp->ftt_instr, &scratch[i], tp->ftt_size);
1419 i += tp->ftt_size;
1431 bcopy(tp->ftt_instr, &scratch[i], tp->ftt_size);
1432 i += tp->ftt_size;
1444 if (tp->ftt_retids != NULL) {
1453 uthread->t_dtrace_npc = pc + tp->ftt_size;
1479 if (tp->ftt_retids != NULL) {
1487 if (tp->ftt_type != FASTTRAP_T_COMMON) {
1521 fasttrap_tracepoint_t *tp, tp_local;
1570 for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) {
1571 if (pid == tp->ftt_pid && pc == tp->ftt_pc &&
1572 tp->ftt_proc->ftpc_acount != 0)
1581 if (tp == NULL) {
1592 if (tp->ftt_ids != NULL) {
1595 for (id = tp->ftt_ids; id != NULL; id = id->fti_next) {
1639 fasttrap_tracepoint_remove(p, tp);
1649 tp_local = *tp;
1651 tp = &tp_local;
1658 regs64->isf.rip = pc + tp->ftt_size;
1683 switch (tp->ftt_type) {
1705 if (tp->ftt_type == FASTTRAP_T_RET16)
1706 addr += tp->ftt_dest;
1717 switch (tp->ftt_code) {
1779 new_pc = tp->ftt_dest;
1781 new_pc = pc + tp->ftt_size;
1790 switch (tp->ftt_code) {
1807 new_pc = tp->ftt_dest;
1809 new_pc = pc + tp->ftt_size;
1818 new_pc = tp->ftt_dest;
1820 new_pc = pc + tp->ftt_size;
1836 new_pc = pc + tp->ftt_size;
1841 new_pc = pc + tp->ftt_size;
1846 if (tp->ftt_code == 0) {
1847 new_pc = tp->ftt_dest;
1849 user_addr_t value, addr = tp->ftt_dest;
1851 if (tp->ftt_base != FASTTRAP_NOREG)
1852 addr += fasttrap_getreg(regs, tp->ftt_base);
1853 if (tp->ftt_index != FASTTRAP_NOREG)
1854 addr += fasttrap_getreg(regs, tp->ftt_index) <<
1855 tp->ftt_scale;
1857 if (tp->ftt_code == 1) {
1864 if (tp->ftt_segment != FASTTRAP_SEG_NONE &&
1865 fasttrap_do_seg(tp, regs, &addr) != 0) {
1888 if (tp->ftt_type == FASTTRAP_T_CALL) {
1890 int ret = fasttrap_suword64(addr, pc + tp->ftt_size);
1918 * jmp <pc + tp->ftt_size> 5
1928 * <pc + tp->ftt_size> 8
1981 * <pc + tp->ftt_size> 8
1999 ASSERT(tp->ftt_size < FASTTRAP_MAX_INSTR_SIZE);
2002 bcopy(tp->ftt_instr, &scratch[i], tp->ftt_size);
2003 i += tp->ftt_size;
2005 if (tp->ftt_ripmode != 0) {
2008 ASSERT(tp->ftt_ripmode &
2020 if (tp->ftt_ripmode & FASTTRAP_RIP_X)
2025 if (tp->ftt_ripmode & FASTTRAP_RIP_1)
2030 switch (tp->ftt_ripmode) {
2055 *reg = pc + tp->ftt_size;
2072 *(uint64_t *)&scratch[i] = pc + tp->ftt_size;
2076 bcopy(tp->ftt_instr, &scratch[i], tp->ftt_size);
2077 i += tp->ftt_size;
2089 if (tp->ftt_retids != NULL) {
2098 uthread->t_dtrace_npc = pc + tp->ftt_size;
2125 if (tp->ftt_retids != NULL) {
2133 if (tp->ftt_type != FASTTRAP_T_COMMON) {