ReactOS  0.4.14-dev-1034-g1e60116
irql.c File Reference
#include <hal.h>
#include <debug.h>
Include dependency graph for irql.c:

Go to the source code of this file.

Classes

union  PIC_MASK
 

Macros

#define NDEBUG
 
#define DIRQL_TO_IRQ(x)   (PROFILE_LEVEL - x)
 
#define IRQ_TO_DIRQL(x)   (PROFILE_LEVEL - x)
 

Functions

VOID NTAPI KiInterruptDispatch2 (ULONG Irq, KIRQL old_level)
 
KIRQL NTAPI KeGetCurrentIrql (VOID)
 
VOID NTAPI HalpInitPICs (VOID)
 
VOID HalpEndSystemInterrupt (KIRQL Irql)
 
VOID HalpExecuteIrqs (KIRQL NewIrql)
 
VOID HalpLowerIrql (KIRQL NewIrql)
 
VOID FASTCALL KfLowerIrql (KIRQL NewIrql)
 
KIRQL FASTCALL KfRaiseIrql (KIRQL NewIrql)
 
KIRQL NTAPI KeRaiseIrqlToDpcLevel (VOID)
 
KIRQL NTAPI KeRaiseIrqlToSynchLevel (VOID)
 
BOOLEAN NTAPI HalBeginSystemInterrupt (KIRQL Irql, ULONG Vector, PKIRQL OldIrql)
 
VOID NTAPI HalEndSystemInterrupt (KIRQL Irql, ULONG Unknown2)
 
VOID NTAPI HalDisableSystemInterrupt (ULONG Vector, KIRQL Irql)
 
BOOLEAN NTAPI HalEnableSystemInterrupt (ULONG Vector, KIRQL Irql, KINTERRUPT_MODE InterruptMode)
 
VOID FASTCALL HalRequestSoftwareInterrupt (IN KIRQL Request)
 
VOID FASTCALL HalClearSoftwareInterrupt (IN KIRQL Request)
 

Variables

static PIC_MASK pic_mask = { 0xFFFA }
 
static PIC_MASK pic_mask_intr = { 0 }
 
static ULONG HalpPendingInterruptCount [NR_IRQS]
 

Macro Definition Documentation

◆ DIRQL_TO_IRQ

#define DIRQL_TO_IRQ (   x)    (PROFILE_LEVEL - x)

Definition at line 54 of file irql.c.

◆ IRQ_TO_DIRQL

#define IRQ_TO_DIRQL (   x)    (PROFILE_LEVEL - x)

Definition at line 55 of file irql.c.

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file irql.c.

Function Documentation

◆ HalBeginSystemInterrupt()

BOOLEAN NTAPI HalBeginSystemInterrupt ( KIRQL  Irql,
ULONG  Vector,
PKIRQL  OldIrql 
)

Definition at line 311 of file irql.c.

314 {
315  ULONG irq;
317  {
318  return(FALSE);
319  }
320  irq = Vector - IRQ_BASE;
321  pic_mask_intr.both |= ((1 << irq) & 0xfffe); // do not disable the timer interrupt
322 
323  if (irq < 8)
324  {
326  WRITE_PORT_UCHAR((PUCHAR)0x20, 0x20);
327  }
328  else
329  {
331  /* Send EOI to the PICs */
332  WRITE_PORT_UCHAR((PUCHAR)0x20,0x20);
333  WRITE_PORT_UCHAR((PUCHAR)0xa0,0x20);
334  }
335 #if 0
336  if (KeGetPcr()->Irql >= Irql)
337  {
339  return(FALSE);
340  }
341 #endif
342  *OldIrql = KeGetPcr()->Irql;
343  KeGetPcr()->Irql = Irql;
344 
345  return(TRUE);
346 }
#define TRUE
Definition: types.h:120
#define IRQ_BASE
Definition: halirq.h:22
unsigned char * PUCHAR
Definition: retypes.h:3
_Out_ PKIRQL Irql
Definition: csq.h:179
unsigned char irq
Definition: dsp.h:13
#define KeGetPcr()
Definition: ke.h:25
static ULONG HalpPendingInterruptCount[NR_IRQS]
Definition: irql.c:52
USHORT both
Definition: irql.c:23
static PIC_MASK pic_mask
Definition: irql.c:39
unsigned char UCHAR
Definition: xmlstorage.h:181
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
UCHAR slave
Definition: irql.c:27
#define NR_IRQS
Definition: halirq.h:23
UCHAR master
Definition: irql.c:26
unsigned int ULONG
Definition: retypes.h:1
static PIC_MASK pic_mask_intr
Definition: irql.c:49
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532

