Porting Duet module from EDKI to EDKII

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5076 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2
2008-04-17 05:48:13 +00:00
parent fcf03596d1
commit c69dd9dfad
77 changed files with 26415 additions and 13 deletions

View File

@@ -0,0 +1,120 @@
title CpuIoAccess.asm
;------------------------------------------------------------------------------
;*
;* Copyright (c) 2005, 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:
;* Supports IA32 CPU IO operation
;*
;------------------------------------------------------------------------------
;
;
;------------------------------------------------------------------------------
.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
;------------------------------------------------------------------------------
; UINT16
; CpuIoRead16 (
; IN UINT16 Port
; )
;------------------------------------------------------------------------------
CpuIoRead16 PROC PUBLIC Port:UINT16
mov dx, Port
in ax, dx
ret
CpuIoRead16 ENDP
;------------------------------------------------------------------------------
; UINT32
; CpuIoRead32 (
; IN UINT16 Port
; )
;------------------------------------------------------------------------------
CpuIoRead32 PROC PUBLIC Port:UINT16
mov dx, Port
in eax, dx
ret
CpuIoRead32 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
;------------------------------------------------------------------------------
; VOID
; CpuIoWrite16 (
; IN UINT16 Port,
; IN UINT32 Data
; )
;------------------------------------------------------------------------------
CpuIoWrite16 PROC PUBLIC Port:UINT16, Data:UINT32
mov eax, Data
mov dx, Port
out dx, ax
ret
CpuIoWrite16 ENDP
;------------------------------------------------------------------------------
; VOID
; CpuIoWrite32 (
; IN UINT16 Port,
; IN UINT32 Data
; )
;------------------------------------------------------------------------------
CpuIoWrite32 PROC PUBLIC Port:UINT16, Data:UINT32
mov eax, Data
mov dx, Port
out dx, eax
ret
CpuIoWrite32 ENDP
END