diff options
| author | Javier <dev.git@javispedro.com> | 2026-10-26 00:50:06 +0100 |
|---|---|---|
| committer | Javier <dev.git@javispedro.com> | 2026-10-26 00:50:06 +0100 |
| commit | 6b8a368c51082fdd010ef5e1b0be4eb9b5059d1a (patch) | |
| tree | e274d41a8dd5e912e20617a937a1fda5af91f8de /w9x/inc/configmg.h | |
| parent | 9b1cf601360fb194047e6dcc2af75c2f38c611ec (diff) | |
| download | chu-6b8a368c51082fdd010ef5e1b0be4eb9b5059d1a.tar.gz chu-6b8a368c51082fdd010ef5e1b0be4eb9b5059d1a.zip | |
refactor common parts into inc/ch375.h and add win9x, linux drivers
Diffstat (limited to 'w9x/inc/configmg.h')
| -rw-r--r-- | w9x/inc/configmg.h | 213 |
1 files changed, 213 insertions, 0 deletions
diff --git a/w9x/inc/configmg.h b/w9x/inc/configmg.h new file mode 100644 index 0000000..d3cec38 --- /dev/null +++ b/w9x/inc/configmg.h @@ -0,0 +1,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 |
