audk/DuetPkg/DxeIpl/Ia32/CpuIoAccess.asm

62 lines
1.9 KiB
NASM

title CpuIoAccess.asm
;------------------------------------------------------------------------------
;
; Copyright (c) 2006, Intel Corporation
; All rights reserved. This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
; CpuIoAccess.asm
;
; Abstract:
; CPU IO Abstraction
;
;------------------------------------------------------------------------------
.686
.MODEL FLAT,C
.CODE
UINT8 TYPEDEF BYTE
UINT16 TYPEDEF WORD
UINT32 TYPEDEF DWORD
UINT64 TYPEDEF QWORD
UINTN TYPEDEF UINT32
;------------------------------------------------------------------------------
; UINT8
; CpuIoRead8 (
; IN UINT16 Port
; )
;------------------------------------------------------------------------------
CpuIoRead8 PROC PUBLIC Port:UINT16
mov dx, Port
in al, dx
ret
CpuIoRead8 ENDP
;------------------------------------------------------------------------------
; VOID
; CpuIoWrite8 (
; IN UINT16 Port,
; IN UINT32 Data
; )
;------------------------------------------------------------------------------
CpuIoWrite8 PROC PUBLIC Port:UINT16, Data:UINT32
mov eax, Data
mov dx, Port
out dx, al
ret
CpuIoWrite8 ENDP
END