ReactOS  0.4.12-dev-918-g6c6e7b8
ke.h File Reference
#include "pshpack4.h"
#include "poppack.h"
Include dependency graph for ke.h:

Go to the source code of this file.

Classes

struct  _CONTEXT
 
struct  _KPCR
 

Macros

#define PASSIVE_LEVEL   0
 
#define LOW_LEVEL   0
 
#define APC_LEVEL   1
 
#define DISPATCH_LEVEL   2
 
#define CMCI_LEVEL   5
 
#define PROFILE_LEVEL   27
 
#define CLOCK1_LEVEL   28
 
#define CLOCK2_LEVEL   28
 
#define IPI_LEVEL   29
 
#define POWER_LEVEL   30
 
#define HIGH_LEVEL   31
 
#define CLOCK_LEVEL   CLOCK2_LEVEL
 
#define KIP0PCRADDRESS   0xffdff000
 
#define KI_USER_SHARED_DATA   0xffdf0000
 
#define SharedUserData   ((KUSER_SHARED_DATA * CONST)KI_USER_SHARED_DATA)
 
#define PAGE_SIZE   0x1000
 
#define PAGE_SHIFT   12L
 
#define KeGetDcacheFillSize()   1L
 
#define EFLAG_SIGN   0x8000
 
#define EFLAG_ZERO   0x4000
 
#define EFLAG_SELECT   (EFLAG_SIGN | EFLAG_ZERO)
 
#define RESULT_NEGATIVE   ((EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT)
 
#define RESULT_ZERO   ((~EFLAG_SIGN & EFLAG_ZERO) & EFLAG_SELECT)
 
#define RESULT_POSITIVE   ((~EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT)
 
#define YieldProcessor   _mm_pause
 
#define KeMemoryBarrierWithoutFence()   _ReadWriteBarrier()
 
#define KeLowerIrql(a)   KfLowerIrql(a)
 
#define KeRaiseIrql(a, b)   *(b) = KfRaiseIrql(a)
 
#define KeAcquireSpinLock(a, b)   *(b) = KfAcquireSpinLock(a)
 
#define KeReleaseSpinLock(a, b)   KfReleaseSpinLock(a,b)
 
#define KeAcquireSpinLockAtDpcLevel(SpinLock)   KefAcquireSpinLockAtDpcLevel(SpinLock)
 
#define KeReleaseSpinLockFromDpcLevel(SpinLock)   KefReleaseSpinLockFromDpcLevel(SpinLock)
 
#define KeFlushIoBuffers(_Mdl, _ReadOperation, _DmaOperation)
 
#define DbgRaiseAssertionFailure   __int2c
 
#define KeQueryTickCount(CurrentCount)   _KeQueryTickCount(CurrentCount)
 
#define PAUSE_PROCESSOR   YieldProcessor();
 
#define KERNEL_STACK_SIZE   12288
 
#define KERNEL_LARGE_STACK_SIZE   61440
 
#define KERNEL_LARGE_STACK_COMMIT   12288
 
#define SIZE_OF_80387_REGISTERS   80
 
#define CONTEXT_i386   0x10000
 
#define CONTEXT_i486   0x10000
 
#define CONTEXT_CONTROL   (CONTEXT_i386|0x00000001L)
 
#define CONTEXT_INTEGER   (CONTEXT_i386|0x00000002L)
 
#define CONTEXT_SEGMENTS   (CONTEXT_i386|0x00000004L)
 
#define CONTEXT_FLOATING_POINT   (CONTEXT_i386|0x00000008L)
 
#define CONTEXT_DEBUG_REGISTERS   (CONTEXT_i386|0x00000010L)
 
#define CONTEXT_EXTENDED_REGISTERS   (CONTEXT_i386|0x00000020L)
 
#define CONTEXT_FULL   (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
 
#define CONTEXT_ALL
 
#define CONTEXT_XSTATE   (CONTEXT_i386 | 0x00000040L)
 
#define KeGetPcr()   PCR
 
#define PCR_MINOR_VERSION   1
 
#define PCR_MAJOR_VERSION   1
 

Typedefs

typedef struct _CONTEXT CONTEXT
 
typedef struct _KPCR KPCR
 
typedef struct _KPCRPKPCR
 

Functions

 $if (_WDMDDK_) typedef struct _KFLOATING_SAVE
 
