|
From: <sv...@va...> - 2006-10-05 08:11:58
|
Author: tom
Date: 2006-10-05 09:11:56 +0100 (Thu, 05 Oct 2006)
New Revision: 6185
Log:
Make sure bit 3 of CR1 is set before executing an sc instruction to
do a system call as AIX 5.1 seems to return to the wrong address if
this is not done.
Modified:
branches/AIX5/coregrind/m_debuglog.c
branches/AIX5/coregrind/m_syscall.c
Modified: branches/AIX5/coregrind/m_debuglog.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/AIX5/coregrind/m_debuglog.c 2006-10-05 08:11:06 UTC (rev 618=
4)
+++ branches/AIX5/coregrind/m_debuglog.c 2006-10-05 08:11:56 UTC (rev 618=
5)
@@ -249,8 +249,9 @@
=20
".long 0x48000005\n\t" /* bl .+4 */
"mflr 29\n\t"
- "addi 29,29,16\n\t"
+ "addi 29,29,20\n\t"
"mtlr 29\n\t"
+ "crorc 6,6,6\n\t"
"sc\n\t" /* write() */
=20
"stw 3,0(28)\n\t" /* result */
@@ -289,8 +290,9 @@
=20
".long 0x48000005\n\t" /* bl .+4 */
"mflr 29\n\t"
- "addi 29,29,16\n\t"
+ "addi 29,29,20\n\t"
"mtlr 29\n\t"
+ "crorc 6,6,6\n\t"
"sc\n\t" /* getpid() */
=20
"stw 3,0(28)\n\t" /* result -> block[0] */
@@ -330,8 +332,9 @@
=20
".long 0x48000005\n\t" /* bl .+4 */
"mflr 29\n\t"
- "addi 29,29,16\n\t"
+ "addi 29,29,20\n\t"
"mtlr 29\n\t"
+ "crorc 6,6,6\n\t"
"sc\n\t" /* write() */
=20
"std 3,0(28)\n\t" /* result */
@@ -368,8 +371,9 @@
=20
".long 0x48000005\n\t" /* bl .+4 */
"mflr 29\n\t"
- "addi 29,29,16\n\t"
+ "addi 29,29,20\n\t"
"mtlr 29\n\t"
+ "crorc 6,6,6\n\t"
"sc\n\t" /* getpid() */
=20
"std 3,0(28)\n\t" /* result -> block[0] */
Modified: branches/AIX5/coregrind/m_syscall.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/AIX5/coregrind/m_syscall.c 2006-10-05 08:11:06 UTC (rev 6184=
)
+++ branches/AIX5/coregrind/m_syscall.c 2006-10-05 08:11:56 UTC (rev 6185=
)
@@ -346,9 +346,13 @@
// set up LR to point just after the sc insn
".long 0x48000005\n\t" // "bl here+4" -- lr :=3D & next insn
"mflr 29\n\t"
- "addi 29,29,16\n\t"
+ "addi 29,29,20\n\t"
"mtlr 29\n\t"
=20
+ // set bit 3 of CR1 otherwise AIX 5.1 returns to the
+ // wrong address after the sc instruction
+ "crorc 6,6,6\n\t"
+
// do it!
"sc\n\t"
=20
@@ -413,9 +417,13 @@
// set up LR to point just after the sc insn
".long 0x48000005\n\t" // "bl here+4" -- lr :=3D & next insn
"mflr 29\n\t"
- "addi 29,29,16\n\t"
+ "addi 29,29,20\n\t"
"mtlr 29\n\t"
=20
+ // set bit 3 of CR1 otherwise AIX 5.1 returns to the
+ // wrong address after the sc instruction
+ "crorc 6,6,6\n\t"
+
// do it!
"sc\n\t"
=20
|