Timer.c revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
Core Timer Services
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
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
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "DxeMain.h"
#include "Event.h"
//
// Internal data
//
UINT64 mEfiSystemTime = 0;
//
// Timer functions
//
/**
Inserts the timer event.
@param Event Points to the internal structure of timer event
to be installed
**/
)
{
//
// Get the timer's trigger time
//
//
// Insert the timer into the timer database in assending sorted order
//
break;
}
}
}
/**
Returns the current system time.
@return The current system time
**/
)
{
return SystemTime;
}
/**
Checks the sorted timer list against the current system time.
Signals any expired event timer.
@param CheckEvent Not used
@param Context Not used
**/
)
{
//
// Check the timer database for expired timers
//
while (!IsListEmpty (&mEfiTimerList)) {
//
// If this timer is not expired, then we're done
//
break;
}
//
// Remove this timer from the timer queue
//
//
// Signal it
//
//
// If this is a periodic timer, set it
//
//
// Compute the timers new trigger time
//
//
// If that's before now, then reset the timer to start from now
//
}
//
// Add the timer
//
}
}
}
/**
Initializes timer support.
**/
)
{
TPL_HIGH_LEVEL - 1,
NULL,
NULL,
);
}
/**
Called by the platform code to process a tick.
@param Duration The number of 100ns elasped since the last call
to TimerTick
**/
)
{
//
// Check runtiem flag in case there are ticks while exiting boot services
//
//
// Update the system time
//
//
// If the head of the list is expired, fire the timer event
// to process it
//
if (!IsListEmpty (&mEfiTimerList)) {
}
}
}
/**
Sets the type of timer and the trigger time for a timer event.
@param UserEvent The timer event that is to be signaled at the
specified time
@param Type The type of time that is specified in
TriggerTime
@param TriggerTime The number of 100ns units until the timer
expires
@retval EFI_SUCCESS The event has been set to be signaled at the
requested time
@retval EFI_INVALID_PARAMETER Event or Type is not valid
**/
)
{
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
//
// If the timer is queued to the timer database, remove it
//
}
if (Type != TimerCancel) {
if (Type == TimerPeriodic) {
}
if (TriggerTime == 0) {
}
}
return EFI_SUCCESS;
}