summaryrefslogtreecommitdiff
path: root/DuetPkg/DxeIpl/Ia32
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-03 00:48:56 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-03 00:48:56 +0000
commit9008db4a285b14880d213a258d233da458dae8e3 (patch)
tree76018e0d76c88055d542b3db3873e241d1881082 /DuetPkg/DxeIpl/Ia32
parent3eb90413badc94ddeb9ebbda61e4d703e4a706d7 (diff)
downloadedk2-platforms-9008db4a285b14880d213a258d233da458dae8e3.tar.xz
Clean up DxeIpl:
1. Remove the assembly by using IoLib & BaseLib in MdePkg 2. Refine code to pass CYGWIN GCC tool chain build git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7404 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg/DxeIpl/Ia32')
-rw-r--r--DuetPkg/DxeIpl/Ia32/CpuIoAccess.asm62
-rw-r--r--DuetPkg/DxeIpl/Ia32/CpuIoAccessGnu.c27
-rw-r--r--DuetPkg/DxeIpl/Ia32/EnterDxeCore.asm64
-rw-r--r--DuetPkg/DxeIpl/Ia32/EnterDxeCore.c31
-rw-r--r--DuetPkg/DxeIpl/Ia32/EnterDxeCoreGnu.c16
5 files changed, 31 insertions, 169 deletions
diff --git a/DuetPkg/DxeIpl/Ia32/CpuIoAccess.asm b/DuetPkg/DxeIpl/Ia32/CpuIoAccess.asm
deleted file mode 100644
index 00a80ef75b..0000000000
--- a/DuetPkg/DxeIpl/Ia32/CpuIoAccess.asm
+++ /dev/null
@@ -1,62 +0,0 @@
- 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 \ No newline at end of file
diff --git a/DuetPkg/DxeIpl/Ia32/CpuIoAccessGnu.c b/DuetPkg/DxeIpl/Ia32/CpuIoAccessGnu.c
deleted file mode 100644
index 8e9ee2a073..0000000000
--- a/DuetPkg/DxeIpl/Ia32/CpuIoAccessGnu.c
+++ /dev/null
@@ -1,27 +0,0 @@
-UINT8
-EFIAPI
-CpuIoRead8 (
- IN UINT16 Port
- )
-{
- UINT8 Data;
- asm ( "inb %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)
- );
-} \ No newline at end of file
diff --git a/DuetPkg/DxeIpl/Ia32/EnterDxeCore.asm b/DuetPkg/DxeIpl/Ia32/EnterDxeCore.asm
deleted file mode 100644
index 0689a824c3..0000000000
--- a/DuetPkg/DxeIpl/Ia32/EnterDxeCore.asm
+++ /dev/null
@@ -1,64 +0,0 @@
- TITLE EnterDxeCore.asm: Assembly code for the entering DxeCore
-;------------------------------------------------------------------------------
-;*
-;* Copyright 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.
-;*
-;* EnterDxeCore.asm
-;*
-;* Abstract:
-;*
-;------------------------------------------------------------------------------
-
-.686p
-.model flat
-
-.code
-.stack
-.MMX
-.XMM
-
-;
-; VOID
-; EnterDxeMain (
-; IN VOID *StackTop,
-; IN VOID *DxeCoreEntryPoint,
-; IN VOID *Hob,
-; IN VOID *PageTable
-; )
-;
-EnterDxeMain PROC C \
- StackTop:DWORD, \
- DxeCoreEntryPoint:DWORD, \
- Hob:DWORD, \
- PageTable:DWORD
-
- mov eax, PageTable
-; mov cr3, eax ; load page table
-; mov eax, cr4
-; bts eax, 4 ; enable CR4.PSE
-; mov cr4, eax
-; mov eax, cr0
-; bts eax, 31 ; enable CR0.PG
-; mov cr0, eax
- mov ecx, DxeCoreEntryPoint
- mov eax, StackTop
- mov esp, eax
- mov edx, Hob
- push edx
- push 0
- jmp ecx
-
-; should never get here
- jmp $
- ret
-
-EnterDxeMain ENDP
-
-END
diff --git a/DuetPkg/DxeIpl/Ia32/EnterDxeCore.c b/DuetPkg/DxeIpl/Ia32/EnterDxeCore.c
new file mode 100644
index 0000000000..b8449140e7
--- /dev/null
+++ b/DuetPkg/DxeIpl/Ia32/EnterDxeCore.c
@@ -0,0 +1,31 @@
+/** @file
+ IA32 specific code to enter DxeCore
+
+Copyright (c) 2006 - 2007, 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.
+
+**/
+
+#include "DxeIpl.h"
+
+VOID
+EnterDxeMain (
+ IN VOID *StackTop,
+ IN VOID *DxeCoreEntryPoint,
+ IN VOID *Hob,
+ IN VOID *PageTable
+ )
+{
+ SwitchStack (
+ (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,
+ Hob,
+ NULL,
+ StackTop
+ );
+}
diff --git a/DuetPkg/DxeIpl/Ia32/EnterDxeCoreGnu.c b/DuetPkg/DxeIpl/Ia32/EnterDxeCoreGnu.c
deleted file mode 100644
index c502f8411b..0000000000
--- a/DuetPkg/DxeIpl/Ia32/EnterDxeCoreGnu.c
+++ /dev/null
@@ -1,16 +0,0 @@
-VOID
-EnterDxeMain (
- IN VOID *StackTop,
- IN VOID *DxeCoreEntryPoint,
- IN VOID *Hob,
- IN VOID *PageTable
- )
-{
- __asm__ ( "movl %0, %%esp \n\t"
- "pushl %2 \n\t"
- "pushl $0 \n\t"
- "movl %1, %%ecx \n\t"
- "jmp %%ecx"
- ::"q"(StackTop), "q"(DxeCoreEntryPoint), "q"(Hob)
- );
-} \ No newline at end of file