]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Comments from Greg Parker re ppc ABI conventions.
authorCerion Armour-Brown <cerion@valgrind.org>
Fri, 11 Nov 2005 01:00:36 +0000 (01:00 +0000)
committerCerion Armour-Brown <cerion@valgrind.org>
Fri, 11 Nov 2005 01:00:36 +0000 (01:00 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5077

coregrind/m_dispatch/dispatch-ppc32-linux.S

index 980001a43ef7f050eab854ec69051e45b104e02f..6a34f0b5a804c6c9b2be26a862675312b4aca29d 100644 (file)
 VG_(run_innerloop):
         /* ----- entry point to VG_(run_innerloop) ----- */
 
+        /* 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 @@ VG_(run_innerloop):
         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)
 
-// 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 intended
+           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 @@ VG_(run_innerloop):
         li      4,48
         stvx    20,4,1
 
-        /* Local variable space... */
-
-// CAB: ok to save CR here? saving to parent stack corrupts...
         /* Save cr */
         mfcr    0
         stw     0,32(1)
 
+        /* Local variable space... */
+
         /* r3 holds guest_state */
         mr      31,3
         stw     3,28(1)       /* spill orig guest_state ptr */