◆ HalClearSoftwareInterrupt()

VOID FASTCALL HalClearSoftwareInterrupt ( IN KIRQL  Request)

Definition at line 434 of file irql.c.

436 {
437  switch (Request)
438  {
439  case APC_LEVEL:
440  ((PKIPCR)KeGetPcr())->HalReserved[HAL_APC_REQUEST] = FALSE;
441  break;
442 
443  case DISPATCH_LEVEL:
444  ((PKIPCR)KeGetPcr())->HalReserved[HAL_DPC_REQUEST] = FALSE;
445  break;
446 
447  default:
448  DbgBreakPoint();
449  }
450 }
struct _KIPCR * PKIPCR
void DbgBreakPoint()
Definition: mach.c:553
#define KeGetPcr()
Definition: ke.h:25
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
#define HAL_APC_REQUEST
Definition: halp.h:10
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define HAL_DPC_REQUEST
Definition: halp.h:11
#define APC_LEVEL
Definition: env_spec_w32.h:695

◆ HalDisableSystemInterrupt()

VOID NTAPI HalDisableSystemInterrupt ( ULONG  Vector,
KIRQL  Irql 
)

Definition at line 360 of file irql.c.

363 {
364  ULONG irq;
365 
367  {
368  ASSERT(FALSE);
369  return;
370  }
371 
372  irq = Vector - IRQ_BASE;
373  pic_mask.both |= (1 << irq);
374  if (irq < 8)
375  {
377  }
378  else
379  {
381  }
382 
383  return;
384 }
#define IRQ_BASE
Definition: halirq.h:22
unsigned char * PUCHAR
Definition: retypes.h:3
unsigned char irq
Definition: dsp.h:13
USHORT both
Definition: irql.c:23
static PIC_MASK pic_mask
Definition: irql.c:39
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned char UCHAR
Definition: xmlstorage.h:181
UCHAR slave
Definition: irql.c:27
#define NR_IRQS
Definition: halirq.h:23
UCHAR master
Definition: irql.c:26
unsigned int ULONG
Definition: retypes.h:1
static PIC_MASK pic_mask_intr
Definition: irql.c:49
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532

◆ HalEnableSystemInterrupt()

BOOLEAN NTAPI HalEnableSystemInterrupt ( ULONG  Vector,
KIRQL  Irql,
KINTERRUPT_MODE  InterruptMode 
)

Definition at line 389 of file irql.c.

393 {
394  ULONG irq;
395 
397  return FALSE;
398 
399  irq = Vector - IRQ_BASE;
400  pic_mask.both &= ~(1 << irq);
401  if (irq < 8)
402  {
404  }
405  else
406  {
408  }
409 
410  return TRUE;
411 }
#define TRUE
Definition: types.h:120
#define IRQ_BASE
Definition: halirq.h:22
unsigned char * PUCHAR
Definition: retypes.h:3
unsigned char irq
Definition: dsp.h:13
USHORT both
Definition: irql.c:23
static PIC_MASK pic_mask
Definition: irql.c:39
unsigned char UCHAR
Definition: xmlstorage.h:181
UCHAR slave
Definition: irql.c:27
#define NR_IRQS
Definition: halirq.h:23
UCHAR master
Definition: irql.c:26
unsigned int ULONG
Definition: retypes.h:1
static PIC_MASK pic_mask_intr
Definition: irql.c:49
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532

◆ HalEndSystemInterrupt()

VOID NTAPI HalEndSystemInterrupt ( KIRQL  Irql,
ULONG  Unknown2 
)

Definition at line 349 of file irql.c.

353 {
356 }
_Out_ PKIRQL Irql
Definition: csq.h:179
VOID HalpLowerIrql(KIRQL NewIrql)
Definition: irql.c:161
VOID HalpEndSystemInterrupt(KIRQL Irql)
Definition: irql.c:105

◆ HalpEndSystemInterrupt()

VOID HalpEndSystemInterrupt ( KIRQL  Irql)

Definition at line 105 of file irql.c.

