diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-08-21 15:44:03 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-08-21 15:45:59 +0100 |
commit | 4c5bbbf059924f3aa24620a4cbbc35816978a606 (patch) | |
tree | 2a0a323eedd73e68b031664a76e5dc25bba6e0d9 /bridges | |
parent | 8daebc0c343f79e6ded1f35a19ed83358ec3fcb3 (diff) |
Related: rhbz#1125588 get as far as privateSnippetExecutor
Change-Id: Icc386083ecd9faefbedebbb9d2496a4eddfa0b2b
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx index 11905078f52e..479444aee9a7 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]); |