ReactOS  0.4.15-dev-2720-g5ee0925
ke.h
Go to the documentation of this file.
4 /* Interrupt request levels */
5 #define PASSIVE_LEVEL 0
6 #define LOW_LEVEL 0
7 #define APC_LEVEL 1
8 #define DISPATCH_LEVEL 2
9 #define PROFILE_LEVEL 27
10 #define CLOCK1_LEVEL 28
11 #define CLOCK2_LEVEL 28
12 #define IPI_LEVEL 29
13 #define POWER_LEVEL 30
14 #define HIGH_LEVEL 31
15 
16 //
17 // Used to contain PFNs and PFN counts
18 //
19 typedef ULONG PFN_COUNT;
22 
23 
24 typedef struct _KFLOATING_SAVE {
27 
28 typedef struct _KPCR_TIB {
29  PVOID ExceptionList; /* 00 */
30  PVOID StackBase; /* 04 */
31  PVOID StackLimit; /* 08 */
32  PVOID SubSystemTib; /* 0C */
33  _ANONYMOUS_UNION union {
34  PVOID FiberData; /* 10 */
35  ULONG Version; /* 10 */
38  struct _KPCR_TIB *Self; /* 18 */
39 } KPCR_TIB, *PKPCR_TIB; /* 1C */
40 
41 #define PCR_MINOR_VERSION 1
42 #define PCR_MAJOR_VERSION 1
43 
44 typedef struct _KPCR {
45  KPCR_TIB Tib; /* 00 */
46  struct _KPCR *Self; /* 1C */
47  struct _KPRCB *Prcb; /* 20 */
48  KIRQL Irql; /* 24 */
49  ULONG IRR; /* 28 */
50  ULONG IrrActive; /* 2C */
51  ULONG IDR; /* 30 */
52  PVOID KdVersionBlock; /* 34 */
53  PUSHORT IDT; /* 38 */
54  PUSHORT GDT; /* 3C */
55  struct _KTSS *TSS; /* 40 */
56  USHORT MajorVersion; /* 44 */
57  USHORT MinorVersion; /* 46 */
58  KAFFINITY SetMember; /* 48 */
59  ULONG StallScaleFactor; /* 4C */
60  UCHAR SpareUnused; /* 50 */
61  UCHAR Number; /* 51 */
62 } KPCR, *PKPCR; /* 54 */
63 
64 #define KeGetPcr() PCR
65 
66 #define YieldProcessor() __asm__ __volatile__("nop");
67 
69 ULONG
70 NTAPI
72 {
73  ULONG Number;
74  __asm__ __volatile__ (
75  "lwz %0, %c1(12)\n"
76  : "=r" (Number)
77  : "i" (FIELD_OFFSET(KPCR, Number))
78  );
79  return Number;
80 }
81 
83 VOID
86  IN KIRQL NewIrql);
87 #define KeLowerIrql(a) KfLowerIrql(a)
88 
90 KIRQL
93  IN KIRQL NewIrql);
94 #define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a)
95 
97 KIRQL
98 NTAPI
100 
101 NTHALAPI
102 KIRQL
103 NTAPI
105 
106 $endif
struct _KPCR * Self
Definition: ke.h:299
KIRQL Irql
Definition: ke.h:307
#define IN
Definition: typedefs.h:39
struct _KPCR_TIB KPCR_TIB
struct _KFLOATING_SAVE KFLOATING_SAVE
ULONG StallScaleFactor
Definition: ke.h:314
PVOID FiberData
Definition: ke.h:34
#define NTHALAPI
Definition: ntoskrnl.h:40
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:23
KPCR_TIB Tib
Definition: ke.h:45
#define _WDMDDK_
Definition: wdm.template.h:26
Definition: ke.h:289
#define FASTCALL
Definition: nt_native.h:50
PVOID ExceptionList
Definition: ke.h:29
ULONG Dummy
Definition: ke.h:25
USHORT MinorVersion
Definition: ke.h:313
FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID)
Definition: ke.h:337
UCHAR KIRQL
Definition: env_spec_w32.h:591
ULONG * PPFN_NUMBER
Definition: ke.h:9
ULONG PFN_NUMBER
Definition: ke.h:9
PVOID ArbitraryUserPointer
Definition: ke.h:37
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:32
__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:320
LONG * PSPFN_NUMBER
Definition: ke.h:10
Definition: ketypes.h:789
ULONG IrrActive
Definition: ke.h:50
$endif(_WDMDDK_) $if(_NTDDK_) typedef struct _NEON128
Definition: ke.h:202
USHORT MajorVersion
Definition: ke.h:312
KAFFINITY SetMember
Definition: ke.h:58
PVOID StackBase
Definition: ke.h:30
struct _KPCR_TIB * Self
Definition: ke.h:38
LONG SPFN_NUMBER
Definition: ke.h:10
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:54
struct _KTSS * TSS
Definition: ke.h:55
unsigned short USHORT
Definition: pedump.c:61
struct _KPCR_TIB * PKPCR_TIB
ULONG_PTR KAFFINITY
Definition: compat.h:85
UCHAR SpareUnused
Definition: ke.h:60
ULONG Version
Definition: ke.h:35
NTKERNELAPI VOID NTAPI KfLowerIrql(IN KIRQL NewIrql)
Definition: pic.c:232
UCHAR Number
Definition: ke.h:61
#define FORCEINLINE
Definition: wdftypes.h:67
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
struct _KPCR KPCR
Definition: ke.h:28
NTKERNELAPI KIRQL NTAPI KeRaiseIrqlToDpcLevel(VOID)
Definition: pic.c:133
unsigned int ULONG
Definition: retypes.h:1
PVOID StackLimit
Definition: ke.h:31
struct _KPCR * PKPCR
_ANONYMOUS_UNION union _KPCR_TIB::@3950 DUMMYUNIONNAME
PUSHORT IDT
Definition: ke.h:53
ULONG IRR
Definition: ke.h:22
unsigned short * PUSHORT
Definition: retypes.h:2
struct _KPRCB * Prcb
Definition: ke.h:20
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114