author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 18 Aug 2010 11:08:29 +0300 | |
changeset 247 | d8d70de2bd36 |
parent 109 | b3a1d9898418 |
child 257 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 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 |
// |
|
15 |
||
16 |
#include "arm_mem.h" |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
17 |
#include "mpager.h" |
0 | 18 |
|
19 |
#define iMState iWaitLink.iSpare1 |
|
20 |
||
21 |
#ifdef __REQUEST_COMPLETE_MACHINE_CODED__ |
|
22 |
||
23 |
void DoRequestComplete(DThread* aThread, TRequestStatus* aStatus, TInt aReason); |
|
24 |
||
25 |
void DThread::RequestComplete(TRequestStatus*& aStatus, TInt aReason) |
|
26 |
// |
|
27 |
// Signal this threads request semaphore. |
|
28 |
// Enter with system locked, return with system unlocked. |
|
29 |
// |
|
30 |
{ |
|
31 |
DThread* thread = TheCurrentThread; |
|
32 |
TRequestStatus* status = aStatus; |
|
33 |
aStatus = NULL; |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
34 |
|
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
35 |
#ifdef _DEBUG |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
36 |
if (KDebugNum(KFORCEKUPAGEFAULTS)) |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
37 |
{ |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
38 |
NKern::UnlockSystem(); |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
39 |
TInt r = ThePager.FlushRegion((DMemModelProcess*)thread->iOwningProcess, |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
40 |
(TLinAddr)status, sizeof(TRequestStatus)); |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
41 |
(void)r; // ignore errors |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
42 |
NKern::LockSystem(); |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
43 |
} |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
44 |
#endif |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
45 |
|
0 | 46 |
TInt pagingFault; |
47 |
do |
|
48 |
{ |
|
49 |
XTRAP_PAGING_START(pagingFault); |
|
50 |
CHECK_PAGING_SAFE; |
|
51 |
thread->iIpcClient = this; |
|
52 |
DoRequestComplete(this, status,aReason); |
|
53 |
thread->iIpcClient = NULL; |
|
54 |
XTRAP_PAGING_END; |
|
55 |
} |
|
56 |
while (pagingFault > 0); // ignore errors |
|
57 |
} |
|
58 |
||
59 |
#if defined(_DEBUG) |
|
60 |
extern "C" void __DebugMsgRequestComplete(TInt a0, TInt a1, TInt a2) |
|
61 |
{ |
|
62 |
DThread* pT=(DThread*)a0; |
|
63 |
__KTRACE_OPT(KTHREAD,Kern::Printf("Thread %O RequestComplete %08x %d",pT,a1,a2)); |
|
64 |
} |
|
65 |
||
66 |
extern "C" void __DebugMsgReqCompleteWrite(TInt a0, TInt a1, TInt a2) |
|
67 |
{ |
|
68 |
__KTRACE_OPT(KTHREAD,Kern::Printf("Writing %d to %08x",a2,a0+a1)); |
|
69 |
} |
|
70 |
#endif |
|
71 |
#endif |
|
72 |