__cleanup_args() needs to be provided on x86-64. This adapts the
existing code from x86-32.

Signed-off-by: Eduard - Gabriel Munteanu <[email protected]>
---
 arch/x86/include/arch/stack-frame.h |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/arch/stack-frame.h 
b/arch/x86/include/arch/stack-frame.h
index 67da2de..3f27fae 100644
--- a/arch/x86/include/arch/stack-frame.h
+++ b/arch/x86/include/arch/stack-frame.h
@@ -80,7 +80,34 @@ unsigned long cu_frame_locals_offset(struct compilation_unit 
*cu);
                                                                        ); \
        })
 #else
- #error NOT IMPLEMENTED
+#define __cleanup_args(args_size)              \
+       ({                                                              \
+       __asm__ volatile (                                              \
+            "movq %%rbp, %%rsi \n"                                     \
+            "addq %1, %%rsi \n"                                        \
+            "decq %%rsi \n"                                            \
+                                                                       \
+            "movq %%rsi, %%rdi \n"                                     \
+            "addq %%rbx, %%rdi \n"                                     \
+                                                                       \
+            "movq %%rbp, %%rcx \n"                                     \
+            "subq %%rsp, %%rcx \n"                                     \
+            "addq %1, %%rcx \n"                                        \
+                                                                       \
+            "1: movb (%%rsi), %%al \n"                                 \
+            "movb %%al, (%%rdi) \n"                                    \
+            "decq %%rsi \n"                                            \
+            "decq %%rdi \n"                                            \
+            "decq %%rcx \n"                                            \
+            "jnz 1b \n"                                                \
+                                                                       \
+            "addq %%rbx, %%rsp \n"                                     \
+            "addq %%rbx, %%rbp \n"                                     \
+            :                                                          \
+            : "b" (args_size), "n"(2*sizeof(unsigned long))            \
+            : "%rax", "%rdi", "%rsi", "%rcx", "cc", "memory"           \
+                                                                       ); \
+       })
 #endif
 
 #endif
-- 
1.6.0.6


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jatovm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to