os/kernelhwsrv/kernel/eka/nkern/arm/ncsched.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 1997-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\nkern\arm\ncsched.cpp
    15 // 
    16 //
    17 
    18 // NThreadBase member data
    19 #define __INCLUDE_NTHREADBASE_DEFINES__
    20 
    21 #include <arm.h>
    22 
    23 #if defined(_DEBUG)
    24 extern "C" void __DebugMsgWaitForAnyRequest()
    25 	{
    26 	__KTRACE_OPT(KEXEC,DEBUGPRINT("WfAR"));
    27 	}
    28 
    29 extern "C" void __DebugMsgResched(int a)
    30 	{
    31 	__KTRACE_OPT(KSCHED,DEBUGPRINT("Reschedule->%T",a));
    32 	}
    33 
    34 extern "C" void __DebugMsgInitSelection(int a)
    35 	{
    36 	NThread* pT=(NThread*)a;
    37 	if (pT->iHeldFastMutex)
    38 		{
    39 		__KTRACE_OPT(KSCHED2,DEBUGPRINT("Resched init->%T, Holding %M",pT,pT->iHeldFastMutex));
    40 		}
    41 	else
    42 		{
    43 		__KTRACE_OPT(KSCHED2,DEBUGPRINT("Resched init->%T",pT));
    44 		}
    45 	}
    46 
    47 extern "C" void __DebugMsgRR(int a)
    48 	{
    49 	NThread* pT=(NThread*)a;
    50 	__KTRACE_OPT(KSCHED2,DEBUGPRINT("RoundRobin->%T",pT));
    51 	}
    52 
    53 extern "C" void __DebugMsgBlockedFM(int a)
    54 	{
    55 	NFastMutex* pM=(NFastMutex*)a;
    56 	__KTRACE_OPT(KSCHED2,DEBUGPRINT("Resched inter->%T, Blocked on %M",pM->iHoldingThread,pM));
    57 	}
    58 
    59 extern "C" void __DebugMsgImpSysHeld(int a)
    60 	{
    61 	NThread* pT=(NThread*)a;
    62 	__KTRACE_OPT(KSCHED2,DEBUGPRINT("Resched inter->%T (IMP SYS)",pT));
    63 	}
    64 
    65 extern "C" void __DebugMsgFMSignal(int a)
    66 	{
    67 	CHECK_PRECONDITIONS(MASK_KERNEL_LOCKED,"NFastMutex::Signal");			
    68 	__ASSERT_WITH_MESSAGE_DEBUG(TheScheduler.iCurrentThread->iHeldFastMutex==(NFastMutex*)a,"The calling thread doesn't hold the mutex","NFastMutex::Signal");	
    69 	__KTRACE_OPT(KNKERN,DEBUGPRINT("FMSignal %M",a));
    70 	}
    71 
    72 extern "C" void __DebugMsgFMWait(int a)
    73 	{
    74 	CHECK_PRECONDITIONS(MASK_KERNEL_LOCKED_ONCE,"NFastMutex::Wait()");
    75 	__ASSERT_WITH_MESSAGE_DEBUG(!TheScheduler.iCurrentThread->iHeldFastMutex,"No fast mutex can be held.","NFastMutex::Wait");	
    76 	__KTRACE_OPT(KNKERN,DEBUGPRINT("FMWait %M",a));
    77 	}
    78 
    79 extern "C" void __DebugMsgFMWaitYield(int a)
    80 	{
    81 	__KTRACE_OPT(KNKERN,DEBUGPRINT("FMWait: YieldTo %T",a));
    82 	}
    83 
    84 extern "C" void __DebugMsgNKFMSignal(int a)
    85 	{
    86 	__ASSERT_WITH_MESSAGE_DEBUG(TheScheduler.iCurrentThread->iHeldFastMutex==(NFastMutex*)a,"The calling thread doesn't hold the mutex","NKern::FMSignal");	
    87 	__KTRACE_OPT(KNKERN,DEBUGPRINT("NKFMSignal %M",a));
    88 	}
    89 
    90 extern "C" void __DebugMsgNKFMWait(int a)
    91 	{
    92 	__ASSERT_WITH_MESSAGE_DEBUG(!TheScheduler.iCurrentThread->iHeldFastMutex,"No fast mutex can be held.","NKern::FMWait");	
    93 	__KTRACE_OPT(KNKERN,DEBUGPRINT("NKFMWait %M",a));
    94 	}
    95 
    96 extern "C" void __DebugMsgNKFMWaitYield(int a)
    97 	{
    98 	__KTRACE_OPT(KNKERN,DEBUGPRINT("NKFMWait: YieldTo %T",a));
    99 	}
   100 
   101 extern "C" void __DebugMsgNKFMFlash(int a)
   102 	{
   103 	__ASSERT_WITH_MESSAGE_DEBUG(TheScheduler.iCurrentThread->iHeldFastMutex==(NFastMutex*)a,"The calling thread doesn't hold the mutex","NKern::FMFlash");	
   104 	__KTRACE_OPT(KNKERN,DEBUGPRINT("NKFMFlash %M",a));
   105 	}
   106 #endif
   107 
   108 #ifdef __FAST_SEM_MACHINE_CODED__
   109 extern "C" void PanicFastSemaphoreWait()
   110 	{
   111 	FAULT();
   112 	}
   113 #endif