StdLib: Eliminate TimerLib dependencies.

Implement the clock() function using the EFI time-of-day clock instead of a TimerLib instance.

Signed-off-by: darylm503
Reviewed-by: jljusten
Reviewed-by: geekboy15a


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12683 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
darylm503
2011-11-11 00:32:31 +00:00
parent 4b3d663f7b
commit 8aa163da5a
5 changed files with 36 additions and 76 deletions

View File

@@ -27,8 +27,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <MainData.h>
#include <sys/EfiSysCall.h>
#include <unistd.h>
extern int main( int, char**);
extern int __sse2_available;
@@ -149,13 +150,8 @@ ShellAppMain (
errno = 0;
EFIerrno = 0;
#ifdef NT32dvm
gMD->ClocksPerSecond = 1; // For NT32 only
gMD->AppStartTime = 1; // For NT32 only
#else
gMD->ClocksPerSecond = (clock_t)GetPerformanceCounterProperties( NULL, NULL);
gMD->AppStartTime = (clock_t)GetPerformanceCounter();
#endif /* NT32 dvm */
gMD->ClocksPerSecond = 1;
gMD->AppStartTime = (clock_t)((UINT32)time(NULL));
// Initialize file descriptors
mfd = gMD->fdarray;