]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/BaseLib.h
MdePkg/BaseLib: Add support for the XSETBV instruction
[mirror_edk2.git] / MdePkg / Include / Library / BaseLib.h
index 1171a0ffb51b37fee353d41ac4366790b4e3c7d8..7253997a6f8c36fd69c73dd9fa5f9808495c7e36 100644 (file)
@@ -2,7 +2,7 @@
   Provides string functions, linked list functions, math functions, synchronization\r
   functions, file path functions, and CPU architecture-specific functions.\r
 \r
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>\r
 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 Copyright (c) Microsoft Corporation.<BR>\r
 Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>\r
@@ -7438,6 +7438,29 @@ AsmXGetBv (
   IN UINT32  Index\r
   );\r
 \r
+/**\r
+  Executes a XSETBV instruction to write a 64-bit value to a Extended Control\r
+  Register(XCR), and returns the value.\r
+\r
+  Writes the 64-bit value specified by Value to the XCR specified by Index. The\r
+  64-bit value written to the XCR is returned. No parameter checking is\r
+  performed on Index or Value, and some of these may cause CPU exceptions. The\r
+  caller must either guarantee that Index and Value are valid, or the caller\r
+  must establish proper exception handlers. This function is only available on\r
+  IA-32 and x64.\r
+\r
+  @param  Index The 32-bit XCR index to write.\r
+  @param  Value The 64-bit value to write to the XCR.\r
+\r
+  @return Value\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmXSetBv (\r
+  IN UINT32  Index,\r
+  IN UINT64  Value\r
+  );\r
 \r
 /**\r
   Executes a VMGEXIT instruction (VMMCALL with a REP prefix)\r