IntelFrameworkPkg/DxeIoLibCpuIo: Add new Fifo routines in IoLib class
[mirror_edk2.git] / OvmfPkg / Library / QemuFwCfgLib / X64 / IoLibExAsm.nasm
CommitLineData
f1ec65ba 1;------------------------------------------------------------------------------\r
2;\r
29874a8c 3; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
f1ec65ba 4; This program and the accompanying materials\r
5; are licensed and made available under the terms and conditions of the BSD License\r
6; which accompanies this distribution. The full text of the license may be found at\r
7; http://opensource.org/licenses/bsd-license.php.\r
8;\r
9; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11;\r
12;------------------------------------------------------------------------------\r
13\r
f0a07173
JJ
14 DEFAULT REL\r
15 SECTION .text\r
f1ec65ba 16\r
17;------------------------------------------------------------------------------\r
18; VOID\r
19; EFIAPI\r
20; IoReadFifo8 (\r
21; IN UINTN Port, // rcx\r
22; IN UINTN Size, // rdx\r
23; IN VOID *Buffer // r8\r
24; );\r
25;------------------------------------------------------------------------------\r
f0a07173
JJ
26global ASM_PFX(IoReadFifo8)\r
27ASM_PFX(IoReadFifo8):\r
f1ec65ba 28\r
29 xchg rcx, rdx\r
30 xchg rdi, r8 ; rdi: buffer address; r8: save rdi\r
31rep insb\r
32 mov rdi, r8 ; restore rdi\r
33 ret\r
34\r
29874a8c 35;------------------------------------------------------------------------------\r
36; VOID\r
37; EFIAPI\r
38; IoWriteFifo8 (\r
39; IN UINTN Port, // rcx\r
40; IN UINTN Size, // rdx\r
41; IN VOID *Buffer // r8\r
42; );\r
43;------------------------------------------------------------------------------\r
f0a07173
JJ
44global ASM_PFX(IoWriteFifo8)\r
45ASM_PFX(IoWriteFifo8):\r
29874a8c 46\r
47 xchg rcx, rdx\r
48 xchg rsi, r8 ; rdi: buffer address; r8: save rdi\r
49rep outsb\r
50 mov rsi, r8 ; restore rdi\r
51 ret\r
52\r