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 | .code
|
| 15 |
|
| 16 | ;------------------------------------------------------------------------------
|
| 17 | ; VOID
|
| 18 | ; EFIAPI
|
| 19 | ; IoReadFifo8 (
|
| 20 | ; IN UINTN Port, // rcx
|
| 21 | ; IN UINTN Size, // rdx
|
| 22 | ; IN VOID *Buffer // r8
|
| 23 | ; );
|
| 24 | ;------------------------------------------------------------------------------
|
| 25 | IoReadFifo8 PROC
|
| 26 | cld
|
| 27 | xchg rcx, rdx
|
| 28 | xchg rdi, r8 ; rdi: buffer address; r8: save rdi
|
| 29 | rep insb
|
| 30 | mov rdi, r8 ; restore rdi
|
| 31 | ret
|
| 32 | IoReadFifo8 ENDP
|
| 33 |
|
| 34 | ;------------------------------------------------------------------------------
|
| 35 | ; VOID
|
| 36 | ; EFIAPI
|
| 37 | ; IoReadFifo16 (
|
| 38 | ; IN UINTN Port, // rcx
|
| 39 | ; IN UINTN Size, // rdx
|
| 40 | ; IN VOID *Buffer // r8
|
| 41 | ; );
|
| 42 | ;------------------------------------------------------------------------------
|
| 43 | IoReadFifo16 PROC
|
| 44 | cld
|
| 45 | xchg rcx, rdx
|
| 46 | xchg rdi, r8 ; rdi: buffer address; r8: save rdi
|
| 47 | rep insw
|
| 48 | mov rdi, r8 ; restore rdi
|
| 49 | ret
|
| 50 | IoReadFifo16 ENDP
|
| 51 |
|
| 52 | ;------------------------------------------------------------------------------
|
| 53 | ; VOID
|
| 54 | ; EFIAPI
|
| 55 | ; IoReadFifo32 (
|
| 56 | ; IN UINTN Port, // rcx
|
| 57 | ; IN UINTN Size, // rdx
|
| 58 | ; IN VOID *Buffer // r8
|
| 59 | ; );
|
| 60 | ;------------------------------------------------------------------------------
|
| 61 | IoReadFifo32 PROC
|
| 62 | cld
|
| 63 | xchg rcx, rdx
|
| 64 | xchg rdi, r8 ; rdi: buffer address; r8: save rdi
|
| 65 | rep insd
|
| 66 | mov rdi, r8 ; restore rdi
|
| 67 | ret
|
| 68 | IoReadFifo32 ENDP
|
| 69 |
|
| 70 | ;------------------------------------------------------------------------------
|
| 71 | ; VOID
|
| 72 | ; EFIAPI
|
| 73 | ; IoWriteFifo8 (
|
| 74 | ; IN UINTN Port, // rcx
|
| 75 | ; IN UINTN Size, // rdx
|
| 76 | ; IN VOID *Buffer // r8
|
| 77 | ; );
|
| 78 | ;------------------------------------------------------------------------------
|
| 79 | IoWriteFifo8 PROC
|
| 80 | cld
|
| 81 | xchg rcx, rdx
|
| 82 | xchg rsi, r8 ; rsi: buffer address; r8: save rsi
|
| 83 | rep outsb
|
| 84 | mov rsi, r8 ; restore rsi
|
| 85 | ret
|
| 86 | IoWriteFifo8 ENDP
|
| 87 |
|
| 88 | ;------------------------------------------------------------------------------
|
| 89 | ; VOID
|
| 90 | ; EFIAPI
|
| 91 | ; IoWriteFifo16 (
|
| 92 | ; IN UINTN Port, // rcx
|
| 93 | ; IN UINTN Size, // rdx
|
| 94 | ; IN VOID *Buffer // r8
|
| 95 | ; );
|
| 96 | ;------------------------------------------------------------------------------
|
| 97 | IoWriteFifo16 PROC
|
| 98 | cld
|
| 99 | xchg rcx, rdx
|
| 100 | xchg rsi, r8 ; rsi: buffer address; r8: save rsi
|
| 101 | rep outsw
|
| 102 | mov rsi, r8 ; restore rsi
|
| 103 | ret
|
| 104 | IoWriteFifo16 ENDP
|
| 105 |
|
| 106 | ;------------------------------------------------------------------------------
|
| 107 | ; VOID
|
| 108 | ; EFIAPI
|
| 109 | ; IoWriteFifo32 (
|
| 110 | ; IN UINTN Port, // rcx
|
| 111 | ; IN UINTN Size, // rdx
|
| 112 | ; IN VOID *Buffer // r8
|
| 113 | ; );
|
| 114 | ;------------------------------------------------------------------------------
|
| 115 | IoWriteFifo32 PROC
|
| 116 | cld
|
| 117 | xchg rcx, rdx
|
| 118 | xchg rsi, r8 ; rsi: buffer address; r8: save rsi
|
| 119 | rep outsd
|
| 120 | mov rsi, r8 ; restore rsi
|
| 121 | ret
|
| 122 | IoWriteFifo32 ENDP
|
| 123 |
|
| 124 | END
|
| 125 |
|