os/kernelhwsrv/kerneltest/e32test/misc/int_svr_calls.cia
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// e32test\misc\int_svr_calls.cia
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#include <e32def.h>
sl@0
    19
#undef IMPORT_C
sl@0
    20
#define IMPORT_C
sl@0
    21
#undef EXPORT_C
sl@0
    22
#define EXPORT_C
sl@0
    23
sl@0
    24
#define __GEN_USER_EXEC_CODE__
sl@0
    25
#include <e32svr.h>
sl@0
    26
#include <u32exec.h>
sl@0
    27
sl@0
    28
#undef EXPORT_C
sl@0
    29
#define EXPORT_C __declspec(dllexport)
sl@0
    30
sl@0
    31
sl@0
    32
#ifdef __MARM__
sl@0
    33
// ripped from e32\euser\epoc\arm\uc_exec.cia
sl@0
    34
sl@0
    35
__NAKED__ TInt Exec::SessionSend(TInt /*aHandle*/, TInt /*aFunction*/, TAny* /*aPtr*/, TRequestStatus* /*aStatus*/)
sl@0
    36
//
sl@0
    37
// Send a blind message to the server.
sl@0
    38
//
sl@0
    39
	{
sl@0
    40
	asm("stmfd sp!, {r4-r8,lr} ");
sl@0
    41
	asm("movs r8, r2 ");				// test for aPtr==NULL, set iArgFlags=0 if so
sl@0
    42
	asm("ldmneia r2, {r4-r8} ");		// else get args into r4-r8
sl@0
    43
	asm("mov ip, pc ");
sl@0
    44
	asm("swi	%a0" : : "i" (EExecSessionSend|EXECUTIVE_SLOW));
sl@0
    45
	__POPRET("r4-r8,");
sl@0
    46
	}
sl@0
    47
sl@0
    48
__NAKED__ TInt Exec::SessionSendSync(TInt /*aHandle*/, TInt /*aFunction*/, TAny* /*aPtr*/, TRequestStatus* /*aStatus*/)
sl@0
    49
//
sl@0
    50
// Send a blind message to the server using thread's dedicated message slot.
sl@0
    51
//
sl@0
    52
	{
sl@0
    53
	asm("stmfd sp!, {r4-r8,lr} ");
sl@0
    54
	asm("movs r8, r2 ");				// test for aPtr==NULL, set iArgFlags=0 if so
sl@0
    55
	asm("ldmneia r2, {r4-r8} ");		// else get args into r4-r8
sl@0
    56
	asm("mov ip, pc ");
sl@0
    57
	asm("swi	%a0" : : "i" (EExecSessionSendSync|EXECUTIVE_SLOW));
sl@0
    58
	__POPRET("r4-r8,");
sl@0
    59
	}
sl@0
    60
sl@0
    61
EXPORT_C TInt SessionCreate(const TDesC8& aName, TInt aMsgSlots, const TSecurityPolicy* aPolicy, TInt aType)
sl@0
    62
	{
sl@0
    63
	return Exec::SessionCreate(aName, aMsgSlots, aPolicy, aType);
sl@0
    64
	}
sl@0
    65
sl@0
    66
EXPORT_C TInt SessionSend(TInt aHandle, TInt aFunction, TAny* aArgs, TRequestStatus* aStatus)
sl@0
    67
	{
sl@0
    68
	return Exec::SessionSend(aHandle, aFunction, aArgs, aStatus);
sl@0
    69
	}
sl@0
    70
sl@0
    71
EXPORT_C TInt SessionSendSync(TInt aHandle, TInt aFunction, TAny* aArgs, TRequestStatus* aStatus)
sl@0
    72
	{
sl@0
    73
	return Exec::SessionSendSync(aHandle, aFunction, aArgs, aStatus);
sl@0
    74
	}
sl@0
    75
sl@0
    76
EXPORT_C void SetSessionPtr(TInt aHandle, const TAny* aPtr)
sl@0
    77
	{
sl@0
    78
	Exec::SetSessionPtr(aHandle, aPtr);
sl@0
    79
	}
sl@0
    80
#endif //__MARM__
sl@0
    81
sl@0
    82
#ifdef __X86__
sl@0
    83
// ripped from e32\euser\epoc\x86\uc_exec.cpp
sl@0
    84
sl@0
    85
__NAKED__ TInt Exec::SessionSend(TInt /*aHandle*/, TInt /*aFunction*/, TAny* /*aPtr*/, TRequestStatus* /*aStatus*/)
sl@0
    86
//
sl@0
    87
// Send a blind message to the server.
sl@0
    88
//
sl@0
    89
	{
sl@0
    90
	SLOW_EXEC4(EExecSessionSend);
sl@0
    91
	}
sl@0
    92
sl@0
    93
__NAKED__ TInt Exec::SessionSendSync(TInt /*aHandle*/, TInt /*aFunction*/, TAny* /*aPtr*/, TRequestStatus* /*aStatus*/)
sl@0
    94
//
sl@0
    95
// Send a blind message to the server using thread's dedicated message slot.
sl@0
    96
//
sl@0
    97
	{
sl@0
    98
	SLOW_EXEC4(EExecSessionSendSync);
sl@0
    99
	}
sl@0
   100
sl@0
   101
EXPORT_C TInt SessionCreate(const TDesC8& aName, TInt aMsgSlots, const TSecurityPolicy* aPolicy, TInt aType)
sl@0
   102
	{
sl@0
   103
	RDebug::Printf("Exec: %08x %08x %08x %08x", &aName, aMsgSlots, aPolicy, aType);
sl@0
   104
	return Exec::SessionCreate(aName, aMsgSlots, aPolicy, aType);
sl@0
   105
	}
sl@0
   106
sl@0
   107
EXPORT_C TInt SessionSend(TInt aHandle, TInt aFunction, TAny* aArgs, TRequestStatus* aStatus)
sl@0
   108
	{
sl@0
   109
	return Exec::SessionSend(aHandle, aFunction, aArgs, aStatus);
sl@0
   110
	}
sl@0
   111
sl@0
   112
EXPORT_C TInt SessionSendSync(TInt aHandle, TInt aFunction, TAny* aArgs, TRequestStatus* aStatus)
sl@0
   113
	{
sl@0
   114
	return Exec::SessionSendSync(aHandle, aFunction, aArgs, aStatus);
sl@0
   115
	}
sl@0
   116
sl@0
   117
EXPORT_C void SetSessionPtr(TInt aHandle, const TAny* aPtr)
sl@0
   118
	{
sl@0
   119
	Exec::SetSessionPtr(aHandle, aPtr);
sl@0
   120
	}
sl@0
   121
#endif //__X86__