2007-06-22 05:21:45 +02:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
#
|
2008-10-23 08:20:02 +02:00
|
|
|
# Copyright (c) 2006 - 2008, Intel Corporation
|
2007-06-22 05:21:45 +02:00
|
|
|
# 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:
|
|
|
|
#
|
2008-10-23 08:20:02 +02:00
|
|
|
# SetJump.S
|
2007-06-22 05:21:45 +02:00
|
|
|
#
|
|
|
|
# Abstract:
|
|
|
|
#
|
|
|
|
# Implementation of SetJump() on IA-32.
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
.globl ASM_PFX(SetJump), ASM_PFX(InternalAssertJumpBuffer)
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# UINTN
|
|
|
|
# EFIAPI
|
|
|
|
# SetJump (
|
|
|
|
# OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
|
|
|
|
# );
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
ASM_PFX(SetJump):
|
|
|
|
pushl 0x4(%esp)
|
2008-10-28 10:51:44 +01:00
|
|
|
call ASM_PFX(InternalAssertJumpBuffer) # To validate JumpBuffer
|
2007-06-22 05:21:45 +02:00
|
|
|
pop %ecx
|
2008-10-28 10:51:44 +01:00
|
|
|
pop %ecx # ecx <- return address
|
2007-06-22 05:21:45 +02:00
|
|
|
movl (%esp), %edx
|
|
|
|
movl %ebx, (%edx)
|
|
|
|
movl %esi, 4(%edx)
|
|
|
|
movl %edi, 8(%edx)
|
|
|
|
movl %ebp, 12(%edx)
|
|
|
|
movl %esp, 16(%edx)
|
2008-10-28 10:51:44 +01:00
|
|
|
movl %ecx, 20(%edx) # eip value to restore in LongJump
|
2007-06-22 05:21:45 +02:00
|
|
|
xorl %eax, %eax
|
|
|
|
jmp *%ecx
|