FORCEINLINE VOID KeMemoryBarrier (VOID)
 
 _IRQL_requires_max_ (HIGH_LEVEL) _IRQL_saves_ NTHALAPI KIRQL NTAPI KeGetCurrentIrql(VOID)
 
 _IRQL_requires_max_ (DISPATCH_LEVEL) _IRQL_saves_ _IRQL_raises_(DISPATCH_LEVEL) NTHALAPI KIRQL NTAPI KeRaiseIrqlToDpcLevel(VOID)
 
NTHALAPI KIRQL NTAPI KeRaiseIrqlToSynchLevel (VOID)
 
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _IRQL_requires_ (DISPATCH_LEVEL) NTHALAPI VOID FASTCALL KfReleaseSpinLock(_Inout_ PKSPIN_LOCK SpinLock
 
_Requires_lock_not_held_ SpinLock _Acquires_lock_ SpinLock _IRQL_requires_min_ (DISPATCH_LEVEL) NTKERNELAPI VOID FASTCALL KefAcquireSpinLockAtDpcLevel(_Inout_ PKSPIN_LOCK SpinLock)
 
NTSYSAPI PKTHREAD NTAPI KeGetCurrentThread (VOID)
 
 _Always_ (_Post_satisfies_(return<=0)) _Must_inspect_result_ _IRQL_requires_max_(DISPATCH_LEVEL) _Kernel_float_saved_ _At_(*FloatSave
 
 _Kernel_requires_resource_not_held_ (FloatState) _Kernel_acquires_resource_(FloatState)) NTKERNELAPI NTSTATUS NTAPI KeSaveFloatingPointState(_Out_ PKFLOATING_SAVE FloatSave)
 
 _Success_ (1) _Kernel_float_restored_ _At_(*FloatSave
 
 _Kernel_requires_resource_held_ (FloatState) _Kernel_releases_resource_(FloatState)) NTKERNELAPI NTSTATUS NTAPI KeRestoreFloatingPointState(_In_ PKFLOATING_SAVE FloatSave)
 
FORCEINLINE VOID _KeQueryTickCount (OUT PLARGE_INTEGER CurrentCount)
 
 $endif (_WDMDDK_) $if(_NTDDK_) typedef struct _FLOATING_SAVE_AREA
 
FORCEINLINE ULONG KeGetCurrentProcessorNumber (VOID)
 

Variables

 KFLOATING_SAVE
 
PKFLOATING_SAVE
 
NTKERNELAPI volatile KSYSTEM_TIME KeTickCount
 
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
 
 FLOATING_SAVE_AREA
 
PFLOATING_SAVE_AREA
 

Macro Definition Documentation

◆ APC_LEVEL

#define APC_LEVEL   1

◆ CLOCK1_LEVEL

#define CLOCK1_LEVEL   28

◆ CLOCK2_LEVEL

#define CLOCK2_LEVEL   28

◆ CLOCK_LEVEL

#define CLOCK_LEVEL   CLOCK2_LEVEL

◆ CMCI_LEVEL

#define CMCI_LEVEL   5

◆ CONTEXT_ALL

#define CONTEXT_ALL
Value:
CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | \
CONTEXT_EXTENDED_REGISTERS)
#define CONTEXT_INTEGER
#define CONTEXT_SEGMENTS
#define CONTEXT_CONTROL
#define CONTEXT_DEBUG_REGISTERS

◆ CONTEXT_CONTROL

#define CONTEXT_CONTROL   (CONTEXT_i386|0x00000001L)

◆ CONTEXT_DEBUG_REGISTERS

#define CONTEXT_DEBUG_REGISTERS   (CONTEXT_i386|0x00000010L)

◆ CONTEXT_EXTENDED_REGISTERS

#define CONTEXT_EXTENDED_REGISTERS   (CONTEXT_i386|0x00000020L)

◆ CONTEXT_FLOATING_POINT

#define CONTEXT_FLOATING_POINT   (CONTEXT_i386|0x00000008L)

◆ CONTEXT_FULL

◆ CONTEXT_i386

#define CONTEXT_i386   0x10000

◆ CONTEXT_i486

#define CONTEXT_i486   0x10000

◆ CONTEXT_INTEGER

#define CONTEXT_INTEGER   (CONTEXT_i386|0x00000002L)

◆ CONTEXT_SEGMENTS

#define CONTEXT_SEGMENTS   (CONTEXT_i386|0x00000004L)

◆ CONTEXT_XSTATE