109 {
110  const USHORT mask[] =
111  {
112  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
113  0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0xc000, 0xe000, 0xf000,
114  0xf800, 0xfc00, 0xfe00, 0xff00, 0xff80, 0xffc0, 0xffe0, 0xfff0,
115  0xfff8, 0xfffc, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
116  };
117 
118  /* Interrupts should be disable while enabling irqs of both pics */
119  _disable();
120 
124 
125  /* restore ints */
126  _enable();
127 }
unsigned char * PUCHAR
Definition: retypes.h:3
void __cdecl _enable(void)
Definition: intrin_arm.h:373
_Out_ PKIRQL Irql
Definition: csq.h:179
GLenum GLint GLuint mask
Definition: glext.h:6028
USHORT both
Definition: irql.c:23
static PIC_MASK pic_mask
Definition: irql.c:39
unsigned char UCHAR
Definition: xmlstorage.h:181
UCHAR slave
Definition: irql.c:27
unsigned short USHORT
Definition: pedump.c:61
UCHAR master
Definition: irql.c:26
void __cdecl _disable(void)
Definition: intrin_arm.h:365
static PIC_MASK pic_mask_intr
Definition: irql.c:49
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532

Referenced by HalEndSystemInterrupt().

◆ HalpExecuteIrqs()

VOID HalpExecuteIrqs ( KIRQL  NewIrql)

Definition at line 130 of file irql.c.

131 {
132  ULONG IrqLimit, i;
133  IrqLimit = min(PROFILE_LEVEL - NewIrql, NR_IRQS);
134 
135  /*
136  * For each irq if there have been any deferred interrupts then now
137  * dispatch them.
138  */
139  for (i = 0; i < IrqLimit; i++)
140  {
141  if (HalpPendingInterruptCount[i] > 0)
142  {
143  KeGetPcr()->Irql = (KIRQL)IRQ_TO_DIRQL(i);
144 
145  while (HalpPendingInterruptCount[i] > 0)
146  {
147  /*
148  * For each deferred interrupt execute all the handlers at DIRQL.
149  */
151  //HalpHardwareInt[i]();
152  }
153  //KeGetPcr()->Irql--;
154  //HalpEndSystemInterrupt(KeGetPcr()->Irql);
155  }
156  }
157 
158 }
#define KeGetPcr()
Definition: ke.h:25
UCHAR KIRQL
Definition: env_spec_w32.h:591
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
static ULONG HalpPendingInterruptCount[NR_IRQS]
Definition: irql.c:52
#define NR_IRQS
Definition: halirq.h:23
#define PROFILE_LEVEL
Definition: env_spec_w32.h:698
#define min(a, b)
Definition: monoChain.cc:55
unsigned int ULONG
Definition: retypes.h:1
#define IRQ_TO_DIRQL(x)
Definition: irql.c:55
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114

Referenced by HalpLowerIrql().

◆ HalpInitPICs()

VOID NTAPI HalpInitPICs ( VOID  )

Definition at line 80 of file irql.c.

81 {
83 
84  /* Initialization sequence */
85  WRITE_PORT_UCHAR((PUCHAR)0x20, 0x11);
86  WRITE_PORT_UCHAR((PUCHAR)0xa0, 0x11);
87  /* Start of hardware irqs (0x24) */
89  WRITE_PORT_UCHAR((PUCHAR)0xa1, IRQ_BASE + 8);
90  /* 8259-1 is master */
91  WRITE_PORT_UCHAR((PUCHAR)0x21, 0x4);
92  /* 8259-2 is slave */
93  WRITE_PORT_UCHAR((PUCHAR)0xa1, 0x2);
94  /* 8086 mode */
95  WRITE_PORT_UCHAR((PUCHAR)0x21, 0x1);
96  WRITE_PORT_UCHAR((PUCHAR)0xa1, 0x1);
97  /* Enable interrupts */
98  WRITE_PORT_UCHAR((PUCHAR)0x21, 0xFF);
99  WRITE_PORT_UCHAR((PUCHAR)0xa1, 0xFF);
100 
101  /* We can now enable interrupts */
102  _enable();
103 }
#define IRQ_BASE
Definition: halirq.h:22
unsigned char * PUCHAR
Definition: retypes.h:3
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
void __cdecl _enable(void)
Definition: intrin_arm.h:373
static ULONG HalpPendingInterruptCount[NR_IRQS]
Definition: irql.c:52
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532
#define memset(x, y, z)
Definition: compat.h:39

Referenced by HalInitSystem().

◆ HalpLowerIrql()

VOID HalpLowerIrql ( KIRQL  NewIrql)

Definition at line 161 of file irql.c.

