summaryrefslogtreecommitdiff
path: root/UnixPkg/Sec/X64/MangleGasket.S
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-08-18 20:24:08 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-08-18 20:24:08 +0000
commitbb111c2346bef02c18b30acced3f7b0311bbfe21 (patch)
tree496916a37849ea45a4083848501de061a2b98732 /UnixPkg/Sec/X64/MangleGasket.S
parent6989af71680fc69024e68a0ab6d8284f0c4909fc (diff)
downloadedk2-platforms-bb111c2346bef02c18b30acced3f7b0311bbfe21.tar.xz
Added support for an EFI X64 ABI compatible UnixPkg. With an internal only compiler I've been able to run checked in X64 EFI shell binary! We are hoping to get the open source LLVM compiler working for this... Since the SEC has to be UNIX ABI to make the POSIX calls it is compiled using a different compiler and the rest of the UnixPkg is compiled with UNIXPKG tool. You just need to point UNIXPKG at your EFI X64 ABI compiler of choice, it should work like MYTOOLS. Some one may want to port this to Linux at some point. To build cd into UnixPkg and ./build64.sh
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10806 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg/Sec/X64/MangleGasket.S')
-rw-r--r--UnixPkg/Sec/X64/MangleGasket.S116
1 files changed, 110 insertions, 6 deletions
diff --git a/UnixPkg/Sec/X64/MangleGasket.S b/UnixPkg/Sec/X64/MangleGasket.S
index d496fcba15..f29b1e314d 100644
--- a/UnixPkg/Sec/X64/MangleGasket.S
+++ b/UnixPkg/Sec/X64/MangleGasket.S
@@ -166,7 +166,7 @@ _Gasketexit:
movq %rcx, %rdi // Swizzle args
call _exit // Less to do as we will never return to EFI ABI world
LDEAD_LOOP:
- jmp LDEAD_LOOP: // _exit should never return
+ jmp LDEAD_LOOP // _exit should never return
@@ -508,7 +508,6 @@ _Gaskettcflush:
popq %rdi // restore state
popq %rsi
ret
- call
.globl _GasketUgaCreate
@@ -566,7 +565,7 @@ _Gasketfcntl:
movq %rdx, %rsi
movq %r8, %rdx
- call _UnixFctl1
+ call _UnixFcntl1
popq %rdi // restore state
popq %rsi
@@ -754,7 +753,7 @@ _GasketUgaBlt:
popq %rdi // restore state
popq %rsi
-
+ ret
//
@@ -775,10 +774,115 @@ _ReverseGasketUint64:
movq %rcx, %r8
movq %r9, %rcx
- subq 40, %rsp // 32-byte shadow space plus alignment pad
+ subq $40, %rsp // 32-byte shadow space plus alignment pad
call *%rax
- addq 40, %rsp
+ addq $40, %rsp
ret
+// Sec PPI Callbacks
+
+.globl _GasketSecUnixPeiLoadFile
+_GasketSecUnixPeiLoadFile:
+ pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
+ pushq %rdi
+
+ movq %rcx, %rdi // Swizzle args
+ movq %rdx, %rsi
+ movq %r8, %rdx
+ movq %r9, %rcx
+
+ call _SecUnixPeiLoadFile
+
+ popq %rdi // restore state
+ popq %rsi
+ ret
+
+
+
+.globl _GasketSecUnixPeiAutoScan
+_GasketSecUnixPeiAutoScan:
+ pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
+ pushq %rdi
+
+ movq %rcx, %rdi // Swizzle args
+ movq %rdx, %rsi
+ movq %r8, %rdx
+
+ call _SecUnixPeiAutoScan
+
+ popq %rdi // restore state
+ popq %rsi
+ ret
+
+.globl _GasketSecUnixUnixThunkAddress
+_GasketSecUnixUnixThunkAddress:
+ pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
+ pushq %rdi
+
+ call _SecUnixUnixThunkAddress
+
+ popq %rdi // restore state
+ popq %rsi
+ ret
+
+
+.globl _GasketSecPeiReportStatusCode
+_GasketSecPeiReportStatusCode:
+ pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
+ pushq %rdi
+
+ movq %rcx, %rdi // Swizzle args
+ movq %rdx, %rsi
+ movq %r8, %rdx
+ movq %r9, %rcx
+ movq $0, %r8 // BugBug: This should come from the stack
+ movq $0, %r9 // But we can cheat since they are optional for bringup....
+
+ call _SecPeiReportStatusCode
+
+ popq %rdi // restore state
+ popq %rsi
+ ret
+
+
+.globl _GasketSecUnixFdAddress
+_GasketSecUnixFdAddress:
+ pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
+ pushq %rdi
+
+ movq %rcx, %rdi // Swizzle args
+ movq %rdx, %rsi
+ movq %r8, %rdx
+ movq %r9, %rcx
+
+ call _SecUnixFdAddress
+
+ popq %rdi // restore state
+ popq %rsi
+ ret
+
+
+
+
+.globl _GasketSecTemporaryRamSupport
+_GasketSecTemporaryRamSupport:
+ pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
+ pushq %rdi
+
+ movq %rcx, %rdi // Swizzle args
+ movq %rdx, %rsi
+ movq %r8, %rdx
+ movq %r9, %rcx
+
+ call _SecTemporaryRamSupport
+
+ popq %rdi // restore state
+ popq %rsi
+ ret
+
+
+
+
+