#define CONTEXT_XSTATE   (CONTEXT_i386 | 0x00000040L)

◆ DbgRaiseAssertionFailure

#define DbgRaiseAssertionFailure   __int2c

Definition at line 181 of file ke.h.

◆ DISPATCH_LEVEL

#define DISPATCH_LEVEL   2

◆ EFLAG_SELECT

#define EFLAG_SELECT   (EFLAG_SIGN | EFLAG_ZERO)

◆ EFLAG_SIGN

#define EFLAG_SIGN   0x8000

◆ EFLAG_ZERO

#define EFLAG_ZERO   0x4000

◆ HIGH_LEVEL

#define HIGH_LEVEL   31

◆ IPI_LEVEL

#define IPI_LEVEL   29

◆ KeAcquireSpinLock

#define KeAcquireSpinLock (   a,
  b 
)    *(b) = KfAcquireSpinLock(a)

Definition at line 114 of file ke.h.

◆ KeAcquireSpinLockAtDpcLevel

#define KeAcquireSpinLockAtDpcLevel (   SpinLock)    KefAcquireSpinLockAtDpcLevel(SpinLock)

Definition at line 135 of file ke.h.

◆ KeFlushIoBuffers

#define KeFlushIoBuffers (   _Mdl,
  _ReadOperation,
  _DmaOperation 
)

Definition at line 178 of file ke.h.

◆ KeGetDcacheFillSize

#define KeGetDcacheFillSize ( )    1L

◆ KeGetPcr

#define KeGetPcr ( )    PCR

Definition at line 276 of file ke.h.

◆ KeLowerIrql

#define KeLowerIrql (   a)    KfLowerIrql(a)

Definition at line 79 of file ke.h.

◆ KeMemoryBarrierWithoutFence

#define KeMemoryBarrierWithoutFence ( )    _ReadWriteBarrier()

Definition at line 64 of file ke.h.

◆ KeQueryTickCount

#define KeQueryTickCount (   CurrentCount)    _KeQueryTickCount(CurrentCount)

Definition at line 201 of file ke.h.

◆ KeRaiseIrql

#define KeRaiseIrql (   a,
  b 
)    *(b) = KfRaiseIrql(a)

Definition at line 89 of file ke.h.

◆ KeReleaseSpinLock

#define KeReleaseSpinLock (   a,
  b 
)    KfReleaseSpinLock(a,b)

Definition at line 125 of file ke.h.

◆ KeReleaseSpinLockFromDpcLevel

#define KeReleaseSpinLockFromDpcLevel (   SpinLock)    KefReleaseSpinLockFromDpcLevel(SpinLock)

Definition at line 145 of file ke.h.

◆ KERNEL_LARGE_STACK_COMMIT

#define KERNEL_LARGE_STACK_COMMIT   12288

◆ KERNEL_LARGE_STACK_SIZE

#define KERNEL_LARGE_STACK_SIZE   61440

◆ KERNEL_STACK_SIZE

#define KERNEL_STACK_SIZE   12288

◆ KI_USER_SHARED_DATA

#define KI_USER_SHARED_DATA   0xffdf0000

◆ KIP0PCRADDRESS

#define KIP0PCRADDRESS   0xffdff000

◆ LOW_LEVEL

#define LOW_LEVEL   0

◆ PAGE_SHIFT

#define PAGE_SHIFT   12L

◆ PAGE_SIZE

#define PAGE_SIZE   0x1000

◆ PASSIVE_LEVEL

#define PASSIVE_LEVEL   0

◆ PAUSE_PROCESSOR

#define PAUSE_PROCESSOR   YieldProcessor();

◆ PCR_MAJOR_VERSION

#define PCR_MAJOR_VERSION   1

Definition at line 279 of file ke.h.

◆ PCR_MINOR_VERSION

#define PCR_MINOR_VERSION   1

Definition at line 278 of file ke.h.

◆ POWER_LEVEL

#define POWER_LEVEL   30

◆ PROFILE_LEVEL

#define PROFILE_LEVEL   27

◆ RESULT_NEGATIVE

#define RESULT_NEGATIVE   ((EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT)

◆ RESULT_POSITIVE

#define RESULT_POSITIVE   ((~EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT)

◆ RESULT_ZERO

#define RESULT_ZERO   ((~EFLAG_SIGN & EFLAG_ZERO) & EFLAG_SELECT)

◆ SharedUserData

◆ SIZE_OF_80387_REGISTERS

