diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-02-03 00:45:16 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-02-03 00:45:16 +0000 |
commit | 8c7f0932d6a9649bad1c0d9318473b5652b808ec (patch) | |
tree | 3f5b5e0dba00f5ba047d590d48466fcb85652a7d /DuetPkg/CpuIoDxe/Ia32 | |
parent | 8e6a99100cc77532fffc84f53ae3b6d167389ab9 (diff) | |
download | edk2-platforms-8c7f0932d6a9649bad1c0d9318473b5652b808ec.tar.xz |
Clean up CpuIoDxe:
1. Remove the assembly files by using IoLib in MdePkg.
2. Remove the unused DXS file.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7402 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg/CpuIoDxe/Ia32')
-rw-r--r-- | DuetPkg/CpuIoDxe/Ia32/CpuIoAccess.asm | 120 | ||||
-rw-r--r-- | DuetPkg/CpuIoDxe/Ia32/CpuIoAccessGNU.c | 134 |
2 files changed, 0 insertions, 254 deletions
diff --git a/DuetPkg/CpuIoDxe/Ia32/CpuIoAccess.asm b/DuetPkg/CpuIoDxe/Ia32/CpuIoAccess.asm deleted file mode 100644 index 07b14ea554..0000000000 --- a/DuetPkg/CpuIoDxe/Ia32/CpuIoAccess.asm +++ /dev/null @@ -1,120 +0,0 @@ - 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
\ No newline at end of file diff --git a/DuetPkg/CpuIoDxe/Ia32/CpuIoAccessGNU.c b/DuetPkg/CpuIoDxe/Ia32/CpuIoAccessGNU.c deleted file mode 100644 index 592eb0fdfb..0000000000 --- a/DuetPkg/CpuIoDxe/Ia32/CpuIoAccessGNU.c +++ /dev/null @@ -1,134 +0,0 @@ -/* This file is only used when not able to compile the MASM CpuIoAccess.asm
- NOTE: Compiling with -fomit-frame-pointer would get you to roughly the exact
- same code as the MASM file although GCC will typically include movzbl %al, %eax
- or movzwl %ax, %eax instructions on the read functions such that the entire
- eax result register will be valid, not just the lowest 8 or 16 bits.
- */
-#ifdef __GNUC__
-
-/* A quick note about GCC inline asm and the GNU assembler:
- When gas encounters an instruction with a suffix (e.g. inb, inw, or inl vs. just in) it will
- warn if the operand corresponding to the suffix is not of the correct size and will assume you
- meant what you said when you specified the suffix.
-
- Because GCC does not enable us to see whether it is replacing %0 with %al, %ax, or %eax it is
- helpful to have the assembler warn us that GCC is making an incorrect assumption. The actual
- in or out instruction will always be generated correctly in this case since the assembler is
- correct in assuming we meant what we said when we specified the suffix. However, GCC might
- generate incorrect surrounding code. For example, if we were to incorrectly specify the
- output size of an in instruction as UINT32, GCC would potentially fail to issue movz(b|w)l after
- it under the assumption that the in instruction filled the entire eax register and not just
- the al or ax portion.
-
- GCC determines which size of register to use based on the C data type. So for in instructions
- the interesting type is that of the automatic variable named Data which is specified as an
- output operand to the inline assembly statement. For example:
-
- UINT8 Data;
- asm ( "inb %1, %0"
- : "=a"(Data)
- : "d"(Port)
- );
- return Data;
-
- In this case, GCC will replace %0 with %al. If Data had been specified as UINT16, it would replace
- %0 with %ax, and for UINT32 with %eax.
-
- Likewise in the case of IA32 out instructions, GCC will replace %0 with the appropriately sized
- register based on the size of the input operand. There is one gotcha though. The CpuIoWrite
- series of functions all use UINT32 as the type of the second (Data) argument. This means that
- for GCC to output the correct register size we must cast it appropriately.
-
- The Port number is always a UINT16 so GCC will always ouput %dx.
- */
-
-#include "CpuIoAccess.h"
-
-UINT8
-EFIAPI
-CpuIoRead8 (
- IN UINT16 Port
- )
-{
- UINT8 Data;
- asm ( "inb %1, %0"
- : "=a"(Data)
- : "d"(Port)
- );
- return Data;
-}
-
-UINT16
-EFIAPI
-CpuIoRead16 (
- IN UINT16 Port
- )
-{
- UINT16 Data;
- asm ( "inw %1, %0"
- : "=a"(Data)
- : "d"(Port)
- );
- return Data;
-}
-
-UINT32
-EFIAPI
-CpuIoRead32 (
- IN UINT16 Port
- )
-{
- UINT32 Data;
- asm ( "inl %1, %0"
- : "=a"(Data)
- : "d"(Port)
- );
- return Data;
-}
-
-VOID
-EFIAPI
-CpuIoWrite8 (
- IN UINT16 Port,
- IN UINT32 Data
- )
-{
- asm ( "outb %1, %0"
- : /* No outputs */
- : "d"(Port)
- , "a"((UINT8)Data)
- );
-}
-
-VOID
-EFIAPI
-CpuIoWrite16 (
- IN UINT16 Port,
- IN UINT32 Data
- )
-{
- asm ( "outw %1, %0"
- : /* No outputs */
- : "d"(Port)
- , "a"((UINT16)Data)
- );
-}
-
-VOID
-EFIAPI
-CpuIoWrite32 (
- IN UINT16 Port,
- IN UINT32 Data
- )
-{
- asm ( "outl %1, %0"
- : /* No outputs */
- : "d"(Port)
- /* NOTE: Cast is technically unnecessary but we use it to illustrate
- that we always want to output a UINT32 and never anything else.
- */
- , "a"((UINT32)Data)
- );
-}
-
-#endif /* def __GNUC__ */
|