2010-07-24 02:21:06 +02:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# This template was generated from GasketEfiTemplate.c 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
|
2010-07-29 05:24:13 +02:00
|
|
|
# EFI Arg passing: RDI, RSI, RDX, RCX, R8, R9
|
2010-07-24 02:21:06 +02:00
|
|
|
# Callee allocates 32 bytes on stack to spill registers
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
//
|
|
|
|
// Gaskets are EFI ABI to UNIX ABI calls
|
|
|
|
// EFI ABI code will sub 40 (0x28) from %rsp before calling a function
|
|
|
|
// This is the 32 (0x20) byte to spill registers and 8 bytes to align stack on 16 byte boundry.
|
|
|
|
//
|
2010-07-24 02:21:06 +02:00
|
|
|
.text
|
2010-07-29 05:24:13 +02:00
|
|
|
|
|
|
|
// 32 byte shadow to spill rcx-r9, 8 bytes to align stack on 16 byte boundry
|
|
|
|
// Any call with 0 - 4 arguments allocates 40 bytes on the stack.
|
|
|
|
// For more than 4 args you always have to increase in quanta of 16 so 5 or 6 args is 56,
|
|
|
|
// 7 or 8 args is 72, and 9 or 10 args is 88
|
|
|
|
#define EFI_STACK_SHADOW_SPACE 40
|
|
|
|
#define EFI_STACK_SHADOW_SPACE_5_6 56
|
|
|
|
#define EFI_STACK_SHADOW_SPACE_7_8 72
|
|
|
|
#define EFI_STACK_SHADOW_SPACE_9_10 88
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketrmdir
|
|
|
|
_Gasketrmdir:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
2010-07-24 02:21:06 +02:00
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
movq %rcx, %rdi // Swizzle args
|
2010-07-24 02:21:06 +02:00
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
movq _gUnixRmDir@GOTPCREL(%rip), %rax // Get function name mangled by C
|
|
|
|
movq (%rax), %rax
|
2010-07-24 02:21:06 +02:00
|
|
|
call *%rax
|
2010-07-29 05:24:13 +02:00
|
|
|
|
|
|
|
pushq %rdi // restore state
|
|
|
|
pushq %rsi
|
|
|
|
ret
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
|
|
|
|
.globl _Gasketopendir
|
|
|
|
_Gasketopendir:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
2010-07-24 02:21:06 +02:00
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
movq %rcx, %rdi // Swizzle args
|
2010-07-24 02:21:06 +02:00
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
movq _gUnixOpenDir@GOTPCREL(%rip), %rax // Get function name mangled by C
|
|
|
|
movq (%rax), %rax
|
2010-07-24 02:21:06 +02:00
|
|
|
call *%rax
|
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
popq %rdi // restore state
|
2010-07-24 02:21:06 +02:00
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.globl _Gasketstat
|
|
|
|
_Gasketstat:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
2010-07-24 02:21:06 +02:00
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
movq _gUnixStat@GOTPCREL(%rip), %rax // Get function name mangled by C
|
|
|
|
movq (%rax), %rax
|
2010-07-24 02:21:06 +02:00
|
|
|
call *%rax
|
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
popq %rdi // restore state
|
2010-07-24 02:21:06 +02:00
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
.globl _Gasketstatfs
|
|
|
|
_Gasketstatfs:
|
2010-07-29 05:24:13 +02:00
|
|
|
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 _gUnixStatFs@GOTPCREL(%rip), %rax // Get function name mangled by C
|
2010-07-24 02:21:06 +02:00
|
|
|
movq (%rax), %rax
|
2010-07-29 05:24:13 +02:00
|
|
|
call *%rax
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
.globl _Gasketrewinddir
|
|
|
|
_Gasketrewinddir:
|
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
2010-07-24 02:21:06 +02:00
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
movq _gUnixRewinddir@GOTPCREL(%rip), %rax // Get function name mangled by C
|
|
|
|
movq (%rax), %rax
|
2010-07-24 02:21:06 +02:00
|
|
|
call *%rax
|
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
popq %rdi // restore state
|
2010-07-24 02:21:06 +02:00
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
.globl _Gasketreaddir
|
|
|
|
_Gasketreaddir:
|
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
2010-07-24 02:21:06 +02:00
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
|
|
|
|
movq _gUnixReaddir@GOTPCREL(%rip), %rax // Get function name mangled by C
|
|
|
|
movq (%rax), %rax
|
|
|
|
call *%rax
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
|
|
|
|
.globl _GasketmsSleep
|
|
|
|
_GasketmsSleep:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
2010-07-24 02:21:06 +02:00
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
movq %rcx, %rdi // Swizzle args
|
2010-07-24 02:21:06 +02:00
|
|
|
|
|
|
|
call _msSleep
|
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
popq %rdi // restore state
|
2010-07-24 02:21:06 +02:00
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
.globl _Gasketexit
|
|
|
|
_Gasketexit:
|
2010-07-29 05:24:13 +02:00
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
call _exit // Less to do as we will never return to EFI ABI world
|
2010-07-24 02:21:06 +02:00
|
|
|
LDEAD_LOOP:
|
2010-07-29 05:24:13 +02:00
|
|
|
jmp LDEAD_LOOP: // _exit should never return
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
.globl _GasketSetTimer
|
|
|
|
_GasketSetTimer:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
call _SetTimer
|
2010-07-29 05:24:13 +02:00
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketGetLocalTime
|
|
|
|
_GasketGetLocalTime:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
call _GetLocalTime
|
2010-07-29 05:24:13 +02:00
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketgmtime
|
|
|
|
_Gasketgmtime:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
call _localtime
|
2010-07-29 05:24:13 +02:00
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketGetTimeZone
|
|
|
|
_GasketGetTimeZone:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
call _GetTimeZone
|
2010-07-29 05:24:13 +02:00
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketGetDayLight
|
|
|
|
_GasketGetDayLight:
|
|
|
|
LFB26:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
call _GetDayLight
|
2010-07-29 05:24:13 +02:00
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketpoll
|
|
|
|
_Gasketpoll:
|
2010-07-29 05:24:13 +02:00
|
|
|
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 _poll
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketread
|
|
|
|
_Gasketread:
|
2010-07-29 05:24:13 +02:00
|
|
|
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 _read
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketwrite
|
|
|
|
_Gasketwrite:
|
2010-07-29 05:24:13 +02:00
|
|
|
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 _write
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketgetenv
|
|
|
|
_Gasketgetenv:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
|
|
|
|
call _getenv
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketopen
|
|
|
|
_Gasketopen:
|
2010-07-29 05:24:13 +02:00
|
|
|
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 _open
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketlseek
|
|
|
|
_Gasketlseek:
|
2010-07-29 05:24:13 +02:00
|
|
|
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 _lseek
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketftruncate
|
|
|
|
_Gasketftruncate:
|
2010-07-29 05:24:13 +02:00
|
|
|
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 _ftruncate
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketclose
|
|
|
|
_Gasketclose:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
|
|
|
|
call _close
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketmkdir
|
|
|
|
_Gasketmkdir:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _mkdir
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketunlink
|
|
|
|
_Gasketunlink:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
|
|
|
|
call _unlink
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketGetErrno
|
|
|
|
_GasketGetErrno:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
call _GetErrno
|
2010-07-29 05:24:13 +02:00
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketclosedir
|
|
|
|
_Gasketclosedir:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
|
|
|
|
call _closedir
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketrename
|
|
|
|
_Gasketrename:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _rename
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketmktime
|
|
|
|
_Gasketmktime:
|
|
|
|
LFB42:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _mktime
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketfsync
|
|
|
|
_Gasketfsync:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _fsync
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketchmod
|
|
|
|
_Gasketchmod:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _chmod
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketutime
|
|
|
|
_Gasketutime:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _utime
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gaskettcflush
|
|
|
|
_Gaskettcflush:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _tcflush
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
call
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketUgaCreate
|
|
|
|
_GasketUgaCreate:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _UgaCreate
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketperror
|
|
|
|
_Gasketperror:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _perror
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketioctl
|
|
|
|
_Gasketioctl:
|
2010-07-29 05:24:13 +02:00
|
|
|
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 _UnixIoCtl1
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketfcntl
|
|
|
|
_Gasketfcntl:
|
2010-07-29 05:24:13 +02:00
|
|
|
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 _UnixFctl1
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketcfsetispeed
|
|
|
|
_Gasketcfsetispeed:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _cfsetispeed
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gasketcfsetospeed
|
|
|
|
_Gasketcfsetospeed:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _cfsetospeed
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gaskettcgetattr
|
|
|
|
_Gaskettcgetattr:
|
2010-07-29 05:24:13 +02:00
|
|
|
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 _tcgetattr
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _Gaskettcsetattr
|
|
|
|
_Gaskettcsetattr:
|
2010-07-29 05:24:13 +02:00
|
|
|
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 _tcsetattr
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketUnixPeCoffGetEntryPoint
|
|
|
|
_GasketUnixPeCoffGetEntryPoint:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _SecPeCoffGetEntryPoint
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketUnixPeCoffRelocateImageExtraAction
|
|
|
|
_GasketUnixPeCoffRelocateImageExtraAction:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
|
|
|
|
call _SecPeCoffRelocateImageExtraAction
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketUnixPeCoffUnloadImageExtraAction
|
|
|
|
_GasketUnixPeCoffUnloadImageExtraAction:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
|
|
|
|
call _SecPeCoffLoaderUnloadImageExtraAction
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketUgaClose
|
|
|
|
_GasketUgaClose:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
|
|
|
|
call _UgaClose
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketUgaSize
|
|
|
|
_GasketUgaSize:
|
2010-07-29 05:24:13 +02:00
|
|
|
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 _UgaSize
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketUgaCheckKey
|
|
|
|
_GasketUgaCheckKey:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
|
|
|
|
call _UgaCheckKey
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketUgaGetKey
|
|
|
|
_GasketUgaGetKey:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
|
|
|
|
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
|
|
|
|
call _UgaGetKey
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _GasketUgaBlt
|
|
|
|
_GasketUgaBlt:
|
2010-07-29 05:24:13 +02:00
|
|
|
pushq %rsi // %rsi & %rdi are volatie in Unix and callee-save in EFI ABI
|
|
|
|
pushq %rdi
|
2010-07-24 02:21:06 +02:00
|
|
|
|
2010-07-29 05:24:13 +02:00
|
|
|
movq %rcx, %rdi // Swizzle args
|
|
|
|
movq %rdx, %rsi
|
|
|
|
movq %r8, %rdx
|
|
|
|
movq %r9, %rcx
|
|
|
|
|
|
|
|
call _UgaBlt
|
|
|
|
|
|
|
|
popq %rdi // restore state
|
|
|
|
popq %rsi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// UNIX ABI to EFI ABI call
|
|
|
|
//
|
|
|
|
// UINTN
|
|
|
|
// ReverseGasketUint64 (
|
|
|
|
// void *Api,
|
|
|
|
// UINTN Arg1,
|
|
|
|
// UINTN Arg2,
|
|
|
|
// UINTN Arg3
|
|
|
|
// );
|
2010-07-24 02:21:06 +02:00
|
|
|
.globl _ReverseGasketUint64
|
|
|
|
_ReverseGasketUint64:
|
2010-07-29 05:24:13 +02:00
|
|
|
movq %rdi, %rax // Swizzle args
|
|
|
|
movq %rsi, %r9
|
|
|
|
// movq %rdx, %rdx
|
|
|
|
movq %rcx, %r8
|
|
|
|
movq %r9, %rcx
|
|
|
|
|
|
|
|
subq 40, %rsp // 32-byte shadow space plus alignment pad
|
2010-07-24 02:21:06 +02:00
|
|
|
call *%rax
|
2010-07-29 05:24:13 +02:00
|
|
|
addq 40, %rsp
|
|
|
|
|
2010-07-24 02:21:06 +02:00
|
|
|
ret
|
|
|
|
|
|
|
|
|