OpenCBM
cbm_driver.h
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 
21 
24 
25 #include "arch_cbm_driver.h"
26 
28 #define DBG_KERNELMODE
29 
30 #include "debug.h"
31 
32 #include "perfeval.h"
33 
34 /* The following defines are used if performance evaluation is selected. */
35 
37 #define PERF_EVENT_MEASURE_TIME(_x_) PERF_EVENT(0x1, (ULONG_PTR) _x_)
38 
40 #define PERF_EVENT_STARTIO(_x_) PERF_EVENT(0x10, (ULONG_PTR) _x_)
41 
42 #define PERF_EVENT_COMPLETEIRP(_x_) PERF_EVENT(0x11, (ULONG_PTR) _x_)
43 
44 #define PERF_EVENT_CANCELIRP(_x_) PERF_EVENT(0x12, (ULONG_PTR) _x_)
45 
47 #define PERF_EVENT_IOCTL_QUEUE(_x_) PERF_EVENT(0x20, _x_)
48 
49 #define PERF_EVENT_IOCTL_EXECUTE(_x_) PERF_EVENT(0x21, _x_)
50 
51 #define PERF_EVENT_OPEN_QUEUE() PERF_EVENT(0x30, 0)
52 
53 #define PERF_EVENT_OPEN_EXECUTE() PERF_EVENT(0x31, 0)
54 
55 #define PERF_EVENT_CLOSE_QUEUE() PERF_EVENT(0x40, 0)
56 
57 #define PERF_EVENT_CLOSE_EXECUTE() PERF_EVENT(0x41, 0)
58 
59 #define PERF_EVENT_READ_QUEUE(_x_) PERF_EVENT(0x50, _x_)
60 
61 #define PERF_EVENT_READ_EXECUTE(_x_) PERF_EVENT(0x51, _x_)
62 
63 #define PERF_EVENT_WRITE_QUEUE(_x_) PERF_EVENT(0x60, _x_)
64 
65 #define PERF_EVENT_WRITE_EXECUTE(_x_) PERF_EVENT(0x61, _x_)
66 
68 #define PERF_EVENT_THREAD_START_SCHED() PERF_EVENT(0x100, 0)
69 
70 #define PERF_EVENT_THREAD_START_EXEC() PERF_EVENT(0x100, 1)
71 
72 #define PERF_EVENT_THREAD_POLL() PERF_EVENT(0x100, 2)
73 
74 #define PERF_EVENT_THREAD_STOP_SCHED() PERF_EVENT(0x100, 3)
75 
76 #define PERF_EVENT_THREAD_STOP_EXEC() PERF_EVENT(0x100, 4)
77 
79 #define PERF_EVENT_READ_BYTE_NO(_x_) PERF_EVENT(0x200, _x_)
80 
81 #define PERF_EVENT_READ_BYTE(_x_) PERF_EVENT(0x201, _x_)
82 
83 #define PERF_EVENT_READ_BIT_NO(_x_) PERF_EVENT(0x202, _x_)
84 
85 #define PERF_EVENT_WRITE_BYTE_NO(_x_) PERF_EVENT(0x210, _x_)
86 
87 #define PERF_EVENT_WRITE_BYTE(_x_) PERF_EVENT(0x211, _x_)
88 
89 #define PERF_EVENT_WRITE_BIT_NO(_x_) PERF_EVENT(0x212, _x_)
90 
92 typedef enum cablestate_e CABLESTATE;
93 
95 typedef
96 struct DEVICE_EXTENSION_s {
97 
100 
103 
108 
114  ULONG IrqCount;
115 
117  BOOLEAN IsSMP;
118 
119  // IEC related vars:
120 
128 
133 
138 
140  UCHAR IecOutBits;
141 
143  UCHAR IecOutEor;
144 
146  UCHAR IecInEor;
147 
148  /* The values below tell the drive which mask has to be used
149  * to set and/or release a line
150  */
151 
152  /* lpt output lines */
153 
154  UCHAR IecAtnOut;
155  UCHAR IecClkOut;
156  UCHAR IecDataOut;
157  UCHAR IecResetOut;
158 
159  /* lpt input lines */
160 
161  UCHAR IecAtnIn;
162  UCHAR IecClkIn;
163  UCHAR IecDataIn;
164  UCHAR IecResetIn;
165 
166 
168  BOOLEAN IecBusy;
169 
171  BOOLEAN Eoi;
172 
enum cablestate_e CABLESTATE
@@@
Definition: cbm_driver.h:92
CABLESTATE IecCableState
Definition: cbm_driver.h:137
Define makros for debugging purposes.
UCHAR IecAtnOut
The ATN OUT bit.
Definition: cbm_driver.h:154
enum iec_cabletype IEC_CABLETYPE
cablestate_e
remember in which state the cable is currently
Definition: i_iec.h:260
struct DEVICE_EXTENSION_s DEVICE_EXTENSION
@@@
Definition: cbm_driver.h:20
UCHAR IecResetOut
The RESET OUT bit.
Definition: cbm_driver.h:157
IEC_CABLETYPE IecCable
Definition: cbm_driver.h:127
UCHAR IecDataIn
The DATA IN bit.
Definition: cbm_driver.h:163
Windows-specific definitions for the opencbm driver.
UCHAR IecAtnIn
The ATN IN bit.
Definition: cbm_driver.h:161
PUCHAR ParPortPortAddress
Definition: cbm_driver.h:102
IEC_CABLETYPE IecCableUserSet
Definition: cbm_driver.h:132
UCHAR IecClkIn
The CLOCK IN bit.
Definition: cbm_driver.h:162
UCHAR IecDataOut
The DATA OUT bit.
Definition: cbm_driver.h:156
UCHAR IecClkOut
The CLOCK OUT bit.
Definition: cbm_driver.h:155
Functions and macros for performance evaluation purposes.
struct DEVICE_EXTENSION_s * PDEVICE_EXTENSION
@@@
Definition: cbm_driver.h:23
PUCHAR ParPortEcpPortAddress
Definition: cbm_driver.h:107
UCHAR IecResetIn
The RESET IN bit.
Definition: cbm_driver.h:164