ReactOS 0.4.15-dev-8339-g4028de8
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//
19typedef ULONG PFN_COUNT;
22
23
24typedef struct _KFLOATING_SAVE {
27
28typedef struct _KPCR_TIB {
30 PVOID StackBase; /* 04 */
31 PVOID StackLimit; /* 08 */
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
44typedef 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 */
59 ULONG StallScaleFactor; /* 4C */
61 UCHAR Number; /* 51 */
62} KPCR, *PKPCR; /* 54 */
63
64#define KeGetPcr() PCR
65
66#define YieldProcessor() __asm__ __volatile__("nop");
67
72{
74 __asm__ __volatile__ (
75 "lwz %0, %c1(12)\n"
76 : "=r" (Number)
77 : "i" (FIELD_OFFSET(KPCR, Number))
78 );
79 return Number;
80}
81
83VOID
87#define KeLowerIrql(a) KfLowerIrql(a)
88
94#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a)
95
100
102KIRQL
103NTAPI
105
106$endif
ULONG_PTR KAFFINITY
Definition: compat.h:85
UCHAR KIRQL
Definition: env_spec_w32.h:591
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment KeRaiseIrqlToDpcLevel
Definition: CrNtStubs.h:68
VOID FASTCALL KfLowerIrql(IN KIRQL NewIrql)
Definition: pic.c:232
KIRQL FASTCALL KfRaiseIrql(IN KIRQL NewIrql)
Definition: pic.c:187
#define FASTCALL
Definition: nt_native.h:50
#define _ANONYMOUS_UNION
Definition: ntbasedef.h:30
#define NTHALAPI
Definition: ntoskrnl.h:40
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:207
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID)
Definition: ke.h:341
KFLOATING_SAVE
Definition: ke.h:33
FORCEINLINE KIRQL KeRaiseIrqlToSynchLevel(VOID)
Definition: ke.h:117
$if(_WDMDDK_) typedef struct _KFLOATING_SAVE
Definition: ke.h:1
struct _KPCR KPCR
* PKFLOATING_SAVE
Definition: ke.h:33
struct _KPCR * PKPCR
$endif(_WDMDDK_) $if(_NTDDK_) typedef struct _NEON128
Definition: ke.h:202
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114
LONG SPFN_NUMBER
Definition: ke.h:10
LONG * PSPFN_NUMBER
Definition: ke.h:10
ULONG * PPFN_NUMBER
Definition: ke.h:9
ULONG PFN_NUMBER
Definition: ke.h:9
struct _KPCR_TIB KPCR_TIB
struct _KPCR_TIB * PKPCR_TIB
ULONG Dummy
Definition: ke.h:25
Definition: ke.h:28
PVOID StackLimit
Definition: ke.h:31
ULONG Version
Definition: ke.h:35
struct _KPCR_TIB * Self
Definition: ke.h:38
_ANONYMOUS_UNION union _KPCR_TIB::@4181 DUMMYUNIONNAME
PVOID ArbitraryUserPointer
Definition: ke.h:37
PVOID FiberData
Definition: ke.h:34
PVOID StackBase
Definition: ke.h:30
PVOID SubSystemTib
Definition: ke.h:32
PVOID ExceptionList
Definition: ke.h:29
Definition: ke.h:294
ULONG StallScaleFactor
Definition: ke.h:318
ULONG IDR
Definition: ke.h:23
struct _KTSS * TSS
Definition: ke.h:55
USHORT MinorVersion
Definition: ke.h:317
struct _KPRCB * Prcb
Definition: ke.h:20
ULONG IRR
Definition: ke.h:22
PUSHORT IDT
Definition: ke.h:53
ULONG IrrActive
Definition: ke.h:50
PVOID KdVersionBlock
Definition: ke.h:324
UCHAR Number
Definition: ke.h:61
USHORT MajorVersion
Definition: ke.h:316
KAFFINITY SetMember
Definition: ke.h:58
UCHAR SpareUnused
Definition: ke.h:60
KPCR_TIB Tib
Definition: ke.h:45
struct _KPCR * Self
Definition: ke.h:303
KIRQL Irql
Definition: ke.h:311
PUSHORT GDT
Definition: ke.h:54
Definition: ketypes.h:844
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NTAPI
Definition: typedefs.h:36
uint16_t * PUSHORT
Definition: typedefs.h:56
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define FORCEINLINE
Definition: wdftypes.h:67
#define _WDMDDK_
Definition: wdm.template.h:26
ULONG PFN_COUNT
Definition: mmtypes.h:102
unsigned char UCHAR
Definition: xmlstorage.h:181