From 6eae9fd0d8efc4e5b764d49b54838c2612807743 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 14 May 2015 22:32:49 +0000 Subject: [PATCH] [RPCRT4] Fix ARM build svn path=/trunk/; revision=67737 --- reactos/dll/win32/rpcrt4/CMakeLists.txt | 2 +- reactos/dll/win32/rpcrt4/cproxy.c | 26 ++++++++++++++++++++++++- reactos/dll/win32/rpcrt4/cstub.c | 7 +++++++ reactos/dll/win32/rpcrt4/ndr_stubless.c | 9 ++++++++- 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/reactos/dll/win32/rpcrt4/CMakeLists.txt b/reactos/dll/win32/rpcrt4/CMakeLists.txt index 04589776491..31ad2e4741f 100644 --- a/reactos/dll/win32/rpcrt4/CMakeLists.txt +++ b/reactos/dll/win32/rpcrt4/CMakeLists.txt @@ -35,7 +35,7 @@ add_definitions( -DCOM_NO_WINDOWS_H -DMSWMSG) -if(MSVC) +if(MSVC AND NOT ARCH STREQUAL "arm") add_asm_files(rpcrt4_asm msvc.S) endif() diff --git a/reactos/dll/win32/rpcrt4/cproxy.c b/reactos/dll/win32/rpcrt4/cproxy.c index bf8a5910d81..9a5e4af1316 100644 --- a/reactos/dll/win32/rpcrt4/cproxy.c +++ b/reactos/dll/win32/rpcrt4/cproxy.c @@ -17,7 +17,7 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * + * * TODO: Handle non-i386 architectures */ @@ -150,6 +150,30 @@ static inline void init_thunk( struct thunk *thunk, unsigned int index ) thunk->call_stubless = call_stubless_func; } +#elif defined(__arm__) + +extern void call_stubless_func(void); +__ASM_GLOBAL_FUNC(call_stubless_func, + "DCD 0xDEFC\n\t" // _assertfail + "" ); + +#include "pshpack1.h" +struct thunk +{ + DWORD assertfail; +}; +#include "poppack.h" + +static const struct thunk thunk_template = +{ + { 0xDEFC } /* _assertfail */ +}; + +static inline void init_thunk( struct thunk *thunk, unsigned int index ) +{ + *thunk = thunk_template; +} + #else /* __i386__ */ #warning You must implement stubless proxies for your CPU diff --git a/reactos/dll/win32/rpcrt4/cstub.c b/reactos/dll/win32/rpcrt4/cstub.c index 5beeec173f7..ec4b0fc7063 100644 --- a/reactos/dll/win32/rpcrt4/cstub.c +++ b/reactos/dll/win32/rpcrt4/cstub.c @@ -156,6 +156,13 @@ typedef struct static const BYTE opcodes[16] = { 0x48, 0x8b, 0x49, 0x20, 0x48, 0x8b, 0x01, 0xff, 0xa0, 0, 0, 0, 0, 0x48, 0x8d, 0x36 }; +#elif defined(__arm__) +typedef struct +{ + DWORD offset; +} vtbl_method_t; +static const BYTE opcodes[1]; + #else #warning You must implement delegated proxies/stubs for your CPU diff --git a/reactos/dll/win32/rpcrt4/ndr_stubless.c b/reactos/dll/win32/rpcrt4/ndr_stubless.c index ced3e00a3a0..a0cbd7843e0 100644 --- a/reactos/dll/win32/rpcrt4/ndr_stubless.c +++ b/reactos/dll/win32/rpcrt4/ndr_stubless.c @@ -1062,6 +1062,13 @@ __ASM_GLOBAL_FUNC( call_server_func, __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") __ASM_CFI(".cfi_same_value %rbp\n\t") "ret") +#elif defined(__arm__) +LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char * args, unsigned short stack_size) +{ + FIXME("Not implemented for ARM\n"); + assert(FALSE); + return 0; +} #else #warning call_server_func not implemented for your architecture LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char * args, unsigned short stack_size) @@ -1389,7 +1396,7 @@ LONG WINAPI NdrStubCall2( pRpcMsg->BufferLength = stubMsg.BufferLength; /* allocate buffer for [out] and [ret] params */ - Status = I_RpcGetBuffer(pRpcMsg); + Status = I_RpcGetBuffer(pRpcMsg); if (Status) RpcRaiseException(Status); stubMsg.Buffer = pRpcMsg->Buffer;