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