OpenCBM
isr.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version
5  * 2 of the License, or (at your option) any later version.
6  *
7  * Copyright 2004 Spiro Trikaliotis
8  *
9  */
10 
19 #include <wdm.h>
20 #include "cbm_driver.h"
21 #include "iec.h"
22 
37 BOOLEAN
38 cbm_isr(IN PKINTERRUPT Interrupt, IN PVOID Pdx)
39 {
40  // Make sure we do not do any debugging outputs
41  // For this, this function ommits the FUNC_ENTER()
42  // FUNC_LEAVE() sandwich and makes sure the debugging
43  // flags are unset when calling the ISR routine.
44 
45  // This is needed as we cannot guard the debugging memory
46  // functions against anything running at IRQL > DISPATCH_LEVEL.
47 
48  BOOLEAN result;
49 
50 #if DBG
51 
52  ULONG dbgFlagsOld;
53 
54  // Make sure we do not try to write into the debugging memory
55  // as long as we are executing in the ISR
56 
57  // Remember the old DbgFlags
58 
59  dbgFlagsOld = DbgFlags;
60 
61  // Now, unset the flag which tells the system to write into
62  // the debugging memory
63 
64  DbgFlags &= ~DBGF_DBGMEMBUF;
65 
66 #endif // #if DBG
67 
68  // let the libiec library do the hard work
69 
70  PERF_EVENT_VERBOSE(0x2000, 0);
71  result = cbmiec_interrupt(Pdx);
72  PERF_EVENT_VERBOSE(0x2001, 0);
73 
74 #if DBG
75 
76  // Restore the debugging flags
77 
78  DbgFlags = dbgFlagsOld;
79 
80 #endif // #if DBG
81 
82  return result;
83 }
BOOLEAN cbmiec_interrupt(IN PDEVICE_EXTENSION Pdx)
Interrupt handler for the IEC bus.
Definition: interrupt.c:40
unsigned long DbgFlags
Definitions for the libiec library.
BOOLEAN cbm_isr(IN PKINTERRUPT Interrupt, IN PVOID Pdx)
Interrupt Service Routine (ISR)
Definition: isr.c:38
Definitions for the opencbm driver.