Hi Qian,

On Sun, 07 Feb 2010 13:07:17 +0100, caiq...@redhat.com wrote:
> Can we disable syscall-reset test case for powerpc, since it is broken there?
> http://marc.info/?t=125952920400004

modified it according to the current ppc* behavior described there.


> I think that is for powerpc not powerpc64, right?

I do not see difference of ppc/ppc64 but the testcase was made with
expectation of x86* behavior on ppc*.


It has been now tested on kernel-2.6.31-34.el6.ppc64 (for both ppc32 and pp64
binary).


Thanks,
Jan


--- tests/syscall-reset.c       8 Dec 2008 18:23:41 -0000       1.11
+++ tests/syscall-reset.c       20 Feb 2010 02:11:10 -0000      1.12
@@ -139,11 +139,35 @@ main (int argc, char **argv)
 #elif defined __x86_64__
 # define RETREG                offsetof (struct user_regs_struct, rax)
 #elif defined __powerpc__
-# define RETREG                offsetof (struct pt_regs, gpr[0])
+
+  /* PPC http://marc.info/?t=125952920400004 cannot set return value on the
+     entry, skip over to the syscall exit ptrace side.  */
+
+# define SYSCALLREG    offsetof (struct pt_regs, gpr[0])
+# define RETREG                offsetof (struct pt_regs, gpr[3])
+
+  errno = 0;
+  l = ptrace (PTRACE_PEEKUSER, child, SYSCALLREG, 0l);
+  assert_perror (errno);
+  assert (l == -23L);
+
+  errno = 0;
+  l = ptrace (PTRACE_SYSCALL, child, 0l, 0l);
+  assert_perror (errno);
+  assert (l == 0);
+
+  got_pid = waitpid (child, &status, 0);
+  assert (got_pid == child);
+  assert (WIFSTOPPED (status));
+  assert (WSTOPSIG (status) == SIGTRAP);
+
+  /* PPC has positive error numbers, they are indicated by the SO bit in CR.  
*/
+
 # undef OLDVAL
+# define OLDVAL                ((long) ENOSYS)
 # undef NEWVAL
-# define OLDVAL                -23l
 # define NEWVAL                ((long) ENOTTY)
+
 #endif
 
 #ifdef RETREG

Reply via email to