summaryrefslogtreecommitdiff
path: root/DuetPkg/DxeIpl/Ia32
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-02 19:09:11 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-02 19:09:11 +0000
commitef03248cb5f7b6393db264dad9072a38909654cf (patch)
tree00fc6ab57977e0382226a93d10eb43b73eb5f0b4 /DuetPkg/DxeIpl/Ia32
parent57dfc48f933ce50c2d269e66eec7bab0c66938d6 (diff)
downloadedk2-platforms-ef03248cb5f7b6393db264dad9072a38909654cf.tar.xz
Add GCC assember for DxeIpl module
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7395 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg/DxeIpl/Ia32')
-rw-r--r--DuetPkg/DxeIpl/Ia32/CpuIoAccessGnu.c27
-rw-r--r--DuetPkg/DxeIpl/Ia32/EnterDxeCoreGnu.c16
2 files changed, 43 insertions, 0 deletions
diff --git a/DuetPkg/DxeIpl/Ia32/CpuIoAccessGnu.c b/DuetPkg/DxeIpl/Ia32/CpuIoAccessGnu.c
new file mode 100644
index 0000000000..8e9ee2a073
--- /dev/null
+++ b/DuetPkg/DxeIpl/Ia32/CpuIoAccessGnu.c
@@ -0,0 +1,27 @@
+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/EnterDxeCoreGnu.c b/DuetPkg/DxeIpl/Ia32/EnterDxeCoreGnu.c
new file mode 100644
index 0000000000..c502f8411b
--- /dev/null
+++ b/DuetPkg/DxeIpl/Ia32/EnterDxeCoreGnu.c
@@ -0,0 +1,16 @@
+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