#define SIZE_OF_80387_REGISTERS   80

◆ YieldProcessor

#define YieldProcessor   _mm_pause

Definition at line 48 of file ke.h.

Typedef Documentation

◆ CONTEXT

◆ KPCR

typedef struct _KPCR KPCR

◆ PKPCR

typedef struct _KPCR * PKPCR

Function Documentation

◆ $endif()

$endif ( _WDMDDK_  )

Definition at line 203 of file ke.h.

234  {
235  ULONG ControlWord;
236  ULONG StatusWord;
237  ULONG TagWord;
238  ULONG ErrorOffset;
239  ULONG ErrorSelector;
240  ULONG DataOffset;
241  ULONG DataSelector;
242  UCHAR RegisterArea[SIZE_OF_80387_REGISTERS];
243  ULONG Cr0NpxState;
* PFLOATING_SAVE_AREA
Definition: ke.h:244
unsigned char UCHAR
Definition: xmlstorage.h:181
unsigned int ULONG
Definition: retypes.h:1
FLOATING_SAVE_AREA
Definition: ke.h:244
#define SIZE_OF_80387_REGISTERS

◆ $if()

$if ( _WDMDDK_  )

Kernel definitions for x86

Definition at line 1 of file ke.h.

35  {
36  ULONG ControlWord;
37  ULONG StatusWord;
38  ULONG ErrorOffset;
39  ULONG ErrorSelector;
40  ULONG DataOffset;
41  ULONG DataSelector;
42  ULONG Cr0NpxState;
43  ULONG Spare1;
struct _KFLOATING_SAVE KFLOATING_SAVE
struct _KFLOATING_SAVE * PKFLOATING_SAVE
unsigned int ULONG
Definition: retypes.h:1

Referenced by $endif().

◆ _Always_()

_Always_ ( _Post_satisfies_(return<=0)  )

◆ _IRQL_requires_()

Definition at line 1456 of file expool.c.

1461 {
1462  ULONG OldSize = PoolBigPageTableSize;
1463  ULONG NewSize = 2 * OldSize;
1464  ULONG NewSizeInBytes;
1465  PPOOL_TRACKER_BIG_PAGES NewTable;
1466  PPOOL_TRACKER_BIG_PAGES OldTable;
1467  ULONG i;
1468  ULONG PagesFreed;
1469  ULONG Hash;
1470  ULONG HashMask;
1471 
1472  /* Must be holding ExpLargePoolTableLock */
1474 
1475  /* Make sure we don't overflow */
1476  if (!NT_SUCCESS(RtlULongMult(2,
1477  OldSize * sizeof(POOL_TRACKER_BIG_PAGES),
1478  &NewSizeInBytes)))
1479  {
1480  DPRINT1("Overflow expanding big page table. Size=%lu\n", OldSize);
1482  return FALSE;
1483  }
1484 
1485  NewTable = MiAllocatePoolPages(NonPagedPool, NewSizeInBytes);
1486  if (NewTable == NULL)
1487  {
1488  DPRINT1("Could not allocate %lu bytes for new big page table\n", NewSizeInBytes);
1490  return FALSE;
1491  }
1492 
1493  DPRINT("Expanding big pool tracker table to %lu entries\n", NewSize);
1494 
1495  /* Initialize the new table */
1496  RtlZeroMemory(NewTable, NewSizeInBytes);
1497  for (i = 0; i < NewSize; i++)
1498  {
1499  NewTable[i].Va = (PVOID)POOL_BIG_TABLE_ENTRY_FREE;
1500  }
1501 
1502  /* Copy over all items */
1503  OldTable = PoolBigPageTable;
1504  HashMask = NewSize - 1;
1505  for (i = 0; i < OldSize; i++)
1506  {
1507  /* Skip over empty items */
1508  if ((ULONG_PTR)OldTable[i].Va & POOL_BIG_TABLE_ENTRY_FREE)
1509  {
1510  continue;
1511  }
1512 
1513  /* Recalculate the hash due to the new table size */
1514  Hash = ExpComputePartialHashForAddress(OldTable[i].Va) & HashMask;
1515 
1516  /* Find the location in the new table */
1517  while (!((ULONG_PTR)NewTable[Hash].Va & POOL_BIG_TABLE_ENTRY_FREE))
1518  {
1519  Hash = (Hash + 1) & HashMask;
1520  }
1521 
1522  /* We just enlarged the table, so we must have space */
1524 
1525  /* Finally, copy the item */
1526  NewTable[Hash] = OldTable[i];
1527  }
1528 
1529  /* Activate the new table */
1530  PoolBigPageTable = NewTable;
1533 
1534  /* Release the lock, we're done changing global state */
1536 
1537  /* Free the old table and update our tracker */
1538  PagesFreed = MiFreePoolPages(OldTable);
1539  ExpRemovePoolTracker('looP', PagesFreed << PAGE_SHIFT, 0);
1540  ExpInsertPoolTracker('looP', ALIGN_UP_BY(NewSizeInBytes, PAGE_SIZE), 0);
1541 
1542  return TRUE;
1543 }
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
static int Hash(const char *)
Definition: reader.c:2257
#define PAGE_SHIFT
Definition: env_spec_w32.h:45
#define TRUE
Definition: types.h:120
uint32_t ULONG_PTR
Definition: typedefs.h:63
KSPIN_LOCK ExpLargePoolTableLock
Definition: expool.c:46
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
SIZE_T PoolBigPageTableSize
Definition: expool.c:39
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
void * PVOID
Definition: retypes.h:9
VOID NTAPI ExpRemovePoolTracker(IN ULONG Key, IN SIZE_T NumberOfBytes, IN POOL_TYPE PoolType)
Definition: expool.c:756
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
PVOID NTAPI MiAllocatePoolPages(IN POOL_TYPE PoolType, IN SIZE_T SizeInBytes)
Definition: pool.c:420
ULONG NTAPI MiFreePoolPages(IN PVOID StartingAddress)
Definition: pool.c:905
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
_Must_inspect_result_ _In_ USHORT NewSize
Definition: fltkernel.h:975
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
VOID NTAPI ExpInsertPoolTracker(IN ULONG Key, IN SIZE_T NumberOfBytes, IN POOL_TYPE PoolType)
Definition: expool.c:847
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
FORCEINLINE ULONG ExpComputePartialHashForAddress(IN PVOID BaseAddress)
Definition: expool.c:449
#define DPRINT1
Definition: precomp.h:8
PPOOL_TRACKER_BIG_PAGES PoolBigPageTable
Definition: expool.c:42
SIZE_T PoolBigPageTableHash
Definition: expool.c:39
#define POOL_BIG_TABLE_ENTRY_FREE
Definition: expool.c:23
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ALIGN_UP_BY(size, align)

◆ _IRQL_requires_max_() [1/2]

_IRQL_requires_max_ ( HIGH_LEVEL  )

Definition at line 68 of file ke.h.

73 {
74  return (KIRQL)__readcr8();
75 }
__INTRIN_INLINE unsigned long __readcr8(void)
Definition: intrin_x86.h:1726
UCHAR KIRQL
Definition: env_spec_w32.h:591

◆ _IRQL_requires_max_() [2/2]

_IRQL_requires_max_ ( DISPATCH_LEVEL  )

Definition at line 30 of file rmap.c.

36 {
38 }
#define TAG_RMAP
Definition: tag.h:133
#define P(row, col)
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

◆ _IRQL_requires_min_()

◆ _KeQueryTickCount()

FORCEINLINE VOID _KeQueryTickCount ( OUT PLARGE_INTEGER  CurrentCount)

Definition at line 185 of file ke.h.

187 {
188  for (;;) {
189 #ifdef NONAMELESSUNION
190  CurrentCount->s.HighPart = KeTickCount.High1Time;
191  CurrentCount->s.LowPart = KeTickCount.LowPart;
192  if (CurrentCount->s.HighPart == KeTickCount.High2Time) break;
193 #else
194  CurrentCount->HighPart = KeTickCount.High1Time;
195  CurrentCount->LowPart = KeTickCount.LowPart;
196  if (CurrentCount->HighPart == KeTickCount.High2Time) break;
197 #endif
198  YieldProcessor();
199  }
200 }
ULONG LowPart
Definition: ketypes.h:910
#define YieldProcessor
Definition: ke.h:48
LONG High1Time
Definition: ketypes.h:911
NTKERNELAPI volatile KSYSTEM_TIME KeTickCount
Definition: clock.c:19
LONG High2Time
Definition: ketypes.h:912

◆ _Kernel_requires_resource_held_()

_Kernel_requires_resource_held_ ( FloatState  )

Definition at line 145 of file ke.h.

150 {
151  UNREFERENCED_PARAMETER(FloatSave);
152  return STATUS_SUCCESS;
153 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
return STATUS_SUCCESS
Definition: btrfs.c:2725

◆ _Kernel_requires_resource_not_held_()

_Kernel_requires_resource_not_held_ ( FloatState  )

Definition at line 133 of file ke.h.

138 {
139  UNREFERENCED_PARAMETER(FloatSave);
140  return STATUS_SUCCESS;
141 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
return STATUS_SUCCESS
Definition: btrfs.c:2725

◆ _Success_()

_Success_ ( )

◆ KeGetCurrentProcessorNumber()

FORCEINLINE ULONG KeGetCurrentProcessorNumber ( VOID  )

Definition at line 320 of file ke.h.

321 {
323 }
Definition: ke.h:280
PPC_QUAL unsigned char __readfsbyte(const unsigned long Offset)
Definition: intrin_ppc.h:360
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:204
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int ULONG
Definition: retypes.h:1

◆ KeGetCurrentThread()

NTSYSAPI PKTHREAD NTAPI KeGetCurrentThread ( VOID  )

Definition at line 284 of file ke.h.

285 {
286  /* Return the current thread */
287  return ((PKIPCR)KeGetPcr())->PrcbData.CurrentThread;
288 }
FORCEINLINE PKPCR KeGetPcr(VOID)
Definition: ke.h:318

Referenced by KeFreezeAllThreads(), KeRevertToUserAffinityThread(), KeRundownThread(), KeSetKernelStackSwapEnable(), KeSetSystemAffinityThread(), KeTerminateThread(), KeTestAlertThread(), KeThawAllThreads(), KiCheckForApcDelivery(), KiGetUserModeStackAddress(), and KiSuspendThread().

◆ KeMemoryBarrier()

FORCEINLINE VOID KeMemoryBarrier ( VOID  )

Definition at line 52 of file ke.h.

53 {
54  LONG Barrier, *Dummy = &Barrier;
56 
57 #if defined(__GNUC__)
58  __asm__ __volatile__ ("xchg %%eax, %0" : : "m" (Barrier) : "%eax");
59 #elif defined(_MSC_VER)
60  __asm xchg [Barrier], eax
61 #endif
62 }
#define UNREFERENCED_LOCAL_VARIABLE(L)
Definition: ntbasedef.h:324
long LONG
Definition: pedump.c:60
__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")
ecx edi ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl eax
Definition: synth_sse3d.h:85

◆ KeRaiseIrqlToSynchLevel()

NTHALAPI KIRQL NTAPI KeRaiseIrqlToSynchLevel ( VOID  )

Definition at line 156 of file pic.c.

157 {
158  PKPCR Pcr = KeGetPcr();
159  KIRQL CurrentIrql;
160 
161  /* Save and update IRQL */
162  CurrentIrql = Pcr->Irql;
163  Pcr->Irql = SYNCH_LEVEL;
164 
165 #ifdef IRQL_DEBUG
166  /* Validate correct raise */
167  if (CurrentIrql > SYNCH_LEVEL)
168  {
169  /* Crash system */
170  KeBugCheckEx(IRQL_NOT_GREATER_OR_EQUAL,
171  CurrentIrql,
172  SYNCH_LEVEL,
173  0,
174  1);
175  }
176 #endif
177 
178  /* Return the previous value */
179  return CurrentIrql;
180 }
KIRQL Irql
Definition: ke.h:298
Definition: ke.h:280
#define KeGetPcr()
Definition: ke.h:25
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define SYNCH_LEVEL
Definition: env_spec_w32.h:704
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:107

Referenced by KeDelayExecutionThread(), KeFlushEntireTb(), KeQueryBasePriorityThread(), KeRemoveQueue(), KeSignalGateBoostPriority(), KeWaitForMultipleObjects(), KeWaitForSingleObject(), KiQuantumEnd(), KiRetireDpcList(), and NtYieldExecution().

Variable Documentation

◆ FLOATING_SAVE_AREA

Definition at line 244 of file ke.h.

◆ KeTickCount

Definition at line 19 of file clock.c.

Referenced by KeQueryTickCount().

◆ KFLOATING_SAVE

Definition at line 44 of file ke.h.

◆ NewIrql

◆ PFLOATING_SAVE_AREA

Definition at line 244 of file ke.h.

◆ PKFLOATING_SAVE

Definition at line 44 of file ke.h.