]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h
OvmfPkg/QemuVideoDxe/VbeShim: handle PAM1 register on Q35 correctly
[mirror_edk2.git] / OvmfPkg / QemuVideoDxe / UnalignedIoInternal.h
1 /** @file
2 Unaligned port I/O, with implementations for various x86 compilers and a
3 dummy for platforms which do not support unaligned port I/O.
4
5 Copyright (c) 2017, Phil Dennis-Jordan.<BR>
6 This program and the accompanying materials are licensed and made available
7 under the terms and conditions of the BSD License which accompanies this
8 distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef _UNALIGNED_IO_INTERNAL_H_
17 #define _UNALIGNED_IO_INTERNAL_H_
18
19 /**
20 Performs a 32-bit write to the specified, possibly unaligned I/O-type address.
21
22 Writes the 32-bit I/O port specified by Port with the value specified by Value
23 and returns Value. This function must guarantee that all I/O read and write
24 operations are serialized.
25
26 If 32-bit unaligned I/O port operations are not supported, then ASSERT().
27
28 @param[in] Port I/O port address
29 @param[in] Value 32-bit word to write
30
31 @return The value written to the I/O port.
32
33 **/
34 UINT32
35 UnalignedIoWrite32 (
36 IN UINTN Port,
37 IN UINT32 Value
38 );
39
40 /**
41 Reads a 32-bit word from the specified, possibly unaligned I/O-type address.
42
43 Reads the 32-bit I/O port specified by Port. The 32-bit read value is
44 returned. This function must guarantee that all I/O read and write operations
45 are serialized.
46
47 If 32-bit unaligned I/O port operations are not supported, then ASSERT().
48
49 @param[in] Port The I/O port to read.
50
51 @return The value read.
52
53 **/
54 UINT32
55 UnalignedIoRead32 (
56 IN UINTN Port
57 );
58
59 #endif