]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseCpuLib/Ia32/CpuSleepGcc.c
1. Restore the inline C implementation of GCC assembly files that was temporarily...
[mirror_edk2.git] / MdePkg / Library / BaseCpuLib / Ia32 / CpuSleepGcc.c
diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuSleepGcc.c b/MdePkg/Library/BaseCpuLib/Ia32/CpuSleepGcc.c
new file mode 100644 (file)
index 0000000..fb5ca29
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  CpuSleep function for Ia32/X64 GCC.\r
+\r
+  Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
+  Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+\r
+/**\r
+  Places the CPU in a sleep state until an interrupt is received.\r
+\r
+  Places the CPU in a sleep state until an interrupt is received. If interrupts\r
+  are disabled prior to calling this function, then the CPU will be placed in a\r
+  sleep state indefinitely.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuSleep (\r
+  VOID\r
+  )\r
+{\r
+  __asm__ __volatile__ ("hlt"::: "memory");\r
+}\r
+\r