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
|
#ifndef CONFIGMG_H
#define CONFIGMG_H
/** CONFIGMG VxD services and types.
* Manually generated for now. */
enum CONFIGMG_RESULT {
CR_SUCCESS = 0x0,
CR_DEFAULT = 0x1,
CR_OUT_OF_MEMORY = 0x2,
CR_INVALID_POINTER = 0x3,
CR_INVALID_FLAG = 0x4,
CR_INVALID_DEVNODE = 0x5,
CR_INVALID_RES_DES = 0x6,
CR_INVALID_LOG_CONF = 0x7,
CR_INVALID_ARBITRATOR = 0x8,
CR_INVALID_NODELIST = 0x9,
CR_DEVNODE_HAS_REQS = 0xA,
CR_INVALID_RESOURCEID = 0xB,
CR_DLVXD_NOT_FOUND = 0xC,
CR_NO_SUCH_DEVNODE = 0xD,
CR_NO_MORE_LOG_CONF = 0xE,
CR_ALREADY_SUCH_DEVNODE = 0x10,
CR_INVALID_RANGE_LIST = 0x11,
CR_INVALID_RANGE = 0x12,
CR_FAILURE = 0x13,
CR_NO_SUCH_LOGICAL_KEY = 0x14,
CR_CREATE_BLOCKED = 0x15,
CR_NOT_SYSTEM_VM = 0x16,
CR_REMOVE_VETOED = 0x17,
CR_APM_VETOED = 0x18,
CR_INVALID_LOAD_TYPE = 0x19,
CR_BUFFER_SMALL = 0x1A,
// ...
};
typedef uint32_t CONFIGRET;
enum DLVXD_LOAD_TYPE {
DLVXD_LOAD_ENUMERATE = 0,
DLVXD_LOAD_DEVLOADER = 1,
DLVXD_LOAD_DRIVER = 2
};
// Handles
/** Device node */
typedef uint32_t DEVNODE;
/** Logical configuration */
typedef uint32_t LOG_CONF, *PLOG_CONF;
#define MAX_MEM_REGISTERS 9
#define MAX_IO_PORTS 20
#define MAX_IRQS 7
#define MAX_DMA_CHANNELS 7
typedef _Packed struct cm_config {
uint16_t num_mem_windows;
uint32_t mem_base[MAX_MEM_REGISTERS];
uint32_t mem_length[MAX_MEM_REGISTERS];
uint16_t mem_attrib[MAX_MEM_REGISTERS];
uint16_t num_io_ports;
uint16_t io_port_base[MAX_IO_PORTS];
uint16_t io_port_length[MAX_IO_PORTS];
uint16_t num_irqs;
uint8_t irq_registers[MAX_IRQS];
uint8_t irq_attrib[MAX_IRQS];
uint16_t num_dmas;
uint8_t dma_lst[MAX_DMA_CHANNELS];
uint16_t dma_attrib[MAX_DMA_CHANNELS];
uint8_t reserved[3];
} CMCONFIG;
static inline CONFIGRET CONFIGMG_Get_Parent(DEVNODE *out, DEVNODE node, unsigned long flags);
#pragma aux CONFIGMG_Get_Parent = \
"int 0x20" \
"dd ( 0x33 shl 16 ) + 3" \
__parm __caller [] __value [eax] __modify [eax ecx edx]
static inline CONFIGRET CONFIGMG_Get_Child(DEVNODE *out, DEVNODE node, unsigned long flags);
#pragma aux CONFIGMG_Get_Child = \
"int 0x20" \
"dd ( 0x33 shl 16 ) + 4" \
__parm __caller [] __value [eax] __modify [eax ecx edx]
static inline CONFIGRET CONFIGMG_Get_Private_DWord(unsigned long *value, DEVNODE inDevNode, DEVNODE forDevNode, unsigned long flags);
#pragma aux CONFIGMG_Get_Private_DWord = \
"int 0x20" \
"dd ( 0x33 shl 16 ) + 9" \
__parm __caller [] __value [eax] __modify [eax ecx edx]
static inline CONFIGRET CONFIGMG_Set_Private_DWord(DEVNODE inDevNode, DEVNODE forDevNode, unsigned long value, unsigned long flags);
#pragma aux CONFIGMG_Set_Private_DWord = \
"int 0x20" \
"dd ( 0x33 shl 16 ) + 10" \
__parm __caller [] __value [eax] __modify [eax ecx edx]
static inline CONFIGRET CONFIGMG_Create_DevNode(DEVNODE *out, const char * deviceId, DEVNODE parent, unsigned long flags);
#pragma aux CONFIGMG_Create_DevNode = \
"int 0x20" \
"dd ( 0x33 shl 16 ) + 11" \
__parm __caller [] __value [eax] __modify [eax ecx edx]
static inline CONFIGRET CONFIGMG_Set_Bus_Info(DEVNODE devnode, uint32_t busType, unsigned long infoSize, void *info, unsigned long flags);
#pragma aux CONFIGMG_Set_Bus_Info = \
"int 0x20" \
"dd ( 0x33 shl 16 ) + 67" \
__parm __caller [] __value [eax] __modify [eax ecx edx]
static inline CONFIGRET CONFIGMG_Get_Bus_Info(DEVNODE devnode, uint32_t busType, unsigned long *infoSize, void *info, unsigned long flags);
#pragma aux CONFIGMG_Set_Bus_Info = \
"int 0x20" \
"dd ( 0x33 shl 16 ) + 67" \
__parm __caller [] __value [eax] __modify [eax ecx edx]
enum CONFIGFUNCS {
/** Check if the given resources are acceptable. */
CONFIG_FILTER = 0x0,
/** Start using hardware with the given resources. */
CONFIG_START = 0x1,
/** Stop using the allocated resources. */
CONFIG_STOP = 0x2,
CONFIG_TEST = 0x3,
/** Send to devnode and parents when removed from the tree.
* Stop using the hardware and deallocate all instance data. */
CONFIG_REMOVE = 0x4,
CONFIG_ENUMERATE = 0x5,
CONFIG_SETUP = 0x6,
CONFIG_CALLBACK = 0x7,
CONFIG_APM = 0x8,
CONFIG_TEST_FAILED = 0x9,
CONFIG_TEST_SUCCEEDED = 0xA,
CONFIG_VERIFY_DEVICE = 0xB,
CONFIG_PREREMOVE = 0xC,
CONFIG_SHUTDOWN = 0xD,
CONFIG_PREREMOVE2 = 0xE,
CONFIG_READY = 0xF,
CONFIG_PROP_CHANGE = 0x10,
CONFIG_PRIVATE = 0x11,
CONFIG_PRESHUTDOWN = 0x12
};
enum SUBCONFIGFUNCS {
CONFIG_START_DYNAMIC_START = 0x0,
CONFIG_START_FIRST_START = 0x1,
CONFIG_STOP_DYNAMIC_STOP = 0x0,
CONFIG_STOP_HAS_PROBLEM = 0x1,
CONFIG_REMOVE_DYNAMIC = 0x0,
CONFIG_REMOVE_SHUTDOWN = 0x1,
CONFIG_REMOVE_REBOOT = 0x2
};
typedef uint32_t CONFIGFUNC;
typedef uint32_t SUBCONFIGFUNC;
typedef CONFIGRET (__cdecl *CMCONFIGHANDLER)(CONFIGFUNC func, SUBCONFIGFUNC subFunc, DEVNODE devNode, unsigned long refData, unsigned long flags);
enum register_device_driver_flags {
CM_REGISTER_DEVICE_DRIVER_STATIC = 0,
CM_REGISTER_DEVICE_DRIVER_DISABLEABLE = 1,
CM_REGISTER_DEVICE_DRIVER_REMOVABLE = 2
};
static inline CONFIGRET CONFIGMG_Register_Device_Driver(DEVNODE devNode, CMCONFIGHANDLER handler, unsigned long refData, unsigned long flags);
#pragma aux CONFIGMG_Register_Device_Driver = \
"int 0x20" \
"dd ( 0x33 shl 16 ) + 14" \
__parm __caller [] __value [eax] __modify [eax ecx edx]
typedef CONFIGRET (__cdecl *CMENUMFUNCTION)(CONFIGFUNC func, SUBCONFIGFUNC subFunc, DEVNODE bus, DEVNODE about, unsigned long flags);
enum register_enumerator_flags {
CM_REGISTER_ENUMERATOR_SOFTWARE = 0,
CM_REGISTER_ENUMERATOR_HARDWARE = 1
};
static inline CONFIGRET CONFIGMG_Register_Enumerator(DEVNODE devNode, CMENUMFUNCTION handler, unsigned long flags);
#pragma aux CONFIGMG_Register_Enumerator = \
"int 0x20" \
"dd ( 0x33 shl 16 ) + 15" \
__parm __caller [] __value [eax] __modify [eax ecx edx]
enum LOG_CONF_FLAS {
BASIC_LOG_CONG = 0,
FILTERED_LOG_CONF = 1,
ALLOC_LOG_CONF = 2,
BOOT_LOG_CONF = 3,
FORCED_LOG_CONF = 4
};
static inline CONFIGRET CONFIGMG_Get_First_Log_Conf(LOG_CONF *logconf, DEVNODE devNode, unsigned long flags);
#pragma aux CONFIGMG_Get_First_Log_Conf = \
"int 0x20" \
"dd ( 0x33 shl 16 ) + 26" \
__parm __caller [] __value [eax] __modify [eax ecx edx]
static inline CONFIGRET CONFIGMG_Get_Next_Log_Conf(LOG_CONF *logconf, DEVNODE prevLogConf, unsigned long flags);
#pragma aux CONFIGMG_Get_Next_Log_Conf = \
"int 0x20" \
"dd ( 0x33 shl 16 ) + 27" \
__parm __caller [] __value [eax] __modify [eax ecx edx]
enum CM_GET_ALLOC_LOG_CONF_FLAGS {
CM_GET_ALLOC_LOG_CONF_ALLOC = 0,
CM_GET_ALLOC_LOG_CONF_BOOT_ALLOC = 1
};
static inline CONFIGRET CONFIGMG_Get_Alloc_Log_Conf(CMCONFIG *config, DEVNODE devNode, unsigned long flags);
#pragma aux CONFIGMG_Get_Alloc_Log_Conf = \
"int 0x20" \
"dd ( 0x33 shl 16 ) + 59" \
__parm __caller [] __value [eax] __modify [eax ecx edx]
#endif // CONFIGMG_H
|