]> git.proxmox.com Git - mirror_edk2.git/blob - DuetPkg/CpuIoDxe/X64/CpuIoAccess.asm
fa71762877d2290c25e806446da2540c7bf2b368
[mirror_edk2.git] / DuetPkg / CpuIoDxe / X64 / CpuIoAccess.asm
1 title CpuIoAccess.asm
2
3 ;------------------------------------------------------------------------------
4 ;*
5 ;* Copyright (c) 2005 - 2007, Intel Corporation
6 ;* All rights reserved. This program and the accompanying materials
7 ;* are licensed and made available under the terms and conditions of the BSD License
8 ;* which accompanies this 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 ;* Module Name:
15 ;* CpuIoAccess.asm
16 ;*
17 ;* Abstract:
18 ;* Supports x64 CPU IO operation
19 ;*
20 ;------------------------------------------------------------------------------
21 ;
22 ;
23 ;
24 ; Abstract:
25 ;
26 ;
27 ;------------------------------------------------------------------------------
28
29 .CODE
30
31 ;------------------------------------------------------------------------------
32 ; UINT8
33 ; CpuIoRead8 (
34 ; UINT16 Port // rcx
35 ; )
36 ;------------------------------------------------------------------------------
37 CpuIoRead8 PROC PUBLIC
38 xor eax, eax
39 mov dx, cx
40 in al, dx
41 ret
42 CpuIoRead8 ENDP
43
44 ;------------------------------------------------------------------------------
45 ; VOID
46 ; CpuIoWrite8 (
47 ; UINT16 Port, // rcx
48 ; UINT32 Data // rdx
49 ; )
50 ;------------------------------------------------------------------------------
51 CpuIoWrite8 PROC PUBLIC
52 mov eax, edx
53 mov dx, cx
54 out dx, al
55 ret
56 CpuIoWrite8 ENDP
57
58 ;------------------------------------------------------------------------------
59 ; UINT16
60 ; CpuIoRead16 (
61 ; UINT16 Port // rcx
62 ; )
63 ;------------------------------------------------------------------------------
64 CpuIoRead16 PROC PUBLIC
65 xor eax, eax
66 mov dx, cx
67 in ax, dx
68 ret
69 CpuIoRead16 ENDP
70
71 ;------------------------------------------------------------------------------
72 ; VOID
73 ; CpuIoWrite16 (
74 ; UINT16 Port, // rcx
75 ; UINT32 Data // rdx
76 ; )
77 ;------------------------------------------------------------------------------
78 CpuIoWrite16 PROC PUBLIC
79 mov eax, edx
80 mov dx, cx
81 out dx, ax
82 ret
83 CpuIoWrite16 ENDP
84
85 ;------------------------------------------------------------------------------
86 ; UINT32
87 ; CpuIoRead32 (
88 ; UINT16 Port // rcx
89 ; )
90 ;------------------------------------------------------------------------------
91 CpuIoRead32 PROC PUBLIC
92 mov dx, cx
93 in eax, dx
94 ret
95 CpuIoRead32 ENDP
96
97 ;------------------------------------------------------------------------------
98 ; VOID
99 ; CpuIoWrite32 (
100 ; UINT16 Port, // rcx
101 ; UINT32 Data // rdx
102 ; )
103 ;------------------------------------------------------------------------------
104 CpuIoWrite32 PROC PUBLIC
105 mov eax, edx
106 mov dx, cx
107 out dx, eax
108 ret
109 CpuIoWrite32 ENDP
110
111 END