]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Library/BaseLib/X86FxSave.c
MdePkg: Replace BSD License with BSD+Patent License
[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\r
10\r
11\r
12#include "BaseLibInternals.h"\r
13\r
14/**\r
15 Save the current floating point/SSE/SSE2 context to a buffer.\r
16\r
17 Saves the current floating point/SSE/SSE2 state to the buffer specified by\r
18 Buffer. Buffer must be aligned on a 16-byte boundary. This function is only\r
19 available on IA-32 and x64.\r
20\r
21 If Buffer is NULL, then ASSERT().\r
22 If Buffer is not aligned on a 16-byte boundary, then ASSERT().\r
23\r
24 @param Buffer A pointer to a buffer to save the floating point/SSE/SSE2 context.\r
25\r
26**/\r
27VOID\r
28EFIAPI\r
29AsmFxSave (\r
30 OUT IA32_FX_BUFFER *Buffer\r
31 )\r
32{\r
33 ASSERT (Buffer != NULL);\r
34 ASSERT (0 == ((UINTN)Buffer & 0xf));\r
35\r
36 InternalX86FxSave (Buffer);\r
37\r
38 //\r
39 // Mark one flag at end of Buffer, it will be check by AsmFxRestor()\r
40 //\r
41 *(UINT32 *) (&Buffer->Buffer[sizeof (Buffer->Buffer) - 4]) = 0xAA5555AA;\r
42}\r