ReactOS  0.4.13-dev-99-g7e18b6d
ke.h
Go to the documentation of this file.
2 
3 /* Interrupt request levels */
4 #define PASSIVE_LEVEL 0
5 #define LOW_LEVEL 0
6 #define APC_LEVEL 1
7 #define DISPATCH_LEVEL 2
8 #define PROFILE_LEVEL 27
9 #define CLOCK1_LEVEL 28
10 #define CLOCK2_LEVEL 28
11 #define IPI_LEVEL 29
12 #define POWER_LEVEL 30
13 #define HIGH_LEVEL 31
14 
15 //
16 // Used to contain PFNs and PFN counts
17 //
18 typedef ULONG PFN_COUNT;
21 
22 
23 typedef struct _KFLOATING_SAVE {
26 
27 typedef struct _KPCR_TIB {
28  PVOID ExceptionList; /* 00 */
29  PVOID StackBase; /* 04 */
30  PVOID StackLimit; /* 08 */
31  PVOID SubSystemTib; /* 0C */
32  _ANONYMOUS_UNION union {
33  PVOID FiberData; /* 10 */
34  ULONG Version; /* 10 */
37  struct _KPCR_TIB *Self; /* 18 */
38 } KPCR_TIB, *PKPCR_TIB; /* 1C */
39 
40 #define PCR_MINOR_VERSION 1
41 #define PCR_MAJOR_VERSION 1
42 
43 typedef struct _KPCR {
44  KPCR_TIB Tib; /* 00 */
45  struct _KPCR *Self; /* 1C */
46  struct _KPRCB *Prcb; /* 20 */
47  KIRQL Irql; /* 24 */
48  ULONG IRR; /* 28 */
49  ULONG IrrActive; /* 2C */
50  ULONG IDR; /* 30 */
51  PVOID KdVersionBlock; /* 34 */
52  PUSHORT IDT; /* 38 */
53  PUSHORT GDT; /* 3C */
54  struct _KTSS *TSS; /* 40 */
55  USHORT MajorVersion; /* 44 */
56  USHORT MinorVersion; /* 46 */
57  KAFFINITY SetMember; /* 48 */
58  ULONG StallScaleFactor; /* 4C */
59  UCHAR SpareUnused; /* 50 */
60  UCHAR Number; /* 51 */
61 } KPCR, *PKPCR; /* 54 */
62 
63 #define KeGetPcr() PCR
64 
65 #define YieldProcessor() __asm__ __volatile__("nop");
66 
68 ULONG
69 NTAPI
71 {
72  ULONG Number;
73  __asm__ __volatile__ (
74  "lwz %0, %c1(12)\n"
75  : "=r" (Number)
76  : "i" (FIELD_OFFSET(KPCR, Number))
77  );
78  return Number;
79 }
80 
82 VOID
85  IN KIRQL NewIrql);
86 #define KeLowerIrql(a) KfLowerIrql(a)
87 
89 KIRQL
92  IN KIRQL NewIrql);
93 #define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a)
94 
96 KIRQL
97 NTAPI
99 
100 NTHALAPI
101 KIRQL
102 NTAPI
104 
105 $endif
106 
107 
struct _KPCR * Self
Definition: ke.h:290
KIRQL Irql
Definition: ke.h:298
#define IN
Definition: typedefs.h:38
struct _KPCR_TIB KPCR_TIB
struct _KFLOATING_SAVE KFLOATING_SAVE
ULONG StallScaleFactor
Definition: ke.h:305
PVOID FiberData
Definition: ke.h:33
#define NTHALAPI
Definition: ntoskrnl.h:39
ULONG PFN_COUNT
Definition: mmtypes.h:102
struct _KFLOATING_SAVE * PKFLOATING_SAVE
#define _ANONYMOUS_UNION
Definition: ntbasedef.h:30
$if(_WDMDDK_) typedef struct _KFLOATING_SAVE
Definition: ke.h:1
FORCEINLINE KIRQL KeRaiseIrqlToSynchLevel(VOID)
Definition: ke.h:117
ULONG IDR
Definition: ke.h:22
KPCR_TIB Tib
Definition: ke.h:44
#define _WDMDDK_
Definition: wdm.template.h:26
Definition: ke.h:280
#define FASTCALL
Definition: nt_native.h:50
PVOID ExceptionList
Definition: ke.h:28
ULONG Dummy
Definition: ke.h:24
USHORT MinorVersion
Definition: ke.h:304
FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID)
Definition: ke.h:325
UCHAR KIRQL
Definition: env_spec_w32.h:591
ULONG * PPFN_NUMBER
Definition: ke.h:8
ULONG PFN_NUMBER
Definition: ke.h:8
PVOID ArbitraryUserPointer
Definition: ke.h:36
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
long LONG
Definition: pedump.c:60
NTKERNELAPI KIRQL NTAPI KfRaiseIrql(IN KIRQL NewIrql)
Definition: pic.c:187
PVOID SubSystemTib
Definition: ke.h:31
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
PVOID KdVersionBlock
Definition: ke.h:311
LONG * PSPFN_NUMBER
Definition: ke.h:9
#define FORCEINLINE
Definition: ntbasedef.h:221
Definition: ketypes.h:787
ULONG IrrActive
Definition: ke.h:49
$endif(_WDMDDK_) $if(_NTDDK_) typedef struct _NEON128
Definition: ke.h:202
USHORT MajorVersion
Definition: ke.h:303
_ANONYMOUS_UNION union _KPCR_TIB::@3764 DUMMYUNIONNAME
KAFFINITY SetMember
Definition: ke.h:57
PVOID StackBase
Definition: ke.h:29
struct _KPCR_TIB * Self
Definition: ke.h:37
LONG SPFN_NUMBER
Definition: ke.h:9
unsigned char UCHAR
Definition: xmlstorage.h:181
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:204
PUSHORT GDT
Definition: ke.h:53
struct _KTSS * TSS
Definition: ke.h:54
unsigned short USHORT
Definition: pedump.c:61
struct _KPCR_TIB * PKPCR_TIB
ULONG_PTR KAFFINITY
Definition: compat.h:75
UCHAR SpareUnused
Definition: ke.h:59
ULONG Version
Definition: ke.h:34
NTKERNELAPI VOID NTAPI KfLowerIrql(IN KIRQL NewIrql)
Definition: pic.c:232
UCHAR Number
Definition: ke.h:60
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
struct _KPCR KPCR
Definition: ke.h:27
NTKERNELAPI KIRQL NTAPI KeRaiseIrqlToDpcLevel(VOID)
Definition: pic.c:133
unsigned int ULONG
Definition: retypes.h:1
PVOID StackLimit
Definition: ke.h:30
struct _KPCR * PKPCR
PUSHORT IDT
Definition: ke.h:52
ULONG IRR
Definition: ke.h:21
unsigned short * PUSHORT
Definition: retypes.h:2
struct _KPRCB * Prcb
Definition: ke.h:19
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114