]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/X86FxRestore.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / BaseLib / X86FxRestore.c
1 /** @file
2 IA-32/x64 AsmFxRestore()
3
4 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9
10
11
12 #include "BaseLibInternals.h"
13
14 /**
15 Restores the current floating point/SSE/SSE2 context from a buffer.
16
17 Restores the current floating point/SSE/SSE2 state from the buffer specified
18 by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
19 only available on IA-32 and x64.
20
21 If Buffer is NULL, then ASSERT().
22 If Buffer is not aligned on a 16-byte boundary, then ASSERT().
23 If Buffer was not saved with AsmFxSave(), then ASSERT().
24
25 @param Buffer A pointer to a buffer to save the floating point/SSE/SSE2 context.
26
27 **/
28 VOID
29 EFIAPI
30 AsmFxRestore (
31 IN CONST IA32_FX_BUFFER *Buffer
32 )
33 {
34 ASSERT (Buffer != NULL);
35 ASSERT (0 == ((UINTN)Buffer & 0xf));
36
37 //
38 // Check the flag recorded by AsmFxSave()
39 //
40 ASSERT (0xAA5555AA == *(UINT32 *) (&Buffer->Buffer[sizeof (Buffer->Buffer) - 4]));
41
42 InternalX86FxRestore (Buffer);
43 }