summaryrefslogtreecommitdiff
path: root/UnixPkg/Sec/Ia32
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2013-07-29 21:09:55 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2013-07-29 21:09:55 +0000
commit5d71a30480bdf7081f72485d6bf48361c244c4d7 (patch)
treeeaa76ec905c5a488d86edb9dcc5c4c7a79958258 /UnixPkg/Sec/Ia32
parentbf6ee6c7c33cf280cdfb2fd0e6b66a712b7aa4a1 (diff)
downloadedk2-platforms-5d71a30480bdf7081f72485d6bf48361c244c4d7.tar.xz
UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg)
For now the UnixPkg/Deprecated.txt file is retained to indicate that EmulatorPkg should be used instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14518 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg/Sec/Ia32')
-rw-r--r--UnixPkg/Sec/Ia32/Gasket.S344
-rw-r--r--UnixPkg/Sec/Ia32/Stack.S95
-rw-r--r--UnixPkg/Sec/Ia32/SwitchStack.c98
3 files changed, 0 insertions, 537 deletions
diff --git a/UnixPkg/Sec/Ia32/Gasket.S b/UnixPkg/Sec/Ia32/Gasket.S
deleted file mode 100644
index 5f762a3782..0000000000
--- a/UnixPkg/Sec/Ia32/Gasket.S
+++ /dev/null
@@ -1,344 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# OS X Application requires 16 byte stack alignment. The problem is these
-# APIs are exposed to code that does not have this requirement via
-# EFI_UNIX_THUNK_PROTOCOL. So these are wrapper functions that make sure
-# the stack is aligned. This code should also work if the stack is already
-# aligned. Extra stack padding is really the same as local varaibles so
-# it gets freed by the leave instruction
-#
-# I basically used the compiler, added extra 16 bytes to the local stack and
-# made sure %esp ended in 0 before the call (16 byte algined)
-#
-# The EFI_UNIX_THUNK_PROTOCOL member functions call a C API that then calls
-# one of these generic assembly routines. We do it that way to work around
-# some magic name changing that happens in C. For example stat() is _stat()
-# on Leopard and _stat$INDOE64 on Snow Leopard. That is why we pass stat()
-# into one of these gaskets from C code.
-#
-# 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__
-
- .text
-
-#------------------------------------------------------------------------------
-# int GasketVoid (void *api)
-#------------------------------------------------------------------------------
-.globl _GasketVoid
-_GasketVoid:
- pushl %ebp
- movl %esp, %ebp
- subl $34, %esp # sub extra 0x10 from the stack for the AND
- and $-16, %esp # stack needs to end in 0xFFFFFFF0 before call
- movl 8(%ebp), %eax
- movl %eax, -12(%ebp)
- movl -12(%ebp), %eax
- call *%eax
- leave
- ret
-
-#------------------------------------------------------------------------------
-#------------------------------------------------------------------------------
-.globl _GasketUintn
-_GasketUintn:
- pushl %ebp
- movl %esp, %ebp
- subl $50, %esp # sub extra 0x10 from the stack for the AND
- and $-16, %esp # stack needs to end in 0xFFFFFFF0 before call
- movl 8(%ebp), %eax
- movl %eax, -12(%ebp)
- movl 12(%ebp), %eax
- movl %eax, (%esp)
- movl -12(%ebp), %eax
- call *%eax
- leave
- ret
-
-#------------------------------------------------------------------------------
-#------------------------------------------------------------------------------
-.globl _GasketUintnUintn
-_GasketUintnUintn:
- pushl %ebp
- movl %esp, %ebp
- subl $50, %esp # sub extra 0x10 from the stack for the AND
- and $-16, %esp # stack needs to end in 0xFFFFFFF0 before call
- movl 8(%ebp), %eax
- movl %eax, -12(%ebp)
- movl 16(%ebp), %eax
- movl %eax, 4(%esp)
- movl 12(%ebp), %eax
- movl %eax, (%esp)
- movl -12(%ebp), %eax
- call *%eax
- leave
- ret
-
-#------------------------------------------------------------------------------
-#------------------------------------------------------------------------------
-.globl _GasketUintnUintnUintn
-_GasketUintnUintnUintn:
- pushl %ebp
- movl %esp, %ebp
- subl $50, %esp # sub extra 0x10 from the stack for the AND
- and $-16, %esp # stack needs to end in 0xFFFFFFF0 before call
- movl 8(%ebp), %eax
- movl %eax, -12(%ebp)
- movl 20(%ebp), %eax
- movl %eax, 8(%esp)
- movl 16(%ebp), %eax
- movl %eax, 4(%esp)
- movl 12(%ebp), %eax
- movl %eax, (%esp)
- movl -12(%ebp), %eax
- call *%eax
- leave
- ret
-
-#------------------------------------------------------------------------------
-#------------------------------------------------------------------------------
-.globl _GasketUintnUintnUintnUintn
-_GasketUintnUintnUintnUintn:
- pushl %ebp
- movl %esp, %ebp
- subl $50, %esp # sub extra 0x10 from the stack for the AND
- and $-16, %esp # stack needs to end in 0xFFFFFFF0 before call
- movl 8(%ebp), %eax
- movl %eax, -12(%ebp)
- movl 24(%ebp), %eax
- movl %eax, 12(%esp)
- movl 20(%ebp), %eax
- movl %eax, 8(%esp)
- movl 16(%ebp), %eax
- movl %eax, 4(%esp)
- movl 12(%ebp), %eax
- movl %eax, (%esp)
- movl -12(%ebp), %eax
- call *%eax
- leave
- ret
-
-#------------------------------------------------------------------------------
-#------------------------------------------------------------------------------
-.globl _GasketUintnUintnUintnUintnUintn
-_GasketUintnUintnUintnUintnUintn:
- pushl %ebp
- movl %esp, %ebp
- subl $50, %esp # sub extra 0x10 from the stack for the AND
- and $-16, %esp # stack needs to end in 0xFFFFFFF0 before call
- movl 8(%ebp), %eax
- movl %eax, -12(%ebp)
- movl 28(%ebp), %eax
- movl %eax, 16(%esp)
- movl 24(%ebp), %eax
- movl %eax, 12(%esp)
- movl 20(%ebp), %eax
- movl %eax, 8(%esp)
- movl 16(%ebp), %eax
- movl %eax, 4(%esp)
- movl 12(%ebp), %eax
- movl %eax, (%esp)
- movl -12(%ebp), %eax
- call *%eax
- leave
- ret
-
-#------------------------------------------------------------------------------
-#------------------------------------------------------------------------------
-.globl _GasketUintn10Args
-_GasketUintn10Args:
- pushl %ebp
- movl %esp, %ebp
- subl $82, %esp # sub extra 0x10 from the stack for the AND
- and $-16, %esp # stack needs to end in 0xFFFFFFF0 before call
- movl 8(%ebp), %eax
- movl %eax, -12(%ebp)
- movl 48(%ebp), %eax
- movl %eax, 36(%esp)
- movl 44(%ebp), %eax
- movl %eax, 32(%esp)
- movl 40(%ebp), %eax
- movl %eax, 28(%esp)
- movl 36(%ebp), %eax
- movl %eax, 24(%esp)
- movl 32(%ebp), %eax
- movl %eax, 20(%esp)
- movl 28(%ebp), %eax
- movl %eax, 16(%esp)
- movl 24(%ebp), %eax
- movl %eax, 12(%esp)
- movl 20(%ebp), %eax
- movl %eax, 8(%esp)
- movl 16(%ebp), %eax
- movl %eax, 4(%esp)
- movl 12(%ebp), %eax
- movl %eax, (%esp)
- movl -12(%ebp), %eax
- call *%eax
- leave
- ret
-
-
-#------------------------------------------------------------------------------
-#------------------------------------------------------------------------------
-.globl _GasketUint64Uintn
-_GasketUint64Uintn:
- pushl %ebp
- movl %esp, %ebp
- subl $66, %esp # sub extra 0x10 from the stack for the AND
- and $-16, %esp # stack needs to end in 0xFFFFFFF0 before call
- movl 12(%ebp), %eax
- movl %eax, -32(%ebp)
- movl 16(%ebp), %eax
- movl %eax, -28(%ebp)
- movl 8(%ebp), %eax
- movl %eax, -12(%ebp)
- movl 20(%ebp), %eax
- movl %eax, 8(%esp)
- movl -32(%ebp), %eax
- movl -28(%ebp), %edx
- movl %eax, (%esp)
- movl %edx, 4(%esp)
- movl -12(%ebp), %eax
- call *%eax
- leave
- ret
-
-#------------------------------------------------------------------------------
-#------------------------------------------------------------------------------
-.globl _GasketUintnUint64Uintn
-_GasketUintnUint64Uintn:
- pushl %ebp
- movl %esp, %ebp
- subl $66, %esp # sub extra 0x10 from the stack for the AND
- and $-16, %esp # stack needs to end in 0xFFFFFFF0 before call
- movl 16(%ebp), %eax
- movl %eax, -32(%ebp)
- movl 20(%ebp), %eax
- movl %eax, -28(%ebp)
- movl 8(%ebp), %eax
- movl %eax, -12(%ebp)
- movl 24(%ebp), %eax
- movl %eax, 12(%esp)
- movl -32(%ebp), %eax
- movl -28(%ebp), %edx
- movl %eax, 4(%esp)
- movl %edx, 8(%esp)
- movl 12(%ebp), %eax
- movl %eax, (%esp)
- movl -12(%ebp), %eax
- call *%eax
- leave
- ret
-
-#------------------------------------------------------------------------------
-#------------------------------------------------------------------------------
-.globl _GasketUintnUint16
-_GasketUintnUint16:
- pushl %ebp
- movl %esp, %ebp
- subl $66, %esp # sub extra 0x10 from the stack for the AND
- and $-16, %esp # stack needs to end in 0xFFFFFFF0 before call
- movl 16(%ebp), %eax
- movw %ax, -28(%ebp)
- movl 8(%ebp), %eax
- movl %eax, -12(%ebp)
- movzwl -28(%ebp), %eax
- movl %eax, 4(%esp)
- movl 12(%ebp), %eax
- movl %eax, (%esp)
- movl -12(%ebp), %eax
- call *%eax
- leave
- ret
-
-
-.globl _ReverseGasketUint64
-_ReverseGasketUint64:
- pushl %ebp
- movl %esp, %ebp
- subl $40, %esp
- movl 12(%ebp), %eax
- movl %eax, -16(%ebp)
- movl 16(%ebp), %eax
- movl %eax, -12(%ebp)
- movl -16(%ebp), %eax
- movl -12(%ebp), %edx
- movl %eax, (%esp)
- movl %edx, 4(%esp)
- movl 8(%ebp), %eax
- call *%eax
- leave
- ret
-
-
-.globl _ReverseGasketUint64Uint64
-_ReverseGasketUint64Uint64:
- pushl %ebp
- movl %esp, %ebp
- subl $56, %esp
- movl 12(%ebp), %eax
- movl %eax, -32(%ebp)
- movl 16(%ebp), %eax
- movl %eax, -28(%ebp)
- movl 20(%ebp), %eax
- movl %eax, -40(%ebp)
- movl 24(%ebp), %eax
- movl %eax, -36(%ebp)
- movl 8(%ebp), %eax
- movl %eax, -12(%ebp)
- movl -40(%ebp), %eax
- movl -36(%ebp), %edx
- movl %eax, 8(%esp)
- movl %edx, 12(%esp)
- movl -32(%ebp), %eax
- movl -28(%ebp), %edx
- movl %eax, (%esp)
- movl %edx, 4(%esp)
- movl -12(%ebp), %eax
- call *%eax
- 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
-
- #endif
diff --git a/UnixPkg/Sec/Ia32/Stack.S b/UnixPkg/Sec/Ia32/Stack.S
deleted file mode 100644
index ff5a77f8ba..0000000000
--- a/UnixPkg/Sec/Ia32/Stack.S
+++ /dev/null
@@ -1,95 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
-# Portions copyright (c) 2008 - 2009, 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.
-#
-# Module Name:
-#
-# Stack.asm
-#
-# Abstract:
-#
-# Switch the stack from temporary memory to permenent memory.
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# SecSwitchStack (
-# UINT32 TemporaryMemoryBase,
-# UINT32 PermenentMemoryBase
-# );
-#------------------------------------------------------------------------------
-
-#include <ProcessorBind.h>
-
-ASM_GLOBAL ASM_PFX(SecSwitchStack)
-ASM_PFX(SecSwitchStack):
-#
-# Save three register: eax, ebx, ecx
-#
- push %eax
- push %ebx
- push %ecx
- push %edx
-
-#
-# !!CAUTION!! this function address's is pushed into stack after
-# migration of whole temporary memory, so need save it to permenent
-# memory at first!
-#
-
- movl 20(%esp), %ebx # Save the first parameter
- movl 24(%esp), %ecx # Save the second parameter
-
-#
-# Save this function's return address into permenent memory at first.
-# Then, Fixup the esp point to permenent memory
-#
-
- movl %esp, %eax
- subl %ebx, %eax
- addl %ecx, %eax
- movl (%esp), %edx # copy pushed register's value to permenent memory
- movl %edx, (%eax)
- movl 4(%esp), %edx
- movl %edx, 4(%eax)
- movl 8(%esp), %edx
- movl %edx, 8(%eax)
- movl 12(%esp), %edx
- movl %edx, 12(%eax)
- movl 16(%esp), %edx
- movl %edx, 16(%eax)
- movl %eax, %esp # From now, esp is pointed to permenent memory
-
-#
-# Fixup the ebp point to permenent memory
-#
-#ifndef __APPLE__
- movl %ebp, %eax
- subl %ebx, %eax
- addl %ecx, %eax
- movl %eax, %ebp # From now, ebp is pointed to permenent memory
-
-#
-# Fixup callee's ebp point for PeiDispatch
-#
- movl (%ebp), %eax
- subl %ebx, %eax
- addl %ecx, %eax
- movl %eax, (%ebp) # From now, Temporary's PPI caller's stack is in permenent memory
-#endif
-
- pop %edx
- pop %ecx
- pop %ebx
- pop %eax
- ret
diff --git a/UnixPkg/Sec/Ia32/SwitchStack.c b/UnixPkg/Sec/Ia32/SwitchStack.c
deleted file mode 100644
index cf5f364d0d..0000000000
--- a/UnixPkg/Sec/Ia32/SwitchStack.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2008 - 2009, 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.
-
-Module Name:
-
- SecMain.c
-
-Abstract:
- Unix emulator of SEC phase. It's really a Posix application, but this is
- Ok since all the other modules for NT32 are NOT Posix applications.
-
- This program processes host environment variables and figures out
- what the memory layout will be, how may FD's will be loaded and also
- what the boot mode is.
-
- The SEC registers a set of services with the SEC core. gPrivateDispatchTable
- is a list of PPI's produced by the SEC that are availble for usage in PEI.
-
- This code produces 128 K of temporary memory for the PEI stack by opening a
- host file and mapping it directly to memory addresses.
-
- The system.cmd script is used to set host environment variables that drive
- the configuration opitons of the SEC.
-
---*/
-
-#include "SecMain.h"
-
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's
- Reserved on other architectures.
-
-**/
-VOID
-EFIAPI
-PeiSwitchStacks (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *Context3, OPTIONAL
- IN VOID *NewStack
- )
-{
- BASE_LIBRARY_JUMP_BUFFER JumpBuffer;
-
- ASSERT (EntryPoint != NULL);
- ASSERT (NewStack != NULL);
-
- //
- // Stack should be aligned with CPU_STACK_ALIGNMENT
- //
- ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
-
- JumpBuffer.Eip = (UINTN)EntryPoint;
- JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID*);
- JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2) + sizeof(Context3);
- ((VOID**)JumpBuffer.Esp)[1] = Context1;
- ((VOID**)JumpBuffer.Esp)[2] = Context2;
- ((VOID**)JumpBuffer.Esp)[3] = Context3;
-
- LongJump (&JumpBuffer, (UINTN)-1);
-
-
- //
- // InternalSwitchStack () will never return
- //
- ASSERT (FALSE);
-}
-
-
-