1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
/*++ BUILD Version: 0001 // Increment this if a change has global effects
Copyright (c) 1991 Microsoft Corporation
Module Name:
pbiosp.h
Abstract:
PnP BIOS/ISA configuration data definitions
Author:
Shie-Lin Tzong (shielint) April 12, 1995
Revision History:
--*/
//#include "nthal.h"
//#include "hal.h"
//
// Constants
//
#define SMALL_RESOURCE_TAG (UCHAR)(0x00)
#define LARGE_RESOURCE_TAG (UCHAR)(0x80)
#define SMALL_TAG_MASK 0xf8
#define SMALL_TAG_SIZE_MASK 7
//
// Small Resouce Tags with length bits stripped off
//
#define TAG_VERSION 0x08
#define TAG_LOGICAL_ID 0x10
#define TAG_COMPATIBLE_ID 0x18
#define TAG_IRQ 0x20
#define TAG_DMA 0x28
#define TAG_START_DEPEND 0x30
#define TAG_END_DEPEND 0x38
#define TAG_IO 0x40
#define TAG_IO_FIXED 0x48
#define TAG_VENDOR 0x70
#define TAG_END 0x78
//
// Large Resouce Tags
//
#define TAG_MEMORY 0x81
#define TAG_ANSI_ID 0x82
#define TAG_UNICODE_ID 0x83
#define TAG_LVENDOR 0x84
#define TAG_MEMORY32 0x85
#define TAG_MEMORY32_FIXED 0x86
//
// Complete TAG if applicable.
//
#define TAG_COMPLETE_COMPATIBLE_ID 0x1C
#define TAG_COMPLETE_END 0x79
#include "pshpack1.h"
//
// PNP ISA Port descriptor definition
//
typedef struct _PNP_PORT_DESCRIPTOR_ {
UCHAR Tag; // 01000111B, small item name = 08, length = 7
UCHAR Information; // bit [0] = 1 device decodes full 16 bit addr
// = 0 device decodes ISA addr bits[9-0]
USHORT MinimumAddress;
USHORT MaximumAddress;
UCHAR Alignment; // Increment in 1 byte blocks
UCHAR Length; // # contiguous Port requested
} PNP_PORT_DESCRIPTOR, *PPNP_PORT_DESCRIPTOR;
//
// PNP ISA fixed Port descriptor definition
//
typedef struct _PNP_FIXED_PORT_DESCRIPTOR_ {
UCHAR Tag; // 01001011B, small item name = 09, length = 3
USHORT MinimumAddress;
UCHAR Length; // # contiguous Port requested
} PNP_FIXED_PORT_DESCRIPTOR, *PPNP_FIXED_PORT_DESCRIPTOR;
//
// PNP ISA IRQ descriptor definition
//
typedef struct _PNP_IRQ_DESCRIPTOR_ {
UCHAR Tag; // 0010001XB small item name = 4 length = 2/3
USHORT IrqMask; // bit 0 is irq 0
UCHAR Information; // Optional
} PNP_IRQ_DESCRIPTOR, *PPNP_IRQ_DESCRIPTOR;
//
// Masks for PNP_IRQ_DESCRIPTOR Information byte
//
#define PNP_IRQ_LEVEL_MASK 0xC
#define PNP_IRQ_EDGE_MASK 0x3
//
// PNP ISA DMA descriptor definition
//
typedef struct _PNP_DMA_DESCRIPTOR_ {
UCHAR Tag; // 00101010B, small item name = 05, length = 2
UCHAR ChannelMask; // bit 0 is channel 0
UCHAR Flags; // see spec
} PNP_DMA_DESCRIPTOR, *PPNP_DMA_DESCRIPTOR;
//
// PNP ISA MEMORY descriptor
//
typedef struct _PNP_MEMORY_DESCRIPTOR_ {
UCHAR Tag; // 10000001B, Large item name = 1
USHORT Length; // Length of the descriptor = 9
UCHAR Information; // See def below
USHORT MinimumAddress; // address bit [8-23]
USHORT MaximumAddress; // address bit [8-23]
USHORT Alignment; // 0x0000 = 64KB
USHORT MemorySize; // In 256 byte blocks
} PNP_MEMORY_DESCRIPTOR, *PPNP_MEMORY_DESCRIPTOR;
//
// PNP ISA MEMORY32 descriptor
//
typedef struct _PNP_MEMORY32_DESCRIPTOR_ {
UCHAR Tag; // 10000101B, Large item name = 5
USHORT Length; // Length of the descriptor = 17
UCHAR Information; // See def below
ULONG MinimumAddress; // 32 bit addr
ULONG MaximumAddress; // 32 bit addr
ULONG Alignment; // 32 bit alignment
ULONG MemorySize; // 32 bit length
} PNP_MEMORY32_DESCRIPTOR, *PPNP_MEMORY32_DESCRIPTOR;
//
// PNP ISA FIXED MEMORY32 descriptor
//
typedef struct _PNP_FIXED_MEMORY32_DESCRIPTOR_ {
UCHAR Tag; // 10000110B, Large item name = 6
USHORT Length; // Length of the descriptor = 9
UCHAR Information; // See def below
ULONG BaseAddress; // 32 bit addr
ULONG MemorySize; // 32 bit length
} PNP_FIXED_MEMORY32_DESCRIPTOR, *PPNP_FIXED_MEMORY32_DESCRIPTOR;
#define PNP_MEMORY_ROM_MASK 0x40
#define PNP_MEMORY_SHADOWABLE_MASK 0x20
#define PNP_MEMORY_CONTROL_MASK 0x18
#define PNP_MEMORY_CONTROL_8BIT 00
#define PNP_MEMORY_CONTROL_16BIT 01
#define PNP_MEMORY_CONTROL_8AND16BIT 02
#define PNP_MEMORY_CONTROL_32BIT 03
#define PNP_MEMORY_SUPPORT_TYPE_MASK 04
#define PNP_MEMORY_CACHE_SUPPORT_MASK 02
#define PNP_MEMORY_WRITE_STATUS_MASK 01
#define UNKNOWN_DOCKING_IDENTIFIER 0xffffffff
#define UNABLE_TO_DETERMINE_DOCK_CAPABILITIES 0x89
#define FUNCTION_NOT_SUPPORTED 0x82
#define SYSTEM_NOT_DOCKED 0x87
//
// Pnp BIOS device node structure
//
typedef struct _PNP_BIOS_DEVICE_NODE {
USHORT Size;
UCHAR Node;
ULONG ProductId;
UCHAR DeviceType[3];
USHORT DeviceAttributes;
// followed by AllocatedResourceBlock, PossibleResourceBlock
// and CompatibleDeviceId
} PNP_BIOS_DEVICE_NODE, *PPNP_BIOS_DEVICE_NODE;
//
// DeviceType definition
//
#define BASE_TYPE_DOCKING_STATION 0xA
//
// Device attributes definitions
//
#define DEVICE_DOCKING 0x20
#define DEVICE_REMOVABLE 0x40
//
// Pnp BIOS Installation check
//
typedef struct _PNP_BIOS_INSTALLATION_CHECK {
UCHAR Signature[4]; // $PnP (ascii)
UCHAR Revision;
UCHAR Length;
USHORT ControlField;
UCHAR Checksum;
ULONG EventFlagAddress; // Physical address
USHORT RealModeEntryOffset;
USHORT RealModeEntrySegment;
USHORT ProtectedModeEntryOffset;
ULONG ProtectedModeCodeBaseAddress;
ULONG OemDeviceId;
USHORT RealModeDataBaseAddress;
ULONG ProtectedModeDataBaseAddress;
} PNP_BIOS_INSTALLATION_CHECK, *PPNP_BIOS_INSTALLATION_CHECK;
#include "poppack.h"
//
// Pnp BIOS ControlField masks
//
#define PNP_BIOS_CONTROL_MASK 0x3
#define PNP_BIOS_EVENT_NOT_SUPPORTED 0
#define PNP_BIOS_EVENT_POLLING 1
#define PNP_BIOS_EVENT_ASYNC 2
//
// Pnp Bios event
//
#define ABOUT_TO_CHANGE_CONFIG 1
#define DOCK_CHANGED 2
#define SYSTEM_DEVICE_CHANGED 3
#define CONFIG_CHANGE_FAILED 4
|