162 {
163  if (NewIrql >= PROFILE_LEVEL)
164  {
165  KeGetPcr()->Irql = NewIrql;
166  return;
167  }
169  if (NewIrql >= DISPATCH_LEVEL)
170  {
171  KeGetPcr()->Irql = NewIrql;
172  return;
173  }
174  KeGetPcr()->Irql = DISPATCH_LEVEL;
175  if (((PKIPCR)KeGetPcr())->HalReserved[HAL_DPC_REQUEST])
176  {
177  ((PKIPCR)KeGetPcr())->HalReserved[HAL_DPC_REQUEST] = FALSE;
179  }
180  KeGetPcr()->Irql = APC_LEVEL;
181  if (NewIrql == APC_LEVEL)
182  {
183  return;
184  }
185  if (KeGetCurrentThread() != NULL &&
186  KeGetCurrentThread()->ApcState.KernelApcPending)
187  {
189  }
190  KeGetPcr()->Irql = PASSIVE_LEVEL;
191 }
VOID HalpExecuteIrqs(KIRQL NewIrql)
Definition: irql.c:130
struct _KIPCR * PKIPCR
#define KeGetPcr()
Definition: ke.h:25
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI KiDispatchInterrupt(VOID)
Definition: thrdini.c:295
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define HAL_DPC_REQUEST
Definition: halp.h:11
#define PROFILE_LEVEL
Definition: env_spec_w32.h:698
_Out_ PKAPC_STATE ApcState
Definition: mm.h:1492
#define KeGetCurrentThread
Definition: hal.h:44
VOID NTAPI KiDeliverApc(IN KPROCESSOR_MODE DeliveryMode, IN PKEXCEPTION_FRAME ExceptionFrame, IN PKTRAP_FRAME TrapFrame)
Definition: apc.c:302
#define APC_LEVEL
Definition: env_spec_w32.h:695
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114

Referenced by HalEndSystemInterrupt(), and KfLowerIrql().

◆ HalRequestSoftwareInterrupt()

VOID FASTCALL HalRequestSoftwareInterrupt ( IN KIRQL  Request)

Definition at line 415 of file irql.c.

417 {
418  switch (Request)
419  {
420  case APC_LEVEL:
421  ((PKIPCR)KeGetPcr())->HalReserved[HAL_APC_REQUEST] = TRUE;
422  break;
423 
424  case DISPATCH_LEVEL:
425  ((PKIPCR)KeGetPcr())->HalReserved[HAL_DPC_REQUEST] = TRUE;
426  break;
427 
428  default:
429  DbgBreakPoint();
430  }
431 }
#define TRUE
Definition: types.h:120
struct _KIPCR * PKIPCR
void DbgBreakPoint()
Definition: mach.c:553
#define KeGetPcr()
Definition: ke.h:25
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
#define HAL_APC_REQUEST
Definition: halp.h:10
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define HAL_DPC_REQUEST
Definition: halp.h:11
#define APC_LEVEL
Definition: env_spec_w32.h:695

◆ KeGetCurrentIrql()

KIRQL NTAPI KeGetCurrentIrql ( VOID  )

Definition at line 71 of file irql.c.

76 {
77  return(KeGetPcr()->Irql);
78 }
_Out_ PKIRQL Irql
Definition: csq.h:179
#define KeGetPcr()
Definition: ke.h:25

Referenced by KxGetCurrentIrql().

◆ KeRaiseIrqlToDpcLevel()

KIRQL NTAPI KeRaiseIrqlToDpcLevel ( VOID  )

Definition at line 280 of file irql.c.

281 {
282  return KfRaiseIrql (DISPATCH_LEVEL);
283 }
KIRQL FASTCALL KfRaiseIrql(KIRQL NewIrql)
Definition: irql.c:243
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696

Referenced by KxRaiseIrqlToDpcLevel().

◆ KeRaiseIrqlToSynchLevel()

KIRQL NTAPI KeRaiseIrqlToSynchLevel ( VOID  )

Definition at line 304 of file irql.c.

305 {
306  return KfRaiseIrql (DISPATCH_LEVEL);
307 }
KIRQL FASTCALL KfRaiseIrql(KIRQL NewIrql)
Definition: irql.c:243
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696

◆ KfLowerIrql()

VOID FASTCALL KfLowerIrql ( KIRQL  NewIrql)

Definition at line 210 of file irql.c.

211 {
212  DPRINT("KfLowerIrql(NewIrql %d)\n", NewIrql);
213 
214  if (NewIrql > KeGetPcr()->Irql)
215  {
216  DbgPrint ("(%s:%d) NewIrql %x CurrentIrql %x\n",
217  __FILE__, __LINE__, NewIrql, KeGetPcr()->Irql);
218  KeBugCheck(IRQL_NOT_LESS_OR_EQUAL);
219  for(;;);
220  }
221 
223 }
#define DbgPrint
Definition: loader.c:25
_Out_ PKIRQL Irql
Definition: csq.h:179
#define KeGetPcr()
Definition: ke.h:25
VOID HalpLowerIrql(KIRQL NewIrql)
Definition: irql.c:161
void DPRINT(...)
Definition: polytest.cpp:61
VOID NTAPI KeBugCheck(ULONG BugCheckCode)
Definition: bug.c:1507
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114

