summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-17 13:32:52 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-17 13:32:52 +0000
commitf94b9be34f10c7afd223aac1426a4e1b4defd7ae (patch)
tree7bbf970143086329158af85f8803db00135e4f98 /MdeModulePkg
parent3f1435782f57f001a7f4ae7d928d817ee3fe27f0 (diff)
downloadedk2-f94b9be34f10c7afd223aac1426a4e1b4defd7ae.tar.gz
edk2-f94b9be34f10c7afd223aac1426a4e1b4defd7ae.tar.bz2
edk2-f94b9be34f10c7afd223aac1426a4e1b4defd7ae.zip
Adjust the function layout of Timer.c to remove the prototype to reduce sync efforts.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5918 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Dxe/Event/Timer.c183
1 files changed, 70 insertions, 113 deletions
diff --git a/MdeModulePkg/Core/Dxe/Event/Timer.c b/MdeModulePkg/Core/Dxe/Event/Timer.c
index de5b169472..e1df72153d 100644
--- a/MdeModulePkg/Core/Dxe/Event/Timer.c
+++ b/MdeModulePkg/Core/Dxe/Event/Timer.c
@@ -16,47 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "DxeMain.h"
//
-// Internal prototypes
-//
-/**
- Returns the current system time.
-
- @return The current system time
-
-**/
-UINT64
-CoreCurrentSystemTime (
- VOID
- );
-
-/**
- Checks the sorted timer list against the current system time.
- Signals any expired event timer.
-
- @param CheckEvent Not used
- @param Context Not used
-
-**/
-VOID
-EFIAPI
-CoreCheckTimers (
- IN EFI_EVENT CheckEvent,
- IN VOID *Context
- );
-
-/**
- Inserts the timer event.
-
- @param Event Points to the internal structure of timer event
- to be installed
-
-**/
-VOID
-CoreInsertEventTimer (
- IN IEVENT *Event
- );
-
-//
// Internal data
//
@@ -71,26 +30,41 @@ UINT64 mEfiSystemTime = 0;
// Timer functions
//
/**
- Initializes timer support.
+ Inserts the timer event.
+
+ @param Event Points to the internal structure of timer event
+ to be installed
**/
VOID
-CoreInitializeTimer (
- VOID
+CoreInsertEventTimer (
+ IN IEVENT *Event
)
{
- EFI_STATUS Status;
+ UINT64 TriggerTime;
+ LIST_ENTRY *Link;
+ IEVENT *Event2;
- Status = CoreCreateEvent (
- EVT_NOTIFY_SIGNAL,
- TPL_HIGH_LEVEL - 1,
- CoreCheckTimers,
- NULL,
- &mEfiCheckTimerEvent
- );
- ASSERT_EFI_ERROR (Status);
-}
+ ASSERT_LOCKED (&mEfiTimerLock);
+
+ //
+ // Get the timer's trigger time
+ //
+ TriggerTime = Event->u.Timer.TriggerTime;
+
+ //
+ // Insert the timer into the timer database in assending sorted order
+ //
+ for (Link = mEfiTimerList.ForwardLink; Link != &mEfiTimerList; Link = Link->ForwardLink) {
+ Event2 = CR (Link, IEVENT, u.Timer.Link, EVENT_SIGNATURE);
+ if (Event2->u.Timer.TriggerTime > TriggerTime) {
+ break;
+ }
+ }
+
+ InsertTailList (Link, &Event->u.Timer.Link);
+}
/**
Returns the current system time.
@@ -112,48 +86,6 @@ CoreCurrentSystemTime (
return SystemTime;
}
-
-/**
- Called by the platform code to process a tick.
-
- @param Duration The number of 100ns elasped since the last call
- to TimerTick
-
-**/
-VOID
-EFIAPI
-CoreTimerTick (
- IN UINT64 Duration
- )
-{
- IEVENT *Event;
-
- //
- // Check runtiem flag in case there are ticks while exiting boot services
- //
- CoreAcquireLock (&mEfiSystemTimeLock);
-
- //
- // Update the system time
- //
- mEfiSystemTime += Duration;
-
- //
- // If the head of the list is expired, fire the timer event
- // to process it
- //
- if (!IsListEmpty (&mEfiTimerList)) {
- Event = CR (mEfiTimerList.ForwardLink, IEVENT, u.Timer.Link, EVENT_SIGNATURE);
-
- if (Event->u.Timer.TriggerTime <= mEfiSystemTime) {
- CoreSignalEvent (mEfiCheckTimerEvent);
- }
- }
-
- CoreReleaseLock (&mEfiSystemTimeLock);
-}
-
-
/**
Checks the sorted timer list against the current system time.
Signals any expired event timer.
@@ -229,40 +161,65 @@ CoreCheckTimers (
/**
- Inserts the timer event.
+ Initializes timer support.
- @param Event Points to the internal structure of timer event
- to be installed
+**/
+VOID
+CoreInitializeTimer (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+
+ Status = CoreCreateEvent (
+ EVT_NOTIFY_SIGNAL,
+ TPL_HIGH_LEVEL - 1,
+ CoreCheckTimers,
+ NULL,
+ &mEfiCheckTimerEvent
+ );
+ ASSERT_EFI_ERROR (Status);
+}
+
+
+/**
+ Called by the platform code to process a tick.
+
+ @param Duration The number of 100ns elasped since the last call
+ to TimerTick
**/
VOID
-CoreInsertEventTimer (
- IN IEVENT *Event
+EFIAPI
+CoreTimerTick (
+ IN UINT64 Duration
)
{
- UINT64 TriggerTime;
- LIST_ENTRY *Link;
- IEVENT *Event2;
+ IEVENT *Event;
- ASSERT_LOCKED (&mEfiTimerLock);
+ //
+ // Check runtiem flag in case there are ticks while exiting boot services
+ //
+ CoreAcquireLock (&mEfiSystemTimeLock);
//
- // Get the timer's trigger time
+ // Update the system time
//
- TriggerTime = Event->u.Timer.TriggerTime;
+ mEfiSystemTime += Duration;
//
- // Insert the timer into the timer database in assending sorted order
+ // If the head of the list is expired, fire the timer event
+ // to process it
//
- for (Link = mEfiTimerList.ForwardLink; Link != &mEfiTimerList; Link = Link->ForwardLink) {
- Event2 = CR (Link, IEVENT, u.Timer.Link, EVENT_SIGNATURE);
+ if (!IsListEmpty (&mEfiTimerList)) {
+ Event = CR (mEfiTimerList.ForwardLink, IEVENT, u.Timer.Link, EVENT_SIGNATURE);
- if (Event2->u.Timer.TriggerTime > TriggerTime) {
- break;
+ if (Event->u.Timer.TriggerTime <= mEfiSystemTime) {
+ CoreSignalEvent (mEfiCheckTimerEvent);
}
}
- InsertTailList (Link, &Event->u.Timer.Link);
+ CoreReleaseLock (&mEfiSystemTimeLock);
}