mirror of https://github.com/acidanthera/audk.git
ArmPkg/CpuDxe: Register a callback for the gIdleLoopEventGuid event
This gIdleLoopEventGuid event signals the Cpu that it should go into the idle state waiting for any events. CpuSleep() is used in this implementation to make the Cpu wait for the next interrupt (WFI instruction). git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11863 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
149daa615f
commit
8513037f2c
|
@ -1,6 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||||
|
Copyright (c) 2011, ARM Limited. All rights reserved.
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -14,6 +15,8 @@
|
||||||
|
|
||||||
#include "CpuDxe.h"
|
#include "CpuDxe.h"
|
||||||
|
|
||||||
|
#include <Guid/IdleLoopEvent.h>
|
||||||
|
|
||||||
BOOLEAN mInterruptState = FALSE;
|
BOOLEAN mInterruptState = FALSE;
|
||||||
|
|
||||||
|
|
||||||
|
@ -194,6 +197,23 @@ CpuGetTimerValue (
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Callback function for idle events.
|
||||||
|
|
||||||
|
@param Event Event whose notification function is being invoked.
|
||||||
|
@param Context The pointer to the notification function's context,
|
||||||
|
which is implementation-dependent.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
IdleLoopEventCallback (
|
||||||
|
IN EFI_EVENT Event,
|
||||||
|
IN VOID *Context
|
||||||
|
)
|
||||||
|
{
|
||||||
|
CpuSleep ();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Globals used to initialize the protocol
|
// Globals used to initialize the protocol
|
||||||
|
@ -219,10 +239,10 @@ CpuDxeInitialize (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
EFI_EVENT IdleLoopEvent;
|
||||||
|
|
||||||
InitializeExceptions (&mCpu);
|
InitializeExceptions (&mCpu);
|
||||||
|
|
||||||
|
|
||||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
&mCpuHandle,
|
&mCpuHandle,
|
||||||
&gEfiCpuArchProtocolGuid, &mCpu,
|
&gEfiCpuArchProtocolGuid, &mCpu,
|
||||||
|
@ -237,6 +257,18 @@ CpuDxeInitialize (
|
||||||
//
|
//
|
||||||
SyncCacheConfig (&mCpu);
|
SyncCacheConfig (&mCpu);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Setup a callback for idle events
|
||||||
|
//
|
||||||
|
Status = gBS->CreateEventEx (
|
||||||
|
EVT_NOTIFY_SIGNAL,
|
||||||
|
TPL_NOTIFY,
|
||||||
|
IdleLoopEventCallback,
|
||||||
|
NULL,
|
||||||
|
&gIdleLoopEventGuid,
|
||||||
|
&IdleLoopEvent
|
||||||
|
);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
# DXE CPU driver
|
# DXE CPU driver
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009, Apple Inc. All rights reserved.<BR>
|
# Copyright (c) 2009, Apple Inc. All rights reserved.<BR>
|
||||||
|
# Copyright (c) 2011, ARM Limited. All rights reserved.
|
||||||
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
# which accompanies this distribution. The full text of the license may be found at
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -45,6 +47,7 @@
|
||||||
ArmPkg/ArmPkg.dec
|
ArmPkg/ArmPkg.dec
|
||||||
EmbeddedPkg/EmbeddedPkg.dec
|
EmbeddedPkg/EmbeddedPkg.dec
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
|
MdeModulePkg/MdeModulePkg.dec
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
BaseMemoryLib
|
BaseMemoryLib
|
||||||
|
@ -65,6 +68,7 @@
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiDebugImageInfoTableGuid
|
gEfiDebugImageInfoTableGuid
|
||||||
|
gIdleLoopEventGuid
|
||||||
|
|
||||||
[Pcd.common]
|
[Pcd.common]
|
||||||
gArmTokenSpaceGuid.PcdVFPEnabled
|
gArmTokenSpaceGuid.PcdVFPEnabled
|
||||||
|
|
Loading…
Reference in New Issue