Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\euser\epoc\x86\uc_exec.cia
18 #define __GEN_USER_EXEC_CODE__
24 /******************************************************************************
25 * Slow executive calls with preprocessing or extra arguments
26 ******************************************************************************/
27 __NAKED__ TInt Exec::SessionSend(TInt /*aHandle*/, TInt /*aFunction*/, TAny* /*aPtr*/, TRequestStatus* /*aStatus*/)
29 // Send a blind message to the server.
32 SLOW_EXEC4(EExecSessionSend);
35 __NAKED__ TInt Exec::SessionSendSync(TInt /*aHandle*/, TInt /*aFunction*/, TAny* /*aPtr*/, TRequestStatus* /*aStatus*/)
37 // Send a blind message to the server using thread's dedicated message slot.
40 SLOW_EXEC4(EExecSessionSendSync);
43 __NAKED__ TInt Exec::MessageIpcCopy(TInt /*aHandle*/, TInt /*aParam*/, SIpcCopyInfo& /*aInfo*/, TInt /*anOffset*/)
45 // IPC transfer using message handle
48 SLOW_EXEC4(EExecMessageIpcCopy);
51 __NAKED__ TInt Exec::BTraceOut(TUint32 /*a0*/, TUint32 /*a1*/, const BTrace::SExecExtension& /*aExtension*/, TInt /*aDataSize*/)
53 SLOW_EXEC4(EExecBTraceOut);
56 __NAKED__ TInt Exec::BTraceOutBig(TUint32 /*a0*/, TUint32 /*a1*/, const BTrace::SExecExtension& /*aExtension*/, TInt /*aDataSize*/)
58 SLOW_EXEC4(EExecBTraceOutBig);
61 __NAKED__ TInt Exec::UTraceOut(TUint32 /*a0*/, TUint32 /*a1*/, const BTrace::SExecExtension& /*aExtension*/, TInt /*aDataSize*/)
63 SLOW_EXEC4(EExecUTraceOut);
66 __NAKED__ void ExitCurrentThread(TExitType /*aType*/, TInt /*aReason*/, const TDesC8* /*aCategory*/)
68 asm("mov eax, %0": : "i"(EExecThreadKill));
69 asm("push ebx"); // push these anyway for debug
71 asm("mov ecx, %0": : "i"(0xffff8001)); // gcc/gas doesnt like KCurrentThreadHandle
72 asm("mov edx, [esp+12]");
73 asm("mov ebx, [esp+16]");
74 asm("mov esi, [esp+20]");
79 EXPORT_C __NAKED__ void RThread::RequestComplete(TRequestStatus*& aStatus, TInt aReason) const
81 Signals this thread that an asynchronous request originating from this thread,
84 The request is associated with the specified request status object supplied
87 Typically, the caller of this function is the service provider responsible
88 for satisfying the request made by this thread.
90 The request is completed with the completion code passed in aReason. This
91 value is copied into this thread's request status, *aStatus, before signalling
92 this thread's request semaphore.
94 The meaning of the completion code is a matter of convention to be decided
95 between the service provider and this thread.
97 In a client-server situation, completion of a request takes place in the context
98 of the server thread, but the pointer is interpreted in the address space
101 It is often the case in client-server situations that the client and the server
102 are in the same address space (i.e. the same process).
104 Setting the pointer to the request status to NULL is a convenience, not all
107 @param aStatus A reference to a pointer to the request status originally
108 supplied by this thread. This is a pointer into this thread's
109 address space, which may be different to the thread currently
110 executing (this code). On return, the pointer to the request
111 status is set to NULL.
113 @param aReason The completion code of this request.
116 // Signal a request completion.
117 // NOTE: __thiscall convention - we must remove parameters
122 asm("mov ecx, [ecx]");
123 asm("mov eax, [esp+8]");
124 asm("mov ebx, [esp+12]");
126 asm("lock xchg edx, [eax]");
128 asm("je ExecRequestComplete_ret");
129 asm("mov [edx], ebx"); // write to request status
130 asm("mov eax, %0": : "i"(EExecThreadRequestSignal));
132 asm("ExecRequestComplete_ret:");