// NT client IOCTLs

// NV graphics device driver string
#define NVRM_NAME_STRING L"\\Device\\nvgfx"
#define NVRM_LINK_STRING L"\\DosDevices\\nvgfx"

// device type and base control code
#define FILE_DEVICE_NVRM    0x00008000
#define NVRM_IOCTL_INDEX    0x00000800
#define NV_IOCTL_CODE(f)            \
    CTL_CODE(                       \
        FILE_DEVICE_NVRM+(f),       \
        NVRM_IOCTL_INDEX,           \
        METHOD_BUFFERED,            \
        FILE_ANY_ACCESS             \
    )

// control codes
#define IOCTL_NV01_ALLOC_ROOT           NV_IOCTL_CODE(NV01_ALLOC_ROOT)
#define IOCTL_NV01_ALLOC_DEVICE         NV_IOCTL_CODE(NV01_ALLOC_DEVICE)
#define IOCTL_NV01_ALLOC_CONTEXT_DMA    NV_IOCTL_CODE(NV01_ALLOC_CONTEXT_DMA)
#define IOCTL_NV01_ALLOC_CHANNEL_PIO    NV_IOCTL_CODE(NV01_ALLOC_CHANNEL_PIO)
#define IOCTL_NV03_ALLOC_CHANNEL_DMA    NV_IOCTL_CODE(NV03_ALLOC_CHANNEL_DMA)
#define IOCTL_NV01_ALLOC_MEMORY         NV_IOCTL_CODE(NV01_ALLOC_MEMORY)
#define IOCTL_NV01_ALLOC_OBJECT         NV_IOCTL_CODE(NV01_ALLOC_OBJECT)
#define IOCTL_NV01_ALLOC_EVENT          NV_IOCTL_CODE(NV01_ALLOC_EVENT)
#define IOCTL_NV04_ALLOC                NV_IOCTL_CODE(NV04_ALLOC)
#define IOCTL_NV01_FREE                 NV_IOCTL_CODE(NV01_FREE)
#define IOCTL_NV03_DMA_FLOW_CONTROL     NV_IOCTL_CODE(NV03_DMA_FLOW_CONTROL)
#define IOCTL_NV01_ARCH_HEAP            NV_IOCTL_CODE(NV01_ARCH_HEAP)
#define IOCTL_NV01_CONFIG_VERSION       NV_IOCTL_CODE(NV01_CONFIG_VERSION)
#define IOCTL_NV01_CONFIG_GET           NV_IOCTL_CODE(NV01_CONFIG_GET)
#define IOCTL_NV01_CONFIG_SET           NV_IOCTL_CODE(NV01_CONFIG_SET)
#define IOCTL_NV04_CONFIG_GET_EX        NV_IOCTL_CODE(NV04_CONFIG_GET_EX)
#define IOCTL_NV04_CONFIG_SET_EX        NV_IOCTL_CODE(NV04_CONFIG_SET_EX)
#define IOCTL_NV01_CONFIG_UPDATE        NV_IOCTL_CODE(NV01_CONFIG_UPDATE)
#define IOCTL_NV01_DEBUG_CONTROL        NV_IOCTL_CODE(NV01_DEBUG_CONTROL)
#define IOCTL_NV04_I2C_ACCESS           NV_IOCTL_CODE(NV04_I2C_ACCESS)
#define IOCTL_NV04_DIRECT_METHOD_CALL   NV_IOCTL_CODE(NV04_DIRECT_METHOD_CALL)

#define MAX_AGP_HEAP 0x02000000
