Home | History | Annotate | Download | only in powerpc
      1 /*
      2  * PTRACE_GETREGS was added to the PowerPC kernel in v2.6.23,
      3  * we provide a slow fallback for old kernels.
      4  */
      5 static int
      6 getregs_old(pid_t pid)
      7 {
      8 	int i;
      9 	long r;
     10 
     11 	if (iflag) {
     12 		r = upeek(pid, sizeof(long) * PT_NIP, (long *)&ppc_regs.nip);
     13 		if (r)
     14 			goto out;
     15 	}
     16 #ifdef POWERPC64 /* else we never use it */
     17 	r = upeek(pid, sizeof(long) * PT_MSR, (long *)&ppc_regs.msr);
     18 	if (r)
     19 		goto out;
     20 #endif
     21 	r = upeek(pid, sizeof(long) * PT_CCR, (long *)&ppc_regs.ccr);
     22 	if (r)
     23 		goto out;
     24 	r = upeek(pid, sizeof(long) * PT_ORIG_R3, (long *)&ppc_regs.orig_gpr3);
     25 	if (r)
     26 		goto out;
     27 	for (i = 0; i <= 8; i++) {
     28 		r = upeek(pid, sizeof(long) * (PT_R0 + i),
     29 			  (long *)&ppc_regs.gpr[i]);
     30 		if (r)
     31 			goto out;
     32 	}
     33  out:
     34 	return r;
     35 }
     36