|
From: <sv...@va...> - 2005-11-11 01:00:40
|
Author: cerion
Date: 2005-11-11 01:00:36 +0000 (Fri, 11 Nov 2005)
New Revision: 5077
Log:
Comments from Greg Parker re ppc ABI conventions.
Modified:
trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S
Modified: trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S
=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
--- trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S 2005-11-10 23:30:21=
UTC (rev 5076)
+++ trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S 2005-11-11 01:00:36=
UTC (rev 5077)
@@ -44,6 +44,12 @@
VG_(run_innerloop):
/* ----- entry point to VG_(run_innerloop) ----- */
=20
+ /* For Linux/ppc32 we need the SysV ABI, which uses
+ LR->4(parent_sp), CR->anywhere.
+ (The AIX ABI, used on Darwin, and maybe Linux/ppc64?,
+ uses LR->8(prt_sp), CR->4(prt_sp))
+ */
+
/* Save lr */
mflr 0
stw 0,4(1)
@@ -92,11 +98,14 @@
stw 16,288(1)
stw 15,284(1)
stw 14,280(1)
-
-// CAB: this necessary?
+ /* Probably not necessary to save r13 (thread-specific ptr),
+ as VEX stays clear of it... but what the hey. */
stw 13,276(1)
=20
-// CAB: this necessary?
+ /* It's necessary to save/restore VRSAVE in the AIX / Darwin ABI=
.
+ The Linux kernel might not actually use VRSAVE for its intend=
ed
+ purpose, but it should be harmless to preserve anyway. */
+
/* VRSAVE save word : 32 bytes */
mfspr 4,256 /* vrsave reg is spr number 256 */
stw 4,244(1)
@@ -129,13 +138,12 @@
li 4,48
stvx 20,4,1
=20
- /* Local variable space... */
-
-// CAB: ok to save CR here? saving to parent stack corrupts...
/* Save cr */
mfcr 0
stw 0,32(1)
=20
+ /* Local variable space... */
+
/* r3 holds guest_state */
mr 31,3
stw 3,28(1) /* spill orig guest_state ptr */
|