Vishal Bhoj | 82c8071 | 2015-12-15 21:13:33 +0530 | [diff] [blame] | 1 | #------------------------------------------------------------------------------
|
| 2 | #
|
| 3 | # Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
| 4 | # This program and the accompanying materials
|
| 5 | # are licensed and made available under the terms and conditions of the BSD License
|
| 6 | # which accompanies this distribution. The full text of the license may be found at
|
| 7 | # http://opensource.org/licenses/bsd-license.php.
|
| 8 | #
|
| 9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
| 10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
| 11 | #
|
| 12 | #------------------------------------------------------------------------------
|
| 13 |
|
| 14 | #------------------------------------------------------------------------------
|
| 15 | # VOID
|
| 16 | # EFIAPI
|
| 17 | # IoReadFifo8 (
|
| 18 | # IN UINTN Port, // rcx
|
| 19 | # IN UINTN Count, // rdx
|
| 20 | # IN VOID *Buffer // r8
|
| 21 | # );
|
| 22 | #------------------------------------------------------------------------------
|
| 23 | ASM_GLOBAL ASM_PFX(IoReadFifo8)
|
| 24 | ASM_PFX(IoReadFifo8):
|
| 25 | cld
|
| 26 | xchg %rcx, %rdx
|
| 27 | xchg %r8, %rdi # rdi: buffer address; r8: save register
|
| 28 | rep insb
|
| 29 | mov %r8, %rdi # restore rdi
|
| 30 | ret
|
| 31 |
|
| 32 | #------------------------------------------------------------------------------
|
| 33 | # VOID
|
| 34 | # EFIAPI
|
| 35 | # IoReadFifo16 (
|
| 36 | # IN UINTN Port, // rcx
|
| 37 | # IN UINTN Count, // rdx
|
| 38 | # IN VOID *Buffer // r8
|
| 39 | # );
|
| 40 | #------------------------------------------------------------------------------
|
| 41 | ASM_GLOBAL ASM_PFX(IoReadFifo16)
|
| 42 | ASM_PFX(IoReadFifo16):
|
| 43 | cld
|
| 44 | xchg %rcx, %rdx
|
| 45 | xchg %r8, %rdi # rdi: buffer address; r8: save register
|
| 46 | rep insw
|
| 47 | mov %r8, %rdi # restore rdi
|
| 48 | ret
|
| 49 |
|
| 50 | #------------------------------------------------------------------------------
|
| 51 | # VOID
|
| 52 | # EFIAPI
|
| 53 | # IoReadFifo32 (
|
| 54 | # IN UINTN Port, // rcx
|
| 55 | # IN UINTN Count, // rdx
|
| 56 | # IN VOID *Buffer // r8
|
| 57 | # );
|
| 58 | #------------------------------------------------------------------------------
|
| 59 | ASM_GLOBAL ASM_PFX(IoReadFifo32)
|
| 60 | ASM_PFX(IoReadFifo32):
|
| 61 | cld
|
| 62 | xchg %rcx, %rdx
|
| 63 | xchg %r8, %rdi # rdi: buffer address; r8: save register
|
| 64 | rep insl
|
| 65 | mov %r8, %rdi # restore rdi
|
| 66 | ret
|
| 67 |
|
| 68 | #------------------------------------------------------------------------------
|
| 69 | # VOID
|
| 70 | # EFIAPI
|
| 71 | # IoWriteFifo8 (
|
| 72 | # IN UINTN Port, // rcx
|
| 73 | # IN UINTN Count, // rdx
|
| 74 | # IN VOID *Buffer // r8
|
| 75 | # );
|
| 76 | #------------------------------------------------------------------------------
|
| 77 | ASM_GLOBAL ASM_PFX(IoWriteFifo8)
|
| 78 | ASM_PFX(IoWriteFifo8):
|
| 79 | cld
|
| 80 | xchg %rcx, %rdx
|
| 81 | xchg %r8, %rsi # rsi: buffer address; r8: save register
|
| 82 | rep outsb
|
| 83 | mov %r8, %rsi # restore rsi
|
| 84 | ret
|
| 85 |
|
| 86 | #------------------------------------------------------------------------------
|
| 87 | # VOID
|
| 88 | # EFIAPI
|
| 89 | # IoWriteFifo16 (
|
| 90 | # IN UINTN Port, // rcx
|
| 91 | # IN UINTN Count, // rdx
|
| 92 | # IN VOID *Buffer // r8
|
| 93 | # );
|
| 94 | #------------------------------------------------------------------------------
|
| 95 | ASM_GLOBAL ASM_PFX(IoWriteFifo16)
|
| 96 | ASM_PFX(IoWriteFifo16):
|
| 97 | cld
|
| 98 | xchg %rcx, %rdx
|
| 99 | xchg %r8, %rsi # rsi: buffer address; r8: save register
|
| 100 | rep outsw
|
| 101 | mov %r8, %rsi # restore rsi
|
| 102 | ret
|
| 103 |
|
| 104 | #------------------------------------------------------------------------------
|
| 105 | # VOID
|
| 106 | # EFIAPI
|
| 107 | # IoWriteFifo32 (
|
| 108 | # IN UINTN Port, // rcx
|
| 109 | # IN UINTN Count, // rdx
|
| 110 | # IN VOID *Buffer // r8
|
| 111 | # );
|
| 112 | #------------------------------------------------------------------------------
|
| 113 | ASM_GLOBAL ASM_PFX(IoWriteFifo32)
|
| 114 | ASM_PFX(IoWriteFifo32):
|
| 115 | cld
|
| 116 | xchg %rcx, %rdx
|
| 117 | xchg %r8, %rsi # rsi: buffer address; r8: save register
|
| 118 | rep outsl
|
| 119 | mov %r8, %rsi # restore rsi
|
| 120 | ret
|
| 121 |
|