From ef03248cb5f7b6393db264dad9072a38909654cf Mon Sep 17 00:00:00 2001 From: klu2 Date: Mon, 2 Feb 2009 19:09:11 +0000 Subject: Add GCC assember for DxeIpl module git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7395 6f19259b-4bc3-4df7-8a09-765794883524 --- DuetPkg/DxeIpl/Ia32/CpuIoAccessGnu.c | 27 +++++++++++++++++++++++++++ DuetPkg/DxeIpl/Ia32/EnterDxeCoreGnu.c | 16 ++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 DuetPkg/DxeIpl/Ia32/CpuIoAccessGnu.c create mode 100644 DuetPkg/DxeIpl/Ia32/EnterDxeCoreGnu.c 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 -- cgit v1.2.3