os/kernelhwsrv/kernel/eka/euser/us_data.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // e32\euser\us_data.h
    15 // Defines accessor functions for thread local data, either using Exec calls or the thread ID
    16 // register if available
    17 // 
    18 //
    19 
    20 #ifndef __US_DATA_H__
    21 #define __US_DATA_H__
    22 
    23 #include "us_std.h"
    24 
    25 #ifdef __USERSIDE_THREAD_DATA__
    26 
    27 TLocalThreadData* LocalThreadData();
    28 
    29 inline RAllocator* GetHeap()
    30 	{
    31 	return LocalThreadData()->iHeap;
    32 	}
    33 
    34 inline CActiveScheduler* GetActiveScheduler()
    35 	{
    36 	return LocalThreadData()->iScheduler;
    37 	}
    38 
    39 inline void SetActiveScheduler(CActiveScheduler* aS)
    40 	{
    41 	LocalThreadData()->iScheduler = aS;
    42 	}
    43 
    44 inline TTrapHandler* GetTrapHandler()
    45 	{
    46 	return LocalThreadData()->iTrapHandler;
    47 	}
    48 
    49 #else
    50 
    51 inline RAllocator* GetHeap()
    52 	{
    53 	return Exec::Heap();
    54 	}
    55 
    56 inline CActiveScheduler* GetActiveScheduler()
    57 	{
    58 	return Exec::ActiveScheduler();
    59 	}
    60 
    61 inline void SetActiveScheduler(CActiveScheduler* aS)
    62 	{
    63 	Exec::SetActiveScheduler(aS);
    64 	}
    65 
    66 inline TTrapHandler* GetTrapHandler()
    67 	{
    68 	return Exec::TrapHandler();
    69 	}
    70 
    71 #endif
    72 
    73 #endif
    74