]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/RiscV64/CpuPause.c
MdePkg/BaseLib: BaseLib for RISCV64 architecture
[mirror_edk2.git] / MdePkg / Library / BaseLib / RiscV64 / CpuPause.c
diff --git a/MdePkg/Library/BaseLib/RiscV64/CpuPause.c b/MdePkg/Library/BaseLib/RiscV64/CpuPause.c
new file mode 100644 (file)
index 0000000..9931bad
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  CPU pause for RISC-V\r
+\r
+  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>\r
+\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+**/\r
+\r
+#include "BaseLibInternals.h"\r
+\r
+extern VOID RiscVCpuPause (VOID);\r
+\r
+\r
+/**\r
+  Requests CPU to pause for a short period of time.\r
+\r
+  Requests CPU to pause for a short period of time. Typically used in MP\r
+  systems to prevent memory starvation while waiting for a spin lock.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuPause (\r
+  VOID\r
+  )\r
+{\r
+  RiscVCpuPause ();\r
+}\r
+\r