|
1 // Copyright (c) 2005-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32test\misc\int_svr_calls.cia |
|
15 // |
|
16 // |
|
17 |
|
18 #include <e32def.h> |
|
19 #undef IMPORT_C |
|
20 #define IMPORT_C |
|
21 #undef EXPORT_C |
|
22 #define EXPORT_C |
|
23 |
|
24 #define __GEN_USER_EXEC_CODE__ |
|
25 #include <e32svr.h> |
|
26 #include <u32exec.h> |
|
27 |
|
28 #undef EXPORT_C |
|
29 #define EXPORT_C __declspec(dllexport) |
|
30 |
|
31 |
|
32 #ifdef __MARM__ |
|
33 // ripped from e32\euser\epoc\arm\uc_exec.cia |
|
34 |
|
35 __NAKED__ TInt Exec::SessionSend(TInt /*aHandle*/, TInt /*aFunction*/, TAny* /*aPtr*/, TRequestStatus* /*aStatus*/) |
|
36 // |
|
37 // Send a blind message to the server. |
|
38 // |
|
39 { |
|
40 asm("stmfd sp!, {r4-r8,lr} "); |
|
41 asm("movs r8, r2 "); // test for aPtr==NULL, set iArgFlags=0 if so |
|
42 asm("ldmneia r2, {r4-r8} "); // else get args into r4-r8 |
|
43 asm("mov ip, pc "); |
|
44 asm("swi %a0" : : "i" (EExecSessionSend|EXECUTIVE_SLOW)); |
|
45 __POPRET("r4-r8,"); |
|
46 } |
|
47 |
|
48 __NAKED__ TInt Exec::SessionSendSync(TInt /*aHandle*/, TInt /*aFunction*/, TAny* /*aPtr*/, TRequestStatus* /*aStatus*/) |
|
49 // |
|
50 // Send a blind message to the server using thread's dedicated message slot. |
|
51 // |
|
52 { |
|
53 asm("stmfd sp!, {r4-r8,lr} "); |
|
54 asm("movs r8, r2 "); // test for aPtr==NULL, set iArgFlags=0 if so |
|
55 asm("ldmneia r2, {r4-r8} "); // else get args into r4-r8 |
|
56 asm("mov ip, pc "); |
|
57 asm("swi %a0" : : "i" (EExecSessionSendSync|EXECUTIVE_SLOW)); |
|
58 __POPRET("r4-r8,"); |
|
59 } |
|
60 |
|
61 EXPORT_C TInt SessionCreate(const TDesC8& aName, TInt aMsgSlots, const TSecurityPolicy* aPolicy, TInt aType) |
|
62 { |
|
63 return Exec::SessionCreate(aName, aMsgSlots, aPolicy, aType); |
|
64 } |
|
65 |
|
66 EXPORT_C TInt SessionSend(TInt aHandle, TInt aFunction, TAny* aArgs, TRequestStatus* aStatus) |
|
67 { |
|
68 return Exec::SessionSend(aHandle, aFunction, aArgs, aStatus); |
|
69 } |
|
70 |
|
71 EXPORT_C TInt SessionSendSync(TInt aHandle, TInt aFunction, TAny* aArgs, TRequestStatus* aStatus) |
|
72 { |
|
73 return Exec::SessionSendSync(aHandle, aFunction, aArgs, aStatus); |
|
74 } |
|
75 |
|
76 EXPORT_C void SetSessionPtr(TInt aHandle, const TAny* aPtr) |
|
77 { |
|
78 Exec::SetSessionPtr(aHandle, aPtr); |
|
79 } |
|
80 #endif //__MARM__ |
|
81 |
|
82 #ifdef __X86__ |
|
83 // ripped from e32\euser\epoc\x86\uc_exec.cpp |
|
84 |
|
85 __NAKED__ TInt Exec::SessionSend(TInt /*aHandle*/, TInt /*aFunction*/, TAny* /*aPtr*/, TRequestStatus* /*aStatus*/) |
|
86 // |
|
87 // Send a blind message to the server. |
|
88 // |
|
89 { |
|
90 SLOW_EXEC4(EExecSessionSend); |
|
91 } |
|
92 |
|
93 __NAKED__ TInt Exec::SessionSendSync(TInt /*aHandle*/, TInt /*aFunction*/, TAny* /*aPtr*/, TRequestStatus* /*aStatus*/) |
|
94 // |
|
95 // Send a blind message to the server using thread's dedicated message slot. |
|
96 // |
|
97 { |
|
98 SLOW_EXEC4(EExecSessionSendSync); |
|
99 } |
|
100 |
|
101 EXPORT_C TInt SessionCreate(const TDesC8& aName, TInt aMsgSlots, const TSecurityPolicy* aPolicy, TInt aType) |
|
102 { |
|
103 RDebug::Printf("Exec: %08x %08x %08x %08x", &aName, aMsgSlots, aPolicy, aType); |
|
104 return Exec::SessionCreate(aName, aMsgSlots, aPolicy, aType); |
|
105 } |
|
106 |
|
107 EXPORT_C TInt SessionSend(TInt aHandle, TInt aFunction, TAny* aArgs, TRequestStatus* aStatus) |
|
108 { |
|
109 return Exec::SessionSend(aHandle, aFunction, aArgs, aStatus); |
|
110 } |
|
111 |
|
112 EXPORT_C TInt SessionSendSync(TInt aHandle, TInt aFunction, TAny* aArgs, TRequestStatus* aStatus) |
|
113 { |
|
114 return Exec::SessionSendSync(aHandle, aFunction, aArgs, aStatus); |
|
115 } |
|
116 |
|
117 EXPORT_C void SetSessionPtr(TInt aHandle, const TAny* aPtr) |
|
118 { |
|
119 Exec::SetSessionPtr(aHandle, aPtr); |
|
120 } |
|
121 #endif //__X86__ |