[Libreoffice-commits] core.git: bridges/source
Caolán McNamara
caolanm at redhat.com
Thu Aug 21 07:46:27 PDT 2014
bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx | 17 ++++++++++++++++
1 file changed, 17 insertions(+)
New commits:
commit 4c5bbbf059924f3aa24620a4cbbc35816978a606
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 21 15:44:03 2014 +0100
Related: rhbz#1125588 get as far as privateSnippetExecutor
Change-Id: Icc386083ecd9faefbedebbb9d2496a4eddfa0b2b
diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx
index 1190507..479444a 100644
--- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx
@@ -588,7 +588,11 @@ extern "C" void privateSnippetExecutor( ... )
}
}
+#if _CALL_ELF == 2
+const int codeSnippetSize = 32;
+#else
const int codeSnippetSize = 24;
+#endif
unsigned char * codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset,
bool simpleRetType)
@@ -603,9 +607,22 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sa
if ( !simpleRetType )
nOffsetAndIndex |= 0x80000000;
+#if _CALL_ELF == 2
+ unsigned int *raw = (unsigned int *)&code[0];
+
+ raw[0] = 0xe96c0018; /* 0: ld 11,2f-0b(12) */
+ raw[1] = 0xe98c0010; /* ld 12,1f-0b(12) */
+ raw[2] = 0x7d8903a6; /* mtctr 12 */
+ raw[3] = 0x4e800420; /* bctr */
+ /* 1: .quad function_addr */
+ /* 2: .quad context */
+ *(void **)&raw[4] = (void *)privateSnippetExecutor;
+ *(void **)&raw[6] = (void*)nOffsetAndIndex;
+#else
void ** raw = (void **)&code[0];
memcpy(raw, (char*) privateSnippetExecutor, 16);
raw[2] = (void*) nOffsetAndIndex;
+#endif
#if OSL_DEBUG_LEVEL > 2
fprintf(stderr, "in: offset/index is %x %x %d, %lx\n",
nFunctionIndex, nVtableOffset, !simpleRetType, raw[2]);
More information about the Libreoffice-commits
mailing list