SetJumpLongJump.c revision 35a171541199329108aa8c5417386d7afce9ddbf
1/** @file
2  Implementation of SetJump() and LongJump() on EBC.
3
4  SetJump() and LongJump() are not currently supported for the EBC processor type.
5  Implementation for EBC just returns 0 for SetJump(), and ASSERT() for LongJump().
6
7  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
8  This program and the accompanying materials
9  are licensed and made available under the terms and conditions of the BSD License
10  which accompanies this distribution.  The full text of the license may be found at
11  http://opensource.org/licenses/bsd-license.php.
12
13  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16**/
17
18#include "BaseLibInternals.h"
19
20/**
21  Saves the current CPU context that can be restored with a call to LongJump() and returns 0.
22
23  Saves the current CPU context in the buffer specified by JumpBuffer and returns 0.  The initial
24  call to SetJump() must always return 0.  Subsequent calls to LongJump() cause a non-zero
25  value to be returned by SetJump().
26
27  If JumpBuffer is NULL, then ASSERT().
28  For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
29
30  @param  JumpBuffer    A pointer to CPU context buffer.
31
32  @retval 0 Indicates a return from SetJump().
33
34**/
35UINTN
36EFIAPI
37SetJump (
38  OUT      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer
39  )
40{
41  InternalAssertJumpBuffer (JumpBuffer);
42  return 0;
43}
44
45/**
46  Restores the CPU context that was saved with SetJump().
47
48  Restores the CPU context from the buffer specified by JumpBuffer.
49  This function never returns to the caller.
50  Instead it resumes execution based on the state of JumpBuffer.
51
52  @param  JumpBuffer    A pointer to CPU context buffer.
53  @param  Value         The value to return when the SetJump() context is restored.
54
55**/
56VOID
57EFIAPI
58InternalLongJump (
59  IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,
60  IN      UINTN                     Value
61  )
62{
63  //
64  // This function cannot work on EBC
65  //
66  ASSERT (FALSE);
67}
68