ret = -EIO; /* Determine which register the user wants */
index = (u64)addr >> 2;
numReg = index / 2; /* Determine which part of the register the user wants */ if (index % 2)
part = 1; /* want the 2nd half of the register (right-most). */ else
part = 0; /* want the 1st half of the register (left-most). */
/* Validate the input - check to see if address is on the wrong boundary *orbeyondtheendoftheuserarea
*/ if ((addr & 3) || numReg > PT_FPSCR) break;
if (numReg >= PT_FPR0) {
flush_fp_to_thread(child); /* get 64 bit FPR */
tmp = child->thread.fp_state.fpr[numReg - PT_FPR0][0];
} else { /* register within PT_REGS struct */ unsignedlong tmp2;
ret = ptrace_get_reg(child, numReg, &tmp2); if (ret) break;
tmp = tmp2;
}
reg32bits = ((u32*)&tmp)[part];
ret = put_user(reg32bits, (u32 __user *)data); break;
}
/* Get the addr in the other process that we want to write into */
ret = -EIO; if (get_user(addrOthers, (u32 __user * __user *)addr) != 0) break;
ret = 0; if (ptrace_access_vm(child, (u64)addrOthers, &tmp, sizeof(tmp),
FOLL_FORCE | FOLL_WRITE) == sizeof(tmp)) break;
ret = -EIO; break;
}
/* write the word at location addr in the USER area */ case PTRACE_POKEUSR: { unsignedlong index;
ret = -EIO; /* convert to index and check */
index = (unsignedlong) addr >> 2; if ((addr & 3) || (index > PT_FPSCR32)) break;
if (index < PT_FPR0) {
ret = ptrace_put_reg(child, index, data);
} else {
flush_fp_to_thread(child); /* *theuserspacecodeconsidersthefloatingpoint *tobeanarrayofunsignedint(32bits)-the *indexpassedinisbasedonthisassumption.
*/
((unsignedint *)child->thread.fp_state.fpr)
[FPRINDEX(index)] = data;
ret = 0;
} break;
}
ret = -EIO; /* Determine which register the user wants */
index = (u64)addr >> 2;
numReg = index / 2;
/* *Validatetheinput-checktoseeifaddressisonthe *wrongboundaryorbeyondtheendoftheuserarea
*/ if ((addr & 3) || (numReg > PT_FPSCR)) break; if (numReg < PT_FPR0) { unsignedlong freg;
ret = ptrace_get_reg(child, numReg, &freg); if (ret) break; if (index % 2)
freg = (freg & ~0xfffffffful) | (data & 0xfffffffful); else
freg = (freg & 0xfffffffful) | (data << 32);
ret = ptrace_put_reg(child, numReg, freg);
} else {
u64 *tmp;
flush_fp_to_thread(child); /* get 64 bit FPR ... */
tmp = &child->thread.fp_state.fpr[numReg - PT_FPR0][0]; /* ... write the 32 bit part we want */
((u32 *)tmp)[index % 2] = data;
ret = 0;
} break;
}
case PTRACE_GET_DEBUGREG: { #ifndef CONFIG_PPC_ADV_DEBUG_REGS unsignedlong dabr_fake; #endif
ret = -EINVAL; /* We only support one DABR and no IABRS at the moment */ if (addr > 0) break; #ifdef CONFIG_PPC_ADV_DEBUG_REGS
ret = put_user(child->thread.debug.dac1, (u32 __user *)data); #else
dabr_fake = (
(child->thread.hw_brk[0].address & (~HW_BRK_TYPE_DABR)) |
(child->thread.hw_brk[0].type & HW_BRK_TYPE_DABR));
ret = put_user(dabr_fake, (u32 __user *)data); #endif break;
}
case PTRACE_GETREGS: /* Get all pt_regs from the child. */ return copy_regset_to_user(
child, task_user_regset_view(current), 0, 0, PT_REGS_COUNT * sizeof(compat_long_t),
compat_ptr(data));
case PTRACE_SETREGS: /* Set all gp regs in the child. */ return copy_regset_from_user(
child, task_user_regset_view(current), 0, 0, PT_REGS_COUNT * sizeof(compat_long_t),
compat_ptr(data));
case PTRACE_GETFPREGS: case PTRACE_SETFPREGS: case PTRACE_GETVRREGS: case PTRACE_SETVRREGS: case PTRACE_GETVSRREGS: case PTRACE_SETVSRREGS: case PTRACE_GETREGS64: case PTRACE_SETREGS64: case PTRACE_KILL: case PTRACE_SINGLESTEP: case PTRACE_DETACH: case PTRACE_SET_DEBUGREG: case PTRACE_SYSCALL: case PTRACE_CONT: case PPC_PTRACE_GETHWDBGINFO: case PPC_PTRACE_SETHWDEBUG: case PPC_PTRACE_DELHWDEBUG:
ret = arch_ptrace(child, request, addr, data); break;
default:
ret = compat_ptrace_request(child, request, addr, data); break;
}
return ret;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-10-01)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.