|
1 // Copyright (c) 2002-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 // e32test\smpsoak\d_smpsoak.h |
|
14 // |
|
15 |
|
16 #if !defined(__D_SMPSOAK_H__) |
|
17 #define __D_RNDTIM_H__ |
|
18 #include <e32cmn.h> |
|
19 #ifndef __KERNEL_MODE__ |
|
20 #include <e32std.h> |
|
21 #endif |
|
22 |
|
23 _LIT(KSmpSoakLddName,"SmpSoak"); |
|
24 |
|
25 |
|
26 class RSMPSoak : public RBusLogicalChannel |
|
27 { |
|
28 public: |
|
29 |
|
30 enum TCommands |
|
31 { |
|
32 KGETPROCESSORCOUNT, |
|
33 KGETCURRENTCPU, |
|
34 KGETCURRENTTHREAD, |
|
35 KTHREADSETCPUAFFINITY, |
|
36 KOCCUPYCPUS, |
|
37 KCHANGEAFFINITY, |
|
38 KCHANGETHREADPRIORITY |
|
39 }; |
|
40 |
|
41 #ifndef __KERNEL_MODE__ |
|
42 inline TInt Open() |
|
43 { return DoCreate(KSmpSoakLddName(),TVersion(0,1,1),KNullUnit,NULL,NULL); } |
|
44 inline TInt TryControl(TInt aCommand, TInt aTestNum) |
|
45 { return DoControl((TInt)aCommand,(TAny*)aTestNum); } |
|
46 inline TInt ChangeThreadAffinity(RThread* aThread, TInt cpu) |
|
47 { return DoControl((TInt)KCHANGEAFFINITY,(TAny*)aThread->Handle(), (TAny*) cpu); } |
|
48 inline TInt GetThreadCPU(RThread* aThread) |
|
49 { return DoControl((TInt)KGETCURRENTCPU,(TAny*)aThread->Handle(), (TAny*) NULL); } |
|
50 #endif |
|
51 }; |
|
52 |
|
53 #endif |
|
54 |
|
55 |