diff options
Diffstat (limited to 'UnixPkg/Sec/X64')
-rw-r--r-- | UnixPkg/Sec/X64/Gasket.S | 33 | ||||
-rw-r--r-- | UnixPkg/Sec/X64/MangleGasket.S | 116 | ||||
-rw-r--r-- | UnixPkg/Sec/X64/SwitchStack.S | 10 |
3 files changed, 148 insertions, 11 deletions
diff --git a/UnixPkg/Sec/X64/Gasket.S b/UnixPkg/Sec/X64/Gasket.S index 2797d84de6..4d6123f555 100644 --- a/UnixPkg/Sec/X64/Gasket.S +++ b/UnixPkg/Sec/X64/Gasket.S @@ -1146,6 +1146,39 @@ _EfiReverseGasketUint64: leave ret +// Sec PPI Callbacks + +.globl _GasketSecUnixPeiLoadFile +_GasketSecUnixPeiLoadFile: + jmp _SecUnixPeiLoadFile + + +.globl _GasketSecUnixPeiAutoScan +_GasketSecUnixPeiAutoScan: + jmp _SecUnixPeiAutoScan + + +.globl _GasketSecUnixUnixThunkAddress +_GasketSecUnixUnixThunkAddress: + jmp _SecUnixUnixThunkAddress + + +.globl _GasketSecPeiReportStatusCode +_GasketSecPeiReportStatusCode: + jmp _SecPeiReportStatusCode + + +.globl _GasketSecUnixFdAddress +_GasketSecUnixFdAddress: + jmp _SecUnixFdAddress + + +.globl _GasketSecTemporaryRamSupport +_GasketSecTemporaryRamSupport: + jmp _SecTemporaryRamSupport + + + #if __APPLE__ LFE63: 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 + + + + + diff --git a/UnixPkg/Sec/X64/SwitchStack.S b/UnixPkg/Sec/X64/SwitchStack.S index 9f62e71cef..dfb618b395 100644 --- a/UnixPkg/Sec/X64/SwitchStack.S +++ b/UnixPkg/Sec/X64/SwitchStack.S @@ -37,8 +37,8 @@ # None
#
#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(GasketPeiSwitchStacks)
-ASM_PFX(GasketPeiSwitchStacks):
+ASM_GLOBAL ASM_PFX(PeiSwitchStacks)
+ASM_PFX(PeiSwitchStacks):
// movq %rdx, %rdx
movq %r8, %rsp
@@ -50,7 +50,7 @@ ASM_PFX(GasketPeiSwitchStacks): # Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,
# in case the callee wishes to spill them.
#
- subq 40, %rsp // 32-byte shadow space plus alignment pad
+ subq $40, %rsp // 32-byte shadow space plus alignment pad
call *%rax
@@ -72,8 +72,8 @@ ASM_PFX(GasketPeiSwitchStacks): # None
#
#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(PeiSwitchStacks)
-ASM_PFX(PeiSwitchStacks):
+ASM_GLOBAL ASM_PFX(UnixPeiSwitchStacks)
+ASM_PFX(UnixPeiSwitchStacks):
mov %rdi, %rax
mov %rsi, %rdi
mov %rdx, %rsi
|