◆ KfRaiseIrql()

KIRQL FASTCALL KfRaiseIrql ( KIRQL  NewIrql)

Definition at line 243 of file irql.c.

244 {
245  KIRQL OldIrql;
246 
247  DPRINT("KfRaiseIrql(NewIrql %d)\n", NewIrql);
248 
249  if (NewIrql < KeGetPcr()->Irql)
250  {
251  DbgPrint ("%s:%d CurrentIrql %x NewIrql %x\n",
252  __FILE__,__LINE__,KeGetPcr()->Irql,NewIrql);
253  KeBugCheck (IRQL_NOT_GREATER_OR_EQUAL);
254  for(;;);
255  }
256 
257  OldIrql = KeGetPcr()->Irql;
258  KeGetPcr()->Irql = NewIrql;
259  return OldIrql;
260 }
#define DbgPrint
Definition: loader.c:25
_Out_ PKIRQL Irql
Definition: csq.h:179
#define KeGetPcr()
Definition: ke.h:25
UCHAR KIRQL
Definition: env_spec_w32.h:591
void DPRINT(...)
Definition: polytest.cpp:61
VOID NTAPI KeBugCheck(ULONG BugCheckCode)
Definition: bug.c:1507
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114

Referenced by KeRaiseIrqlToDpcLevel(), KeRaiseIrqlToSynchLevel(), and KxRaiseIrql().

◆ KiInterruptDispatch2()

VOID NTAPI KiInterruptDispatch2 ( ULONG  Irq,
KIRQL  old_level 
)

Definition at line 365 of file ppc_irq.c.

373 {
374  PKINTERRUPT isr;
376  KIRQL oldlvl;
377  PISR_TABLE CurrentIsr;
378 
379  DPRINT("I(0x%.08x, 0x%.08x)\n", vector, old_level);
380 
381  /*
382  * Iterate the list until one of the isr tells us its device interrupted
383  */
385 
386  KiAcquireSpinLock(&CurrentIsr->Lock);
387 
388  CurrentIsr->Count++;
389  current = CurrentIsr->ListHead.Flink;
390 
391  while (current != &CurrentIsr->ListHead)
392  {
393  isr = CONTAINING_RECORD(current,KINTERRUPT,InterruptListEntry);
394  oldlvl = KeAcquireInterruptSpinLock(isr);
395  if (isr->ServiceRoutine(isr, isr->ServiceContext))
396  {
397  KeReleaseInterruptSpinLock(isr, oldlvl);
398  break;
399  }
400  KeReleaseInterruptSpinLock(isr, oldlvl);
401  current = current->Flink;
402  }
403  KiReleaseSpinLock(&CurrentIsr->Lock);
404 }
LIST_ENTRY ListHead
Definition: ppc_irq.c:132
FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID)
Definition: ke.h:337
UCHAR KIRQL
Definition: env_spec_w32.h:591
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:35
VOID NTAPI KeReleaseInterruptSpinLock(IN PKINTERRUPT Interrupt, IN KIRQL OldIrql)
Definition: spinlock.c:165
ULONG Count
Definition: ppc_irq.c:134
void DPRINT(...)
Definition: polytest.cpp:61
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
KIRQL NTAPI KeAcquireInterruptSpinLock(IN PKINTERRUPT Interrupt)
Definition: spinlock.c:148
PKSERVICE_ROUTINE ServiceRoutine
Definition: ketypes.h:828
KSPIN_LOCK Lock
Definition: ppc_irq.c:133
Definition: typedefs.h:118
VOID FASTCALL KiAcquireSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:28
unsigned int ULONG
Definition: retypes.h:1
static ISR_TABLE IsrTable[NR_TRAPS][1]
Definition: ppc_irq.c:141
PVOID ServiceContext
Definition: ketypes.h:833
struct task_struct * current
Definition: linux.c:32

Referenced by KiInterruptDispatch3().

Variable Documentation

◆ HalpPendingInterruptCount

ULONG HalpPendingInterruptCount[NR_IRQS]
static

Definition at line 52 of file irql.c.

Referenced by HalBeginSystemInterrupt(), HalpExecuteIrqs(), and HalpInitPICs().

◆ pic_mask

PIC_MASK pic_mask = { 0xFFFA }
static

◆ pic_mask_intr

PIC_MASK pic_mask_intr = { 0 }
static