|
From: <sv...@va...> - 2006-10-05 02:26:56
|
Author: sewardj
Date: 2006-10-05 03:26:48 +0100 (Thu, 05 Oct 2006)
New Revision: 6181
Log:
Minor tidyings.
Modified:
branches/AIX5/coregrind/m_debuglog.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 01:44:58 UTC (rev 618=
0)
+++ branches/AIX5/coregrind/m_debuglog.c 2006-10-05 02:26:48 UTC (rev 618=
1)
@@ -61,7 +61,7 @@
=20
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
- Int block[2];
+ volatile Int block[2];
block[0] =3D (Int)buf;
block[1] =3D n;
__asm__ volatile (
@@ -70,7 +70,7 @@
"pushl %%ebx\n" /* save &block */
"movl 0(%%ebx), %%ecx\n" /* %ecx =3D buf */
"movl 4(%%ebx), %%edx\n" /* %edx =3D n */
- "movl $4, %%eax\n" /* %eax =3D __NR_write */
+ "movl $"VG_STRINGIFY(__NR_write)", %%eax\n" /* %eax =3D __NR_writ=
e */
"movl $1, %%ebx\n" /* %ebx =3D stderr */
"int $0x80\n" /* write(stderr, buf, n) */
"popl %%ebx\n" /* reestablish &block */
@@ -89,7 +89,7 @@
{
UInt __res;
__asm__ volatile (
- "movl $20, %%eax\n" /* set %eax =3D __NR_getpid */
+ "movl $"VG_STRINGIFY(__NR_getpid)", %%eax\n" /* %eax =3D __NR_getp=
id */
"int $0x80\n" /* getpid() */
"movl %%eax, %0\n" /* set __res =3D eax */
: "=3Dmr" (__res)
@@ -102,7 +102,7 @@
__attribute__((noinline))
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
- Long block[2];
+ volatile Long block[2];
block[0] =3D (Long)buf;
block[1] =3D n;
__asm__ volatile (
@@ -110,7 +110,7 @@
"pushq %%r15\n" /* r15 is callee-save */
"movq %0, %%r15\n" /* r15 =3D &block */
"pushq %%r15\n" /* save &block */
- "movq $1, %%rax\n" /* rax =3D __NR_write */
+ "movq $"VG_STRINGIFY(__NR_write)", %%rax\n" /* rax =3D __NR_write=
*/
"movq $2, %%rdi\n" /* rdi =3D stderr */
"movq 0(%%r15), %%rsi\n" /* rsi =3D buf */
"movq 8(%%r15), %%rdx\n" /* rdx =3D n */
@@ -132,7 +132,7 @@
{
UInt __res;
__asm__ volatile (
- "movq $39, %%rax\n" /* set %rax =3D __NR_getpid */
+ "movq $"VG_STRINGIFY(__NR_getpid)", %%rax\n" /* %rax =3D __NR_getp=
id */
"syscall\n" /* getpid() */
"movl %%eax, %0\n" /* set __res =3D %eax */
: "=3Dmr" (__res)
@@ -145,14 +145,14 @@
=20
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
- Int block[2];
+ volatile Int block[2];
block[0] =3D (Int)buf;
block[1] =3D n;
__asm__ volatile (
"addi 1,1,-256\n\t"
"mr 5,%0\n\t" /* r5 =3D &block[0] */
"stw 5,0(1)\n\t" /* stash on stack */
- "li 0,4\n\t" /* set %r0 =3D __NR_write (=3D=3D 4) */
+ "li 0,"VG_STRINGIFY(__NR_write)"\n\t" /* set %r0 =3D __NR_write =
*/
"li 3,2\n\t" /* set %r3 =3D stderr */
"lwz 4,0(5)\n\t" /* set %r4 =3D buf */
"lwz 5,4(5)\n\t" /* set %r5 =3D n */
@@ -177,7 +177,7 @@
"li 0, %1\n\t"
"sc"
: "=3D&r" (__res)
- : "i" (20) /* =3D=3D __NR_getpid */
+ : "i" (__NR_getpid)
: "cc","memory","cr0","ctr",
"r0","r2","r4","r5","r6","r7","r8","r9","r10","r11","r12"
);
@@ -188,14 +188,14 @@
=20
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
- Long block[2];
+ volatile Long block[2];
block[0] =3D (Long)buf;
block[1] =3D (Long)n;
__asm__ volatile (
"addi 1,1,-256\n\t"
"mr 5,%0\n\t" /* r5 =3D &block[0] */
"std 5,0(1)\n\t" /* stash on stack */
- "li 0,4\n\t" /* set %r0 =3D __NR_write (=3D=3D 4) */
+ "li 0,"VG_STRINGIFY(__NR_write)"\n\t" /* %r0 =3D __NR_write */
"li 3,2\n\t" /* set %r3 =3D stderr */
"ld 4,0(5)\n\t" /* set %r4 =3D buf */
"ld 5,8(5)\n\t" /* set %r5 =3D n */
@@ -220,7 +220,7 @@
"li 0, %1\n\t"
"sc"
: "=3D&r" (__res)
- : "i" (20) /* =3D=3D __NR_getpid */
+ : "i" (__NR_getpid)
: "cc","memory","cr0","ctr",
"r0","r2","r4","r5","r6","r7","r8","r9","r10","r11","r12"
);
@@ -233,7 +233,7 @@
{
/* For some reason gcc-3.3.2 doesn't preserve r31 across the asm
even though we state it to be trashed. So use r27 instead. */
- UInt block[3];
+ volatile UInt block[3];
block[0] =3D (UInt)buf;
block[1] =3D n;
block[2] =3D __NR_write;
@@ -278,7 +278,7 @@
{
/* For some reason gcc-3.3.2 doesn't preserve r31 across the asm
even though we state it to be trashed. So use r27 instead. */
- UInt block[1];
+ volatile UInt block[1];
block[0] =3D __NR_getpid;
__asm__ __volatile__ (
"mr 28,%0\n\t" /* establish base ptr */
@@ -310,14 +310,11 @@
return block[0];
}
=20
-#undef __NR_getpid
-#undef __NR_write
-
#elif defined(VGP_ppc64_aix5)
=20
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
- ULong block[3];
+ volatile ULong block[3];
block[0] =3D (ULong)buf;
block[1] =3D n;
block[2] =3D (ULong)__NR_write;
@@ -360,7 +357,7 @@
=20
static UInt local_sys_getpid ( void )
{
- ULong block[1];
+ volatile ULong block[1];
block[0] =3D __NR_getpid;
__asm__ __volatile__ (
"mr 28,%0\n\t" /* establish base ptr */
@@ -392,9 +389,6 @@
return (UInt)block[0];
}
=20
-#undef __NR_getpid
-#undef __NR_write
-
#else
# error Unknown platform
#endif
|