1 /*
2  * PROJECT:     ReactOS Bochs graphics card driver
3  * LICENSE:     GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE:     Bochs graphics card driver
5  * COPYRIGHT:   Copyright 2022 Hervé Poussineau <hpoussin@reactos.org>
6  */
7 
8 #ifndef BOCHS_H
9 #define BOCHS_H
10 
11 #include <ntdef.h>
12 #include <dderror.h>
13 #include <miniport.h>
14 #include <video.h>
15 #include <devioctl.h>
16 #include <section_attribs.h>
17 
18 #define VBE_EDID_SIZE                        0x80
19 
20 #define VBE_DISPI_IOPORT_INDEX               0x01CE
21 #define VBE_DISPI_IOPORT_DATA                0x01CF
22 #define VBE_DISPI_INDEX_ID                   0x00
23   #define VBE_DISPI_ID0                        0xB0C0
24   #define VBE_DISPI_ID1                        0xB0C1
25   #define VBE_DISPI_ID2                        0xB0C2
26   #define VBE_DISPI_ID3                        0xB0C3
27   #define VBE_DISPI_ID4                        0xB0C4
28   #define VBE_DISPI_ID5                        0xB0C5
29 #define VBE_DISPI_INDEX_XRES                 0x01
30 #define VBE_DISPI_INDEX_YRES                 0x02
31 #define VBE_DISPI_INDEX_BPP                  0x03
32 #define VBE_DISPI_INDEX_ENABLE               0x04
33   #define VBE_DISPI_DISABLED                   0x00
34   #define VBE_DISPI_ENABLED                    0x01
35   #define VBE_DISPI_GETCAPS                    0x02
36   #define VBE_DISPI_LFB_ENABLED                0x40
37 #define VBE_DISPI_INDEX_VIDEO_MEMORY_64K     0x0A
38 
39 #define BOCHS_TAG 'BCHS'
40 
41 typedef struct
42 {
43     USHORT XResolution;
44     USHORT YResolution;
45 } BOCHS_SIZE, *PBOCHS_SIZE;
46 
47 typedef struct
48 {
49     PUCHAR Mapped;
50     PHYSICAL_ADDRESS RangeStart;
51     ULONG RangeLength;
52     UCHAR RangeInIoSpace;
53 } BOCHS_ADDRESS_RANGE;
54 
55 typedef struct
56 {
57     PBOCHS_SIZE AvailableModeInfo;
58     ULONG AvailableModeCount;
59     USHORT CurrentMode;
60 
61     BOCHS_ADDRESS_RANGE FrameBuffer;
62     BOCHS_ADDRESS_RANGE IoPorts;
63 
64     ULONG MaxXResolution;
65     ULONG MaxYResolution;
66     ULONG VramSize64K;
67 } BOCHS_DEVICE_EXTENSION, *PBOCHS_DEVICE_EXTENSION;
68 
69 #endif //BOCHS_H
70