diff options
-rw-r--r-- | DuetPkg/DxeIpl/Ia32/CpuIoAccessGnu.c | 27 | ||||
-rw-r--r-- | DuetPkg/DxeIpl/Ia32/EnterDxeCoreGnu.c | 16 |
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 |