Complete coding to support X64 EFI ABI in UnixPkg. Code is not currently hooked in or tested, but it is code complete. Only missing step from testing is figuring out how to build with two different ABIs for the same platform. Sec needs a different ABI. May need to add a 2nd build step.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10710 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,3 +1,36 @@
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# This template was generated from GasketEfiTemplate.c Unix x86_64 ABI
|
||||
#
|
||||
# Efi Prefix means it has been ported to gasket EFIABI to Unix x86_64 ABI
|
||||
#
|
||||
# The EFI_UNIX_THUNK_PROTOCOL member functions call these these generic assembly
|
||||
# routines.
|
||||
#
|
||||
# Some OS X POSIX calls get name mangled in C code and we need to fill in a C global
|
||||
# to get the correct binding (does not work from assembly). So we have 4 functions
|
||||
# that do an indirect call, while the others call POSIX APIs directly
|
||||
#
|
||||
# movq _gUnixRmDir@GOTPCREL(%rip), %rax
|
||||
#
|
||||
#
|
||||
# UNIX Arg passing: RCX, RDX, R8, R9
|
||||
# EFI Arg passing: RDI, RDI, RDX, RCX, R8, R9
|
||||
#
|
||||
# RSI, RDI calle-save on EFI, scatch on UNIX callign
|
||||
#
|
||||
#
|
||||
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
#ifdef __APPLE__
|
||||
.section __DWARF,__debug_frame,regular,debug
|
||||
Lsection__debug_frame:
|
||||
.section __DWARF,__debug_info,regular,debug
|
||||
@@ -28,6 +61,8 @@ Ldebug_abbrev0:
|
||||
Ldebug_info0:
|
||||
.section __DWARF,__debug_line,regular,debug
|
||||
Ldebug_line0:
|
||||
#endif
|
||||
|
||||
.text
|
||||
Ltext0:
|
||||
.globl _Gasketrmdir
|
||||
@@ -50,6 +85,7 @@ LCFI2:
|
||||
.loc 1 37 0
|
||||
leave
|
||||
ret
|
||||
|
||||
LFE16:
|
||||
.globl _Gasketopendir
|
||||
_Gasketopendir:
|
||||
@@ -1069,6 +1105,7 @@ LCFI137:
|
||||
leave
|
||||
ret
|
||||
LFE62:
|
||||
|
||||
.globl _ReverseGasketUint64
|
||||
_ReverseGasketUint64:
|
||||
LFB63:
|
||||
@@ -1093,6 +1130,24 @@ LCFI140:
|
||||
.loc 1 418 0
|
||||
leave
|
||||
ret
|
||||
|
||||
.globl _EfiReverseGasketUint64
|
||||
_EfiReverseGasketUint64:
|
||||
pushq %rbp
|
||||
movq %rsp, %rbp
|
||||
subq $64, %rsp
|
||||
movq %rdi, -24(%rbp)
|
||||
movq %rsi, -32(%rbp)
|
||||
movq -24(%rbp), %rax
|
||||
movq %rax, -8(%rbp)
|
||||
movq -32(%rbp), %rcx
|
||||
movq -8(%rbp), %rax
|
||||
call *%rax
|
||||
leave
|
||||
ret
|
||||
|
||||
#if __APPLE__
|
||||
|
||||
LFE63:
|
||||
.section __DWARF,__debug_frame,regular,debug
|
||||
Lframe0:
|
||||
@@ -8777,3 +8832,6 @@ LASF10:
|
||||
LASF29:
|
||||
.ascii "Gasketfsync\0"
|
||||
.subsections_via_symbols
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -390,19 +390,13 @@ GasketUgaGetKey (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, EFI_INPUT_KEY *key)
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GasketUgaBlt (
|
||||
EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,
|
||||
EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,
|
||||
IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
|
||||
IN EFI_UGA_BLT_OPERATION BltOperation,
|
||||
IN UINTN SourceX,
|
||||
IN UINTN SourceY,
|
||||
IN UINTN DestinationX,
|
||||
IN UINTN DestinationY,
|
||||
IN UINTN Width,
|
||||
IN UINTN Height,
|
||||
IN UINTN Delta OPTIONAL
|
||||
IN UGA_BLT_ARGS *Args
|
||||
)
|
||||
{
|
||||
return UgaBlt (UgaIo, BltBuffer, BltOperation, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);
|
||||
return UgaBlt (UgaIo, BltBuffer, BltOperation, Args);
|
||||
}
|
||||
|
||||
typedef void (*SET_TIMER_CALLBACK)(UINT64 delta);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -20,8 +20,25 @@
|
||||
// So these globals get you the correct name mangled functions that can
|
||||
// be accessed from assembly
|
||||
//
|
||||
UnixRmDir gUnixRmDir = rmdir;
|
||||
UnixOpenDir gUnixOpenDir = opendir;
|
||||
UnixStat gUnixStat = (UnixStat)stat;
|
||||
UnixStatFs gUnixStatFs = statfs;
|
||||
UnixRmDir gUnixRmDir = rmdir;
|
||||
UnixOpenDir gUnixOpenDir = opendir;
|
||||
UnixStat gUnixStat = (UnixStat)stat;
|
||||
UnixStatFs gUnixStatFs = statfs;
|
||||
UnixReadDir gUnixReaddir = readdir;
|
||||
UnixRewindDir gUnixRewinddir = rewinddir;
|
||||
|
||||
int
|
||||
UnixIoCtl1 (
|
||||
int fd,
|
||||
unsigned long int __request,
|
||||
UINTN Arg
|
||||
)
|
||||
{
|
||||
return ioctl (fd, __request, Arg);
|
||||
}
|
||||
|
||||
int
|
||||
UnixFcntl1 (int __fd, int __cmd, UINTN Arg)
|
||||
{
|
||||
return fcntl (__fd, __cmd, Arg);
|
||||
}
|
@@ -22,35 +22,35 @@
|
||||
# Routine Description:
|
||||
#
|
||||
# Routine for switching stacks with 3 parameters EFI ABI
|
||||
# Convert UNIX to EFI ABI
|
||||
#
|
||||
# Arguments:
|
||||
#
|
||||
# (rcx) EntryPoint - Entry point with new stack.
|
||||
# (rdx) Context1 - Parameter1 for entry point.
|
||||
# (r8) Context2 - Parameter2 for entry point.
|
||||
# (r9) Context3 - Parameter3 for entry point.
|
||||
# (rsp)0x20 NewStack - The pointer to new stack.
|
||||
# (rdi) EntryPoint - Entry point with new stack.
|
||||
# (rsi) Context1 - Parameter1 for entry point. (rcx)
|
||||
# (rdx) Context2 - Parameter2 for entry point. (rdx)
|
||||
# (rcx) Context3 - Parameter3 for entry point. (r8)
|
||||
# (r8) NewStack - The pointer to new stack.
|
||||
#
|
||||
# Returns:
|
||||
#
|
||||
# None
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
ASM_GLOBAL ASM_PFX(MsftPeiSwitchStacks)
|
||||
ASM_PFX(MsftPeiSwitchStacks):
|
||||
mov %rcx, %rax
|
||||
mov %rdx, %rcx
|
||||
mov %r8, %rdx
|
||||
mov %r9, %r8
|
||||
ASM_GLOBAL ASM_PFX(GasketPeiSwitchStacks)
|
||||
ASM_PFX(GasketPeiSwitchStacks):
|
||||
// movq %rdx, %rdx
|
||||
movq %r8, %rsp
|
||||
|
||||
# get new stack from the stack
|
||||
mov 0x20(%rsp), %rsp # is this off by 8?
|
||||
movq %rdi, %rax
|
||||
movq %rsi, %rcx
|
||||
movq %rcx, %r8
|
||||
|
||||
#
|
||||
# Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,
|
||||
# in case the callee wishes to spill them.
|
||||
#
|
||||
lea -0x20(%rsp), %rsp
|
||||
subq 40, %rsp // 32-byte shadow space plus alignment pad
|
||||
call *%rax
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user