diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-20 08:19:39 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-20 08:19:39 +0000 |
commit | b341712e314a6161120c30d41e6308bc6aeb2213 (patch) | |
tree | 4c3b6b6bd98ab567340b2ff1b690a058301e8594 /EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib | |
parent | ec25b43fbdb33e26320a49cd1033125bd057c131 (diff) | |
download | edk2-b341712e314a6161120c30d41e6308bc6aeb2213.tar.gz edk2-b341712e314a6161120c30d41e6308bc6aeb2213.tar.bz2 edk2-b341712e314a6161120c30d41e6308bc6aeb2213.zip |
Update to make end-of-line consistent for all source files in MdePkg. There are no other updates besides that change.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9160 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib')
6 files changed, 610 insertions, 610 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ProcessorAsms.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ProcessorAsms.S index d878b3b8b2..01eec19f39 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ProcessorAsms.S +++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ProcessorAsms.S @@ -1,207 +1,207 @@ -# -# Copyright (c) 2004, Intel Corporation -# All rights reserved. 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: -# -# ProcessorAsms.Asm -# -# -# -#include "EfiBind.h" -#------------------------------------------------------------------------------ - - .686P: - .MMX: - #.MODEL SMALL - .CODE: -#------------------------------------------------------------------------------ - -.globl ASM_PFX(TransferControlSetJump) -.globl ASM_PFX(TransferControlLongJump) -.globl ASM_PFX(SwitchStacks) -.globl ASM_PFX(SwitchIplStacks) - -.equ EFI_SUCCESS, 0 -.equ EFI_WARN_RETURN_FROM_LONG_JUMP, 5 - -# -# typedef struct { -# UINT32 ebx; -# UINT32 esi; -# UINT32 edi; -# UINT32 ebp; -# UINT32 esp; -# UINT32 eip; -#} EFI_JUMP_BUFFER; -# - -#typedef -#EFI_STATUS -#(EFIAPI *EFI_PEI_TRANSFER_CONTROL_SET_JUMP) ( -# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This, -# OUT EFI_JUMP_BUFFER *Context -# ); -# -#Routine Description: -# -# This routine implements the IA32 variant of the SetJump call. Its -# responsibility is to store system state information for a possible -# subsequent LongJump. -# -#Arguments: -# -# Pointer to CPU context save buffer. -# -#Returns: -# -# EFI_SUCCESS -# -ASM_PFX(TransferControlSetJump): - push %ebp - mov %esp,%ebp - mov 0x8(%ebp),%eax - mov 0xc(%ebp),%ecx - mov %ebx,(%ecx) - mov %esi,0x4(%ecx) - mov %edi,0x8(%ecx) - mov 0x0(%ebp),%eax - mov %eax,0xc(%ecx) - lea 0x4(%ebp),%eax - mov %eax,0x10(%ecx) - mov 0x4(%ebp),%eax - mov %eax,0x14(%ecx) - mov $0x0,%eax - leave - ret - -#typedef -#EFI_STATUS -#(EFIAPI *EFI_PEI_TRANSFER_CONTROL_LONG_JUMP) ( -# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This, -# IN EFI_JUMP_BUFFER *Context -# ); -# -# Routine Description: -# -# This routine implements the IA32 variant of the LongJump call. Its -# responsibility is restore the system state to the Context Buffer and -# pass control back. -# -# Arguments: -# -# Pointer to CPU context save buffer. -# -# Returns: -# -# EFI_WARN_RETURN_FROM_LONG_JUMP -# - -ASM_PFX(TransferControlLongJump): - push %ebp - mov %esp,%ebp - push %ebx - push %esi - push %edi - mov 0x8(%ebp),%eax - mov $0x5,%eax - mov 0xc(%ebp),%ecx - mov (%ecx),%ebx - mov 0x4(%ecx),%esi - mov 0x8(%ecx),%edi - mov 0xc(%ecx),%ebp - mov 0x10(%ecx),%esp - add $0x4,%esp - jmp *0x14(%ecx) - mov $0x5,%eax - pop %edi - pop %esi - pop %ebx - leave - ret - -# -# Routine Description: -# This allows the caller to switch the stack and goes to the new entry point -# -# Arguments: -# EntryPoint - Pointer to the location to enter -# Parameter - Parameter to pass in -# NewStack - New Location of the stack -# NewBsp - New BSP -# -# Returns: -# -# Nothing. Goes to the Entry Point passing in the new parameters -# -#SwitchStacks PROC C \ -# EntryPoint:PTR DWORD, \ -# Parameter:DWORD, \ -# NewStack:PTR DWORD, \ -# NewBsp:PTR DWORD -ASM_PFX(SwitchStacks): - push %ebp - mov %esp,%ebp - push %ebx - mov 0x14(%ebp),%eax - mov 0xc(%ebp),%ebx - mov 0x8(%ebp),%ecx - mov 0x10(%ebp),%eax - mov %eax,%esp - push %ebx - push $0x0 - jmp *%ecx - pop %ebx - leave - ret - - - - -# -# Routine Description: -# This allows the caller to switch the stack and goes to the new entry point -# -# Arguments: -# EntryPoint - Pointer to the location to enter -# Parameter1/Parameter2 - Parameter to pass in -# NewStack - New Location of the stack -# NewBsp - New BSP -# -# Returns: -# -# Nothing. Goes to the Entry Point passing in the new parameters -# -#SwitchIplStacks PROC C \ -# EntryPoint:PTR DWORD, \ -# Parameter1:DWORD, \ -# Parameter2:DWORD, \ -# NewStack:PTR DWORD, \ -# NewBsp:PTR DWORD -ASM_PFX(SwitchIplStacks): - push %ebp - mov %esp,%ebp - push %ebx - mov 0x18(%ebp),%eax - mov 0xc(%ebp),%ebx - mov 0x10(%ebp),%edx - mov 0x8(%ebp),%ecx - mov 0x14(%ebp),%eax - mov %eax,%esp - push %edx - push %ebx - call *%ecx - pop %ebx - leave - ret - -#SwitchIplStacks ENDP - - - +#
+# Copyright (c) 2004, Intel Corporation
+# All rights reserved. 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:
+#
+# ProcessorAsms.Asm
+#
+#
+#
+#include "EfiBind.h"
+#------------------------------------------------------------------------------
+
+ .686P:
+ .MMX:
+ #.MODEL SMALL
+ .CODE:
+#------------------------------------------------------------------------------
+
+.globl ASM_PFX(TransferControlSetJump)
+.globl ASM_PFX(TransferControlLongJump)
+.globl ASM_PFX(SwitchStacks)
+.globl ASM_PFX(SwitchIplStacks)
+
+.equ EFI_SUCCESS, 0
+.equ EFI_WARN_RETURN_FROM_LONG_JUMP, 5
+
+#
+# typedef struct {
+# UINT32 ebx;
+# UINT32 esi;
+# UINT32 edi;
+# UINT32 ebp;
+# UINT32 esp;
+# UINT32 eip;
+#} EFI_JUMP_BUFFER;
+#
+
+#typedef
+#EFI_STATUS
+#(EFIAPI *EFI_PEI_TRANSFER_CONTROL_SET_JUMP) (
+# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
+# OUT EFI_JUMP_BUFFER *Context
+# );
+#
+#Routine Description:
+#
+# This routine implements the IA32 variant of the SetJump call. Its
+# responsibility is to store system state information for a possible
+# subsequent LongJump.
+#
+#Arguments:
+#
+# Pointer to CPU context save buffer.
+#
+#Returns:
+#
+# EFI_SUCCESS
+#
+ASM_PFX(TransferControlSetJump):
+ push %ebp
+ mov %esp,%ebp
+ mov 0x8(%ebp),%eax
+ mov 0xc(%ebp),%ecx
+ mov %ebx,(%ecx)
+ mov %esi,0x4(%ecx)
+ mov %edi,0x8(%ecx)
+ mov 0x0(%ebp),%eax
+ mov %eax,0xc(%ecx)
+ lea 0x4(%ebp),%eax
+ mov %eax,0x10(%ecx)
+ mov 0x4(%ebp),%eax
+ mov %eax,0x14(%ecx)
+ mov $0x0,%eax
+ leave
+ ret
+
+#typedef
+#EFI_STATUS
+#(EFIAPI *EFI_PEI_TRANSFER_CONTROL_LONG_JUMP) (
+# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
+# IN EFI_JUMP_BUFFER *Context
+# );
+#
+# Routine Description:
+#
+# This routine implements the IA32 variant of the LongJump call. Its
+# responsibility is restore the system state to the Context Buffer and
+# pass control back.
+#
+# Arguments:
+#
+# Pointer to CPU context save buffer.
+#
+# Returns:
+#
+# EFI_WARN_RETURN_FROM_LONG_JUMP
+#
+
+ASM_PFX(TransferControlLongJump):
+ push %ebp
+ mov %esp,%ebp
+ push %ebx
+ push %esi
+ push %edi
+ mov 0x8(%ebp),%eax
+ mov $0x5,%eax
+ mov 0xc(%ebp),%ecx
+ mov (%ecx),%ebx
+ mov 0x4(%ecx),%esi
+ mov 0x8(%ecx),%edi
+ mov 0xc(%ecx),%ebp
+ mov 0x10(%ecx),%esp
+ add $0x4,%esp
+ jmp *0x14(%ecx)
+ mov $0x5,%eax
+ pop %edi
+ pop %esi
+ pop %ebx
+ leave
+ ret
+
+#
+# Routine Description:
+# This allows the caller to switch the stack and goes to the new entry point
+#
+# Arguments:
+# EntryPoint - Pointer to the location to enter
+# Parameter - Parameter to pass in
+# NewStack - New Location of the stack
+# NewBsp - New BSP
+#
+# Returns:
+#
+# Nothing. Goes to the Entry Point passing in the new parameters
+#
+#SwitchStacks PROC C \
+# EntryPoint:PTR DWORD, \
+# Parameter:DWORD, \
+# NewStack:PTR DWORD, \
+# NewBsp:PTR DWORD
+ASM_PFX(SwitchStacks):
+ push %ebp
+ mov %esp,%ebp
+ push %ebx
+ mov 0x14(%ebp),%eax
+ mov 0xc(%ebp),%ebx
+ mov 0x8(%ebp),%ecx
+ mov 0x10(%ebp),%eax
+ mov %eax,%esp
+ push %ebx
+ push $0x0
+ jmp *%ecx
+ pop %ebx
+ leave
+ ret
+
+
+
+
+#
+# Routine Description:
+# This allows the caller to switch the stack and goes to the new entry point
+#
+# Arguments:
+# EntryPoint - Pointer to the location to enter
+# Parameter1/Parameter2 - Parameter to pass in
+# NewStack - New Location of the stack
+# NewBsp - New BSP
+#
+# Returns:
+#
+# Nothing. Goes to the Entry Point passing in the new parameters
+#
+#SwitchIplStacks PROC C \
+# EntryPoint:PTR DWORD, \
+# Parameter1:DWORD, \
+# Parameter2:DWORD, \
+# NewStack:PTR DWORD, \
+# NewBsp:PTR DWORD
+ASM_PFX(SwitchIplStacks):
+ push %ebp
+ mov %esp,%ebp
+ push %ebx
+ mov 0x18(%ebp),%eax
+ mov 0xc(%ebp),%ebx
+ mov 0x10(%ebp),%edx
+ mov 0x8(%ebp),%ecx
+ mov 0x14(%ebp),%eax
+ mov %eax,%esp
+ push %edx
+ push %ebx
+ call *%ecx
+ pop %ebx
+ leave
+ ret
+
+#SwitchIplStacks ENDP
+
+
+
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ReadIdt.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ReadIdt.S index 0abd84f902..d9c82eeab5 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ReadIdt.S +++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ReadIdt.S @@ -1,69 +1,69 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. 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: -# -# ReadIdtBase.Asm -# -# Abstract: -# -# ReadIdtBase function -# -# Notes: -# -#include "EfiBind.h" -#------------------------------------------------------------------------------ - - .586: - #.MODEL flat,C - .code: - -.globl ASM_PFX(ReadIdtBasea) -.globl ASM_PFX(ReadIdtLimita) - -#------------------------------------------------------------------------------ -# UINTN -# ReadIdtBase ( -# void -# ) -# -# Abstract: Returns physical address of IDTR -# -ASM_PFX(ReadIdtBasea): - push %ebp - mov %esp,%ebp - add $0xfffffff8,%esp - sidtl 0xfffffffa(%ebp) - mov 0xfffffffc(%ebp),%eax - leave - ret - - - -#------------------------------------------------------------------------------ -# UINT16 -# ReadIdtLimit ( -# void -# ) -# -# Abstract: Returns Limit of IDTR -# -ASM_PFX(ReadIdtLimita): - push %ebp - mov %esp,%ebp - add $0xfffffff8,%esp - sidtl 0xfffffffa(%ebp) - mov 0xfffffffa(%ebp),%ax - leave - ret - - - +#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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:
+#
+# ReadIdtBase.Asm
+#
+# Abstract:
+#
+# ReadIdtBase function
+#
+# Notes:
+#
+#include "EfiBind.h"
+#------------------------------------------------------------------------------
+
+ .586:
+ #.MODEL flat,C
+ .code:
+
+.globl ASM_PFX(ReadIdtBasea)
+.globl ASM_PFX(ReadIdtLimita)
+
+#------------------------------------------------------------------------------
+# UINTN
+# ReadIdtBase (
+# void
+# )
+#
+# Abstract: Returns physical address of IDTR
+#
+ASM_PFX(ReadIdtBasea):
+ push %ebp
+ mov %esp,%ebp
+ add $0xfffffff8,%esp
+ sidtl 0xfffffffa(%ebp)
+ mov 0xfffffffc(%ebp),%eax
+ leave
+ ret
+
+
+
+#------------------------------------------------------------------------------
+# UINT16
+# ReadIdtLimit (
+# void
+# )
+#
+# Abstract: Returns Limit of IDTR
+#
+ASM_PFX(ReadIdtLimita):
+ push %ebp
+ mov %esp,%ebp
+ add $0xfffffff8,%esp
+ sidtl 0xfffffffa(%ebp)
+ mov 0xfffffffa(%ebp),%ax
+ leave
+ ret
+
+
+
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.S index 3bd41f343b..b0f134319d 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.S +++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.S @@ -1,71 +1,71 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008, Intel Corporation -# All rights reserved. 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: -# -# SupportItpDebug.asm -# -# Abstract: -# -# This is the code for debuging IA32, to add a break hook at loading every module -# -#------------------------------------------------------------------------------ -#include <EfiBind.h> - -# PROC:PRIVATE - .686P: - .MMX: - #.MODEL SMALL - .CODE: - -#------------------------------------------------------------------------------ -#------------------------------------------------------------------------------ -.globl ASM_PFX(AsmEfiSetBreakSupport) - -# VOID -# AsmEfiSetBreakSupport ( -# IN UINTN LoadAddr -# ) -#------------------------------------------------------------------------------ -ASM_PFX(AsmEfiSetBreakSupport): - push %ebp - mov %esp, %ebp - mov 0x8(%ebp),%eax - movw $60000, %dx - outl %eax, %dx - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - ret - -#AsmEfiSetBreakSupport ENDP - +#------------------------------------------------------------------------------
+#
+# Copyright (c) 2008, Intel Corporation
+# All rights reserved. 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:
+#
+# SupportItpDebug.asm
+#
+# Abstract:
+#
+# This is the code for debuging IA32, to add a break hook at loading every module
+#
+#------------------------------------------------------------------------------
+#include <EfiBind.h>
+
+# PROC:PRIVATE
+ .686P:
+ .MMX:
+ #.MODEL SMALL
+ .CODE:
+
+#------------------------------------------------------------------------------
+#------------------------------------------------------------------------------
+.globl ASM_PFX(AsmEfiSetBreakSupport)
+
+# VOID
+# AsmEfiSetBreakSupport (
+# IN UINTN LoadAddr
+# )
+#------------------------------------------------------------------------------
+ASM_PFX(AsmEfiSetBreakSupport):
+ push %ebp
+ mov %esp, %ebp
+ mov 0x8(%ebp),%eax
+ movw $60000, %dx
+ outl %eax, %dx
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ ret
+
+#AsmEfiSetBreakSupport ENDP
+
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/WriteIdt.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/WriteIdt.S index 5d072c4921..54af688872 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/WriteIdt.S +++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/WriteIdt.S @@ -1,50 +1,50 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2006, Intel Corporation -# All rights reserved. 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: -# -# WriteIdt.Asm -# -# Abstract: -# -# SetIdtBase function -# -# Notes: -# -#include "EfiBind.h" -#------------------------------------------------------------------------------ - - .586: - #.MODEL flat,C - .code: -#------------------------------------------------------------------------------ - -.globl ASM_PFX(SetIdtBase) - -# void -# SetIdtBase ( -# UINT32 IdtBase, -# UINT16 IdtLimit -# ) -# -# Abstract: Set IDTR with the given physical address -# -ASM_PFX(SetIdtBase): - push %ebp - mov %esp,%ebp - add $0xfffffff8,%esp - mov 0x8(%ebp),%eax - mov 0xc(%ebp),%cx - mov %eax,0xfffffffc(%ebp) - mov %cx,0xfffffffa(%ebp) - lidtl 0xfffffffa(%ebp) - leave - ret +#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. 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:
+#
+# WriteIdt.Asm
+#
+# Abstract:
+#
+# SetIdtBase function
+#
+# Notes:
+#
+#include "EfiBind.h"
+#------------------------------------------------------------------------------
+
+ .586:
+ #.MODEL flat,C
+ .code:
+#------------------------------------------------------------------------------
+
+.globl ASM_PFX(SetIdtBase)
+
+# void
+# SetIdtBase (
+# UINT32 IdtBase,
+# UINT16 IdtLimit
+# )
+#
+# Abstract: Set IDTR with the given physical address
+#
+ASM_PFX(SetIdtBase):
+ push %ebp
+ mov %esp,%ebp
+ add $0xfffffff8,%esp
+ mov 0x8(%ebp),%eax
+ mov 0xc(%ebp),%cx
+ mov %eax,0xfffffffc(%ebp)
+ mov %cx,0xfffffffa(%ebp)
+ lidtl 0xfffffffa(%ebp)
+ leave
+ ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S index 2767aef13d..48e4b19c88 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S +++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S @@ -1,135 +1,135 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008, Intel Corporation -# All rights reserved. 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: -# ProcessorAsms.S -# -# Abstract: -# This is separated from processor.c to allow this functions to be built with /O1 -# -# -#------------------------------------------------------------------------------ -#include <EfiBind.h> - - .text - -.global ASM_PFX(SwitchStacks) -.global ASM_PFX(TransferControlSetJump) -.global ASM_PFX(TransferControlLongJump) - -# -# Routine Description: -# This allows the caller to switch the stack and goes to the new entry point -# -# Arguments: -# EntryPoint - Pointer to the location to enter // rcx -# Parameter - Parameter to pass in // rdx -# NewStack - New Location of the stack // r8 -# NewBsp - New BSP // r9 - not used -# -# Returns: -# Nothing. Goes to the Entry Point passing in the new parameters -# -ASM_PFX(SwitchStacks): - - # Adjust stack for - # 1) leave 4 registers space - # 2) let it 16 bytes aligned after call - sub $0x20,%r8 - and -0x10,%r8w # do not assume 16 bytes aligned - - mov %r8,%rsp - mov %rcx,%r10 - mov %rdx,%rcx - callq *%r10 - - # - # no ret as we have a new stack and we jumped to the new location - # - ret - -#SwitchStacks ENDP - - -.equ EFI_SUCCESS, 0 -.equ EFI_WARN_RETURN_FROM_LONG_JUMP, 5 - -# -#Routine Description: -# -# This routine implements the x64 variant of the SetJump call. Its -# responsibility is to store system state information for a possible -# subsequent LongJump. -# -#Arguments: -# -# Pointer to CPU context save buffer. -# -#Returns: -# -# EFI_SUCCESS -# -# EFI_STATUS -# EFIAPI -# TransferControlLongJump ( -# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This, -# IN EFI_JUMP_BUFFER *Jump -# ); -# -# rcx - *This -# rdx - JumpBuffer -# -ASM_PFX(TransferControlSetJump): - mov %rbx,(%rdx) - mov %rsp,0x8(%rdx) - mov %rbp,0x10(%rdx) - mov %rdi,0x18(%rdx) - mov %rsi,0x20(%rdx) - mov %r10,0x28(%rdx) - mov %r11,0x30(%rdx) - mov %r12,0x38(%rdx) - mov %r13,0x40(%rdx) - mov %r14,0x48(%rdx) - mov %r15,0x50(%rdx) - mov (%rsp),%rax - mov %rax,0x58(%rdx) - mov $0x0,%rax - retq - - -# -# EFI_STATUS -# EFIAPI -# TransferControlLongJump ( -# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This, // rcx -# IN EFI_JUMP_BUFFER *Jump // rdx -# ); -# -# -ASM_PFX(TransferControlLongJump): - # set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP - mov $0x5,%rax - mov (%rdx),%rbx - mov 0x8(%rdx),%rsp - mov 0x10(%rdx),%rbp - mov 0x18(%rdx),%rdi - mov 0x20(%rdx),%rsi - mov 0x28(%rdx),%r10 - mov 0x30(%rdx),%r11 - mov 0x38(%rdx),%r12 - mov 0x40(%rdx),%r13 - mov 0x48(%rdx),%r14 - mov 0x50(%rdx),%r15 - add $0x8,%rsp - jmpq *0x58(%rdx) - mov $0x5,%rax - retq - +#------------------------------------------------------------------------------
+#
+# Copyright (c) 2008, Intel Corporation
+# All rights reserved. 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:
+# ProcessorAsms.S
+#
+# Abstract:
+# This is separated from processor.c to allow this functions to be built with /O1
+#
+#
+#------------------------------------------------------------------------------
+#include <EfiBind.h>
+
+ .text
+
+.global ASM_PFX(SwitchStacks)
+.global ASM_PFX(TransferControlSetJump)
+.global ASM_PFX(TransferControlLongJump)
+
+#
+# Routine Description:
+# This allows the caller to switch the stack and goes to the new entry point
+#
+# Arguments:
+# EntryPoint - Pointer to the location to enter // rcx
+# Parameter - Parameter to pass in // rdx
+# NewStack - New Location of the stack // r8
+# NewBsp - New BSP // r9 - not used
+#
+# Returns:
+# Nothing. Goes to the Entry Point passing in the new parameters
+#
+ASM_PFX(SwitchStacks):
+
+ # Adjust stack for
+ # 1) leave 4 registers space
+ # 2) let it 16 bytes aligned after call
+ sub $0x20,%r8
+ and -0x10,%r8w # do not assume 16 bytes aligned
+
+ mov %r8,%rsp
+ mov %rcx,%r10
+ mov %rdx,%rcx
+ callq *%r10
+
+ #
+ # no ret as we have a new stack and we jumped to the new location
+ #
+ ret
+
+#SwitchStacks ENDP
+
+
+.equ EFI_SUCCESS, 0
+.equ EFI_WARN_RETURN_FROM_LONG_JUMP, 5
+
+#
+#Routine Description:
+#
+# This routine implements the x64 variant of the SetJump call. Its
+# responsibility is to store system state information for a possible
+# subsequent LongJump.
+#
+#Arguments:
+#
+# Pointer to CPU context save buffer.
+#
+#Returns:
+#
+# EFI_SUCCESS
+#
+# EFI_STATUS
+# EFIAPI
+# TransferControlLongJump (
+# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
+# IN EFI_JUMP_BUFFER *Jump
+# );
+#
+# rcx - *This
+# rdx - JumpBuffer
+#
+ASM_PFX(TransferControlSetJump):
+ mov %rbx,(%rdx)
+ mov %rsp,0x8(%rdx)
+ mov %rbp,0x10(%rdx)
+ mov %rdi,0x18(%rdx)
+ mov %rsi,0x20(%rdx)
+ mov %r10,0x28(%rdx)
+ mov %r11,0x30(%rdx)
+ mov %r12,0x38(%rdx)
+ mov %r13,0x40(%rdx)
+ mov %r14,0x48(%rdx)
+ mov %r15,0x50(%rdx)
+ mov (%rsp),%rax
+ mov %rax,0x58(%rdx)
+ mov $0x0,%rax
+ retq
+
+
+#
+# EFI_STATUS
+# EFIAPI
+# TransferControlLongJump (
+# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This, // rcx
+# IN EFI_JUMP_BUFFER *Jump // rdx
+# );
+#
+#
+ASM_PFX(TransferControlLongJump):
+ # set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
+ mov $0x5,%rax
+ mov (%rdx),%rbx
+ mov 0x8(%rdx),%rsp
+ mov 0x10(%rdx),%rbp
+ mov 0x18(%rdx),%rdi
+ mov 0x20(%rdx),%rsi
+ mov 0x28(%rdx),%r10
+ mov 0x30(%rdx),%r11
+ mov 0x38(%rdx),%r12
+ mov 0x40(%rdx),%r13
+ mov 0x48(%rdx),%r14
+ mov 0x50(%rdx),%r15
+ add $0x8,%rsp
+ jmpq *0x58(%rdx)
+ mov $0x5,%rax
+ retq
+
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/SupportItpDebug.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/SupportItpDebug.S index 4be5b1fb37..4a2d63a7fb 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/SupportItpDebug.S +++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/SupportItpDebug.S @@ -1,78 +1,78 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008, Intel Corporation -# All rights reserved. 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: -# -# SupportItpDebug.S -# -# Abstract: -# -# This is the code for debuging X64, to add a break hook at loading every module -# -#------------------------------------------------------------------------------ -#include <EfiBind.h> - - .text - -.global ASM_PFX(AsmEfiSetBreakSupport) - -#------------------------------------------------------------------------------ -# VOID -# AsmEfiSetBreakSupport ( -# IN UINTN LoadAddr // rcx -# ) -#------------------------------------------------------------------------------ - -ASM_PFX(AsmEfiSetBreakSupport): - - movw $60000, %dx - outl %eax, %dx - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - ret - - - - +#------------------------------------------------------------------------------
+#
+# Copyright (c) 2008, Intel Corporation
+# All rights reserved. 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:
+#
+# SupportItpDebug.S
+#
+# Abstract:
+#
+# This is the code for debuging X64, to add a break hook at loading every module
+#
+#------------------------------------------------------------------------------
+#include <EfiBind.h>
+
+ .text
+
+.global ASM_PFX(AsmEfiSetBreakSupport)
+
+#------------------------------------------------------------------------------
+# VOID
+# AsmEfiSetBreakSupport (
+# IN UINTN LoadAddr // rcx
+# )
+#------------------------------------------------------------------------------
+
+ASM_PFX(AsmEfiSetBreakSupport):
+
+ movw $60000, %dx
+ outl %eax, %dx
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ ret
+
+
+
+
|