sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\euser\us_data.h sl@0: // Defines accessor functions for thread local data, either using Exec calls or the thread ID sl@0: // register if available sl@0: // sl@0: // sl@0: sl@0: #ifndef __US_DATA_H__ sl@0: #define __US_DATA_H__ sl@0: sl@0: #include "us_std.h" sl@0: sl@0: #ifdef __USERSIDE_THREAD_DATA__ sl@0: sl@0: TLocalThreadData* LocalThreadData(); sl@0: sl@0: inline RAllocator* GetHeap() sl@0: { sl@0: return LocalThreadData()->iHeap; sl@0: } sl@0: sl@0: inline CActiveScheduler* GetActiveScheduler() sl@0: { sl@0: return LocalThreadData()->iScheduler; sl@0: } sl@0: sl@0: inline void SetActiveScheduler(CActiveScheduler* aS) sl@0: { sl@0: LocalThreadData()->iScheduler = aS; sl@0: } sl@0: sl@0: inline TTrapHandler* GetTrapHandler() sl@0: { sl@0: return LocalThreadData()->iTrapHandler; sl@0: } sl@0: sl@0: #else sl@0: sl@0: inline RAllocator* GetHeap() sl@0: { sl@0: return Exec::Heap(); sl@0: } sl@0: sl@0: inline CActiveScheduler* GetActiveScheduler() sl@0: { sl@0: return Exec::ActiveScheduler(); sl@0: } sl@0: sl@0: inline void SetActiveScheduler(CActiveScheduler* aS) sl@0: { sl@0: Exec::SetActiveScheduler(aS); sl@0: } sl@0: sl@0: inline TTrapHandler* GetTrapHandler() sl@0: { sl@0: return Exec::TrapHandler(); sl@0: } sl@0: sl@0: #endif sl@0: sl@0: #endif sl@0: