23#include <com/sun/star/uno/genfunc.hxx>
24#include "com/sun/star/uno/RuntimeException.hpp"
41 register float fret
asm(
"fr4");
42 register double dret
asm(
"fr4");
44 switch (pReturnTypeDescr->eTypeClass)
46 case typelib_TypeClass_HYPER:
47 case typelib_TypeClass_UNSIGNED_HYPER:
48 pRegisterReturn[1] = ret1;
49 case typelib_TypeClass_LONG:
50 case typelib_TypeClass_UNSIGNED_LONG:
51 case typelib_TypeClass_ENUM:
52 case typelib_TypeClass_CHAR:
53 case typelib_TypeClass_SHORT:
54 case typelib_TypeClass_UNSIGNED_SHORT:
55 case typelib_TypeClass_BOOLEAN:
56 case typelib_TypeClass_BYTE:
57 pRegisterReturn[0] = ret0;
59 case typelib_TypeClass_FLOAT:
60 *(
float*)pRegisterReturn = fret;
62 case typelib_TypeClass_DOUBLE:
63 *(
double*)pRegisterReturn = dret;
65 case typelib_TypeClass_STRUCT:
66 case typelib_TypeClass_EXCEPTION:
70 pRegisterReturn[0] = ret0;
71 pRegisterReturn[1] = ret1;
87 sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR,
double *pFPR)
__attribute__((noinline));
91 sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR,
double *pFPR)
93 register sal_uInt32* sp
__asm__(
"%r30");
95 sal_uInt32 pMethod = *((sal_uInt32*)pThis);
96 pMethod += 4 * nVtableIndex;
97 pMethod = *((sal_uInt32 *)pMethod);
99#if OSL_DEBUG_LEVEL > 2
100 fprintf(stderr,
"this is %p\n", pGPR[0]);
102 fprintf(stderr,
"normal reg %d is %d %x\n",
i, pGPR[
i], pGPR[
i]);
105 fprintf(stderr,
"float reg %d is %x\n",
i, pFPR[
i]);
107 for (
int i = 0;
i < nStack; ++
i)
108 fprintf(stderr,
"stack bytes are %x\n", pStack[
i]);
112 sal_uInt32 nStackBytes = ( ( nStack + 4 + 1 ) >> 1 ) * 8;
113 __builtin_alloca(nStackBytes);
114 sal_uInt32 *stack = sp-8;
116 for (sal_uInt32
i = 0;
i < nStack; ++
i, --o)
117 stack[o] = pStack[
i];
119 typedef int (* FunctionCall )( sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32 );
120 FunctionCall pFunc = (FunctionCall)pMethod;
122 asm volatile(
"fldd %0, %%fr4" : :
"m"(pFPR[0]) :
"fr4");
123 asm volatile(
"fldd %0, %%fr5" : :
"m"(pFPR[1]) :
"fr5");
124 asm volatile(
"fldd %0, %%fr6" : :
"m"(pFPR[2]) :
"fr6");
125 asm volatile(
"fldd %0, %%fr7" : :
"m"(pFPR[3]) :
"fr7");
126 asm volatile(
"ldw %0, %%r28" : :
"m"(pRegisterReturn) :
"r28");
127 (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3]);
129 register sal_uInt32 r29
__asm__(
"%r29");
130 MapReturn(r28, r29, pReturnTypeDescr, bRegisterReturn, (sal_uInt32*)pRegisterReturn);
register sal_uInt32 r28 __asm__("%r28")
void callVirtualMethod(void *pThis, sal_uInt32 nVtableIndex, void *pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn, sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, double *pFPR) __attribute__((noinline))
void MapReturn(sal_uInt32 ret0, sal_uInt32 ret1, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn, sal_uInt32 *pRegisterReturn)
struct _typelib_TypeDescription typelib_TypeDescription
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
unsigned _Unwind_Word __attribute__((__mode__(__word__)))