MdePkg: Expand BaseIoLibIntrinsic (IoLib class) library
[mirror_edk2.git] / UefiCpuPkg / CpuIo2Dxe / Ia32 / IoFifo.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
4 ;
5 ; This program and the accompanying materials are licensed and made available
6 ; under the terms and conditions of the BSD License which accompanies this
7 ; distribution. The full text of the license may be found at
8 ; http://opensource.org/licenses/bsd-license.php.
9 ;
10 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 ;
13 ;------------------------------------------------------------------------------
14
15 SECTION .text
16
17 ;------------------------------------------------------------------------------
18 ; VOID
19 ; EFIAPI
20 ; IoReadFifo8 (
21 ; IN UINTN Port,
22 ; IN UINTN Size,
23 ; IN VOID *Buffer
24 ; );
25 ;------------------------------------------------------------------------------
26 global ASM_PFX(IoReadFifo8)
27 ASM_PFX(IoReadFifo8):
28 push edi
29 cld
30 mov dx, [esp + 8]
31 mov ecx, [esp + 12]
32 mov edi, [esp + 16]
33 rep insb
34 pop edi
35 ret
36
37 ;------------------------------------------------------------------------------
38 ; VOID
39 ; EFIAPI
40 ; IoReadFifo16 (
41 ; IN UINTN Port,
42 ; IN UINTN Size,
43 ; IN VOID *Buffer
44 ; );
45 ;------------------------------------------------------------------------------
46 global ASM_PFX(IoReadFifo16)
47 ASM_PFX(IoReadFifo16):
48 push edi
49 cld
50 mov dx, [esp + 8]
51 mov ecx, [esp + 12]
52 mov edi, [esp + 16]
53 rep insw
54 pop edi
55 ret
56
57 ;------------------------------------------------------------------------------
58 ; VOID
59 ; EFIAPI
60 ; IoReadFifo32 (
61 ; IN UINTN Port,
62 ; IN UINTN Size,
63 ; IN VOID *Buffer
64 ; );
65 ;------------------------------------------------------------------------------
66 global ASM_PFX(IoReadFifo32)
67 ASM_PFX(IoReadFifo32):
68 push edi
69 cld
70 mov dx, [esp + 8]
71 mov ecx, [esp + 12]
72 mov edi, [esp + 16]
73 rep insd
74 pop edi
75 ret
76
77 ;------------------------------------------------------------------------------
78 ; VOID
79 ; EFIAPI
80 ; IoWriteFifo8 (
81 ; IN UINTN Port,
82 ; IN UINTN Size,
83 ; IN VOID *Buffer
84 ; );
85 ;------------------------------------------------------------------------------
86 global ASM_PFX(IoWriteFifo8)
87 ASM_PFX(IoWriteFifo8):
88 push esi
89 cld
90 mov dx, [esp + 8]
91 mov ecx, [esp + 12]
92 mov esi, [esp + 16]
93 rep outsb
94 pop esi
95 ret
96
97 ;------------------------------------------------------------------------------
98 ; VOID
99 ; EFIAPI
100 ; IoWriteFifo16 (
101 ; IN UINTN Port,
102 ; IN UINTN Size,
103 ; IN VOID *Buffer
104 ; );
105 ;------------------------------------------------------------------------------
106 global ASM_PFX(IoWriteFifo16)
107 ASM_PFX(IoWriteFifo16):
108 push esi
109 cld
110 mov dx, [esp + 8]
111 mov ecx, [esp + 12]
112 mov esi, [esp + 16]
113 rep outsw
114 pop esi
115 ret
116
117 ;------------------------------------------------------------------------------
118 ; VOID
119 ; EFIAPI
120 ; IoWriteFifo32 (
121 ; IN UINTN Port,
122 ; IN UINTN Size,
123 ; IN VOID *Buffer
124 ; );
125 ;------------------------------------------------------------------------------
126 global ASM_PFX(IoWriteFifo32)
127 ASM_PFX(IoWriteFifo32):
128 push esi
129 cld
130 mov dx, [esp + 8]
131 mov ecx, [esp + 12]
132 mov esi, [esp + 16]
133 rep outsd
134 pop esi
135 ret
136