2007-06-22 11:21:45 +08:00
|
|
|
/** @file
|
|
|
|
IA-32/x64 AsmFxSave()
|
|
|
|
|
2012-10-30 16:35:08 +08:00
|
|
|
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
2019-04-04 07:06:00 +08:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2007-06-22 11:21:45 +08:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
2008-09-17 15:46:17 +08:00
|
|
|
|
2007-06-30 07:22:13 +08:00
|
|
|
|
2007-06-22 11:21:45 +08:00
|
|
|
|
|
|
|
#include "BaseLibInternals.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
Save the current floating point/SSE/SSE2 context to a buffer.
|
|
|
|
|
|
|
|
Saves the current floating point/SSE/SSE2 state to the buffer specified by
|
|
|
|
Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
|
2008-12-05 11:23:13 +08:00
|
|
|
available on IA-32 and x64.
|
2007-06-22 11:21:45 +08:00
|
|
|
|
|
|
|
If Buffer is NULL, then ASSERT().
|
|
|
|
If Buffer is not aligned on a 16-byte boundary, then ASSERT().
|
|
|
|
|
2010-06-24 08:20:35 +08:00
|
|
|
@param Buffer A pointer to a buffer to save the floating point/SSE/SSE2 context.
|
2007-06-22 11:21:45 +08:00
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
AsmFxSave (
|
|
|
|
OUT IA32_FX_BUFFER *Buffer
|
|
|
|
)
|
|
|
|
{
|
|
|
|
ASSERT (Buffer != NULL);
|
2008-07-08 17:38:43 +08:00
|
|
|
ASSERT (0 == ((UINTN)Buffer & 0xf));
|
2007-06-22 11:21:45 +08:00
|
|
|
|
|
|
|
InternalX86FxSave (Buffer);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Mark one flag at end of Buffer, it will be check by AsmFxRestor()
|
|
|
|
//
|
2012-10-30 16:35:08 +08:00
|
|
|
*(UINT32 *) (&Buffer->Buffer[sizeof (Buffer->Buffer) - 4]) = 0xAA5555AA;
|
2007-06-22 11:21:45 +08:00
|
|
|
}
|