• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.5.8/xnu-1228.15.4/bsd/dev/ppc/

Lines Matching refs:sv

83 static int32_t branchtaken(int32_t bo, int32_t bi, ppc_saved_state_t *sv);
86 kern_return_t dtrace_user_probe(ppc_saved_state_t *sv);
170 fasttrap_anarg(ppc_saved_state_t *sv, int function_entry, int argno)
178 value = (&sv->save_r3)[argno];
180 if (sv->save_srr1 & 0x8000000000000000ULL) {
183 fasttrap_fuword64_noerr(sv->save_r1 + 48 + ((argno)* sizeof(uint64_t)), &value);
187 fasttrap_fuword32_noerr(sv->save_r1 + 24 + ((argno) * sizeof(uint32_t)), &farg);
324 fasttrap_return_common(ppc_saved_state_t *sv, user_addr_t pc, pid_t pid, user_addr_t new_pc)
369 sv->save_r3, sv->save_r4, 0, 0);
378 fasttrap_usdt_args(fasttrap_probe_t *probe, ppc_saved_state_t *sv, int argc,
388 argv[i] = (&sv->save_r0)[x];
390 if(sv->save_srr1 & 0x8000000000000000ULL) { /* Are we running in 64-bit? */
391 fasttrap_fuword64_noerr(sv->save_r1 + 48 + (x * sizeof(uint64_t)), &argv[i]); /* Grab argument > 8 from stack */
394 fasttrap_fuword32_noerr(sv->save_r1 + 24 + (x * sizeof(uint32_t)), &farg); /* Grab argument > 8 from stack */
406 fasttrap_pid_probe(ppc_saved_state_t *sv)
419 pc = sv->save_srr0; /* Remember the PC for later */
420 if(sv->save_srr1 & 0x8000000000000000ULL) addrmask = 0xFFFFFFFFFFFFFFFFULL; /* Set 64-bit addressing if enabled */
444 bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, sv->save_srr0)]; /* Get the bucket that corresponds to out PC */
450 if (pid == tp->ftt_pid && (sv->save_srr0 == tp->ftt_pc) &&
483 dtrace_probe(probe->ftp_id, sv->save_r3, sv->save_r4, /* Call the main probe routine with the first 5 args */
484 sv->save_r5, sv->save_r6, sv->save_r7);
500 dtrace_probe(probe->ftp_id, sv->save_r3, sv->save_r4, /* Call the main probe routine with the first 5 args */
501 sv->save_r5, sv->save_r6, sv->save_r7);
507 fasttrap_usdt_args(probe, sv, 5, t); /* Grab 5 arguments */
543 sv->save_r3 = 1; /* Set condition to true */
544 new_pc = (sv->save_srr0 + 4) & addrmask; /* Just fall through to the next instruction */
557 new_pc = (sv->save_srr0 + 4) & addrmask; /* Just fall through to the next instruction */
562 if(!(tp->ftt_flgs & ftmtAbs)) new_pc = (new_pc + sv->save_srr0) & addrmask; /* We don't have absolute address, use as offset from instruction address */
564 if(tp->ftt_flgs & ftmtLink) sv->save_lr = (sv->save_srr0 + 4) & addrmask; /* Set the LR to the next instruction if needed */
569 if(!(tp->ftt_flgs & ftmtAbs)) new_pc = new_pc + sv->save_srr0; /* We don't have absolute address, use as offset from instruction address */
571 if(tp->ftt_flgs & ftmtLink) sv->save_lr = (sv->save_srr0 + 4) & addrmask; /* Set the LR to the next instruction if needed */
572 if(!branchtaken(tp->ftt_bo, tp->ftt_bi, sv)) new_pc = (sv->save_srr0 + 4) & addrmask; /* If branch was not taken, set PC to next address */
576 new_pc = sv->save_lr; /* Branch target comes from the LR */
578 if(tp->ftt_flgs & ftmtLink) sv->save_lr = (sv->save_srr0 + 4) & addrmask; /* Set the LR to the next instruction if needed */
579 if(!branchtaken(tp->ftt_bo, tp->ftt_bi, sv)) new_pc = (sv->save_srr0 + 4) & addrmask; /* If branch was not taken, set PC to next address */
583 new_pc = sv->save_ctr; /* Branch target comes from the CTR */
585 if(tp->ftt_flgs & ftmtLink) sv->save_lr = (sv->save_srr0 + 4) & addrmask; /* Set the LR to the next instruction if needed */
586 if(!branchtaken(tp->ftt_bo, tp->ftt_bi, sv)) new_pc = (sv->save_srr0 + 4) & addrmask; /* If branch was not taken, set PC to next address */
590 sv->save_instr[0] = 1; /* We only have one instruction to inject */
591 sv->save_instr[1] = tp->ftt_instr; /* Set the instruction */
592 sv->save_hdr.save_flags = sv->save_hdr.save_flags | SAVinject; /* Tell low-level exception return to inject the instruction */
610 sv->save_srr0 = new_pc; /* Set the new PC */
611 if (tp->ftt_retids != NULL) fasttrap_return_common(sv, pc, pid, new_pc);
618 fasttrap_return_probe(ppc_saved_state_t *sv)
639 pc = sv->save_srr0; /* Get the PC of the probed instruction */
641 if(!(sv->save_srr1 & 0x8000000000000000ULL)) npc &= 0x00000000FFFFFFFF; /* Wrap new PC if running 32-bit */
642 fasttrap_return_common(sv, pc, p->p_pid, npc);
664 static int32_t branchtaken(int32_t bo, int32_t bi, ppc_saved_state_t *sv) {
673 ctr = sv->save_ctr = sv->save_ctr - 1; /* Decrement the CTR */
674 if(!(sv->save_srr1 & 0x8000000000000000ULL)) ctr &= 0x00000000FFFFFFFF; /* Only look at the bottom 32 bits if 32-bit mode */
680 crmatch = crmatch | (((sv->save_cr >> (31 - bi)) ^ bcond) ^ 1); /* Low bit is now set if CR flag matches or CR is not checked. Other bits are trash. */
682 // dbgTrace(0x77777777, bo, bi, sv->save_cr, ((czero | crmatch) & 1)); /* (TRACE/DEBUG) */