kerneltest/e32test/misc/int_svr_calls.cia
author John Imhofe
Mon, 19 Oct 2009 15:55:17 +0100
changeset 0 a41df078684a
child 2 4122176ea935
permissions -rw-r--r--
Convert Kernelhwsrv package from SFL to EPL kernel\eka\compsupp is subject to the ARM EABI LICENSE userlibandfileserver\fatfilenameconversionplugins\unicodeTables is subject to the Unicode license kernel\eka\kernel\zlib is subject to the zlib license

// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// e32test\misc\int_svr_calls.cia
// 
//

#include <e32def.h>
#undef EXPORT_C
#define EXPORT_C

#define __GEN_USER_EXEC_CODE__
#include <e32svr.h>
#include <u32exec.h>

#undef EXPORT_C
#define EXPORT_C __declspec(dllexport)

// ripped from e32\euser\epoc\arm\uc_exec.cia

__NAKED__ TInt Exec::SessionSend(TInt /*aHandle*/, TInt /*aFunction*/, TAny* /*aPtr*/, TRequestStatus* /*aStatus*/)
//
// Send a blind message to the server.
//
	{
	asm("stmfd sp!, {r4-r8,lr} ");
	asm("movs r8, r2 ");				// test for aPtr==NULL, set iArgFlags=0 if so
	asm("ldmneia r2, {r4-r8} ");		// else get args into r4-r8
	asm("mov ip, pc ");
	asm("swi	%a0" : : "i" (EExecSessionSend|EXECUTIVE_SLOW));
	__POPRET("r4-r8,");
	}

__NAKED__ TInt Exec::SessionSendSync(TInt /*aHandle*/, TInt /*aFunction*/, TAny* /*aPtr*/, TRequestStatus* /*aStatus*/)
//
// Send a blind message to the server using thread's dedicated message slot.
//
	{
	asm("stmfd sp!, {r4-r8,lr} ");
	asm("movs r8, r2 ");				// test for aPtr==NULL, set iArgFlags=0 if so
	asm("ldmneia r2, {r4-r8} ");		// else get args into r4-r8
	asm("mov ip, pc ");
	asm("swi	%a0" : : "i" (EExecSessionSendSync|EXECUTIVE_SLOW));
	__POPRET("r4-r8,");
	}

EXPORT_C TInt SessionCreate(const TDesC8& aName, TInt aMsgSlots, const TSecurityPolicy* aPolicy, TInt aType)
	{
	return Exec::SessionCreate(aName, aMsgSlots, aPolicy, aType);
	}

EXPORT_C TInt SessionSend(TInt aHandle, TInt aFunction, TAny* aArgs, TRequestStatus* aStatus)
	{
	return Exec::SessionSend(aHandle, aFunction, aArgs, aStatus);
	}

EXPORT_C TInt SessionSendSync(TInt aHandle, TInt aFunction, TAny* aArgs, TRequestStatus* aStatus)
	{
	return Exec::SessionSendSync(aHandle, aFunction, aArgs, aStatus);
	}

EXPORT_C void SetSessionPtr(TInt aHandle, const TAny* aPtr)
	{
	Exec::SetSessionPtr(aHandle, aPtr);
	}