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