1 | /* $Id: VBoxVideoIPRT.h 69015 2017-10-09 12:50:34Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox Video driver, common code - iprt and VirtualBox macros and definitions.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2017 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ___VBox_Graphics_VBoxVideoIPRT_h
|
---|
19 | #define ___VBox_Graphics_VBoxVideoIPRT_h
|
---|
20 |
|
---|
21 | #ifndef RT_OS_OS2
|
---|
22 | # include <iprt/asm.h>
|
---|
23 | # include <iprt/string.h>
|
---|
24 | #endif
|
---|
25 | #include <iprt/assert.h>
|
---|
26 | #include <iprt/cdefs.h>
|
---|
27 | #include <iprt/err.h>
|
---|
28 | #include <iprt/list.h>
|
---|
29 | #include <iprt/stdarg.h>
|
---|
30 | #include <iprt/stdint.h>
|
---|
31 | #include <iprt/types.h>
|
---|
32 |
|
---|
33 | #if !defined VBOX_XPDM_MINIPORT && !defined RT_OS_OS2
|
---|
34 | # include <iprt/asm-amd64-x86.h>
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | #ifdef VBOX_XPDM_MINIPORT
|
---|
38 | # include <iprt/nt/miniport.h>
|
---|
39 | # include <ntddvdeo.h> /* sdk, clean */
|
---|
40 | # include <iprt/nt/Video.h>
|
---|
41 | #endif
|
---|
42 |
|
---|
43 | /** @name Port I/O helpers
|
---|
44 | * @{ */
|
---|
45 |
|
---|
46 | #ifdef VBOX_XPDM_MINIPORT
|
---|
47 |
|
---|
48 | /** Write an 8-bit value to an I/O port. */
|
---|
49 | # define VBVO_PORT_WRITE_U8(Port, Value) \
|
---|
50 | VideoPortWritePortUchar((PUCHAR)Port, Value)
|
---|
51 | /** Write a 16-bit value to an I/O port. */
|
---|
52 | # define VBVO_PORT_WRITE_U16(Port, Value) \
|
---|
53 | VideoPortWritePortUshort((PUSHORT)Port, Value)
|
---|
54 | /** Write a 32-bit value to an I/O port. */
|
---|
55 | # define VBVO_PORT_WRITE_U32(Port, Value) \
|
---|
56 | VideoPortWritePortUlong((PULONG)Port, Value)
|
---|
57 | /** Read an 8-bit value from an I/O port. */
|
---|
58 | # define VBVO_PORT_READ_U8(Port) \
|
---|
59 | VideoPortReadPortUchar((PUCHAR)Port)
|
---|
60 | /** Read a 16-bit value from an I/O port. */
|
---|
61 | # define VBVO_PORT_READ_U16(Port) \
|
---|
62 | VideoPortReadPortUshort((PUSHORT)Port)
|
---|
63 | /** Read a 32-bit value from an I/O port. */
|
---|
64 | # define VBVO_PORT_READ_U32(Port) \
|
---|
65 | VideoPortReadPortUlong((PULONG)Port)
|
---|
66 |
|
---|
67 | #else /** @todo make these explicit */
|
---|
68 |
|
---|
69 | /** Write an 8-bit value to an I/O port. */
|
---|
70 | # define VBVO_PORT_WRITE_U8(Port, Value) \
|
---|
71 | ASMOutU8(Port, Value)
|
---|
72 | /** Write a 16-bit value to an I/O port. */
|
---|
73 | # define VBVO_PORT_WRITE_U16(Port, Value) \
|
---|
74 | ASMOutU16(Port, Value)
|
---|
75 | /** Write a 32-bit value to an I/O port. */
|
---|
76 | # define VBVO_PORT_WRITE_U32(Port, Value) \
|
---|
77 | ASMOutU32(Port, Value)
|
---|
78 | /** Read an 8-bit value from an I/O port. */
|
---|
79 | # define VBVO_PORT_READ_U8(Port) \
|
---|
80 | ASMInU8(Port)
|
---|
81 | /** Read a 16-bit value from an I/O port. */
|
---|
82 | # define VBVO_PORT_READ_U16(Port) \
|
---|
83 | ASMInU16(Port)
|
---|
84 | /** Read a 32-bit value from an I/O port. */
|
---|
85 | # define VBVO_PORT_READ_U32(Port) \
|
---|
86 | ASMInU32(Port)
|
---|
87 | #endif
|
---|
88 |
|
---|
89 | /** @} */
|
---|
90 |
|
---|
91 | #endif
|
---|
92 |
|
---|