summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
54cd17e)
When the MdeModulePkg gCoreEventIdleGuid event is signaled,
CpuSleep is called. This will cause the CPU to sleep until
the next interrupt occurs.
Signed-off-by: jljusten
Reviewed-by: mdkinney
Reviewed-by: rsun3
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11842
6f19259b-4bc3-4df7-8a09-
765794883524
+/**\r
+ Callback function for idle events.\r
+ \r
+ @param Event Event whose notification function is being invoked.\r
+ @param Context The pointer to the notification function's context,\r
+ which is implementation-dependent.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+IdleLoopEventCallback (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ )\r
+{\r
+ CpuSleep ();\r
+}\r
+\r
+\r
/**\r
Initialize the state information for the CPU Architectural Protocol.\r
\r
/**\r
Initialize the state information for the CPU Architectural Protocol.\r
\r
)\r
{\r
EFI_STATUS Status;\r
)\r
{\r
EFI_STATUS Status;\r
+ EFI_EVENT IdleLoopEvent;\r
\r
//\r
// Make sure interrupts are disabled\r
\r
//\r
// Make sure interrupts are disabled\r
//\r
RefreshGcdMemoryAttributes ();\r
\r
//\r
RefreshGcdMemoryAttributes ();\r
\r
+ //\r
+ // Setup a callback for idle events\r
+ //\r
+ Status = gBS->CreateEventEx (\r
+ EVT_NOTIFY_SIGNAL,\r
+ TPL_NOTIFY,\r
+ IdleLoopEventCallback,\r
+ NULL,\r
+ &gIdleLoopEventGuid,\r
+ &IdleLoopEvent\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
/** @file\r
CPU DXE Module.\r
\r
/** @file\r
CPU DXE Module.\r
\r
- Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>\r
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
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
#include <Library/MemoryAllocationLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/MtrrLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/MtrrLib.h>\r
+#include <Guid/IdleLoopEvent.h>\r
#\r
# Component description file for simple CPU driver\r
#\r
#\r
# Component description file for simple CPU driver\r
#\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>\r
# 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
# 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
\r
[Packages]\r
MdePkg/MdePkg.dec\r
\r
[Packages]\r
MdePkg/MdePkg.dec\r
+ MdeModulePkg/MdeModulePkg.dec\r
UefiCpuPkg/UefiCpuPkg.dec\r
\r
[LibraryClasses]\r
UefiCpuPkg/UefiCpuPkg.dec\r
\r
[LibraryClasses]\r
[Protocols]\r
gEfiCpuArchProtocolGuid\r
\r
[Protocols]\r
gEfiCpuArchProtocolGuid\r
\r
+[Guids]\r
+ gIdleLoopEventGuid ## CONSUMES ## GUID\r
+\r