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