summaryrefslogtreecommitdiff
path: root/UnixPkg/Sec/UnixThunk.c
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-16 05:28:50 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-16 05:28:50 +0000
commit73aa7f049bcc615f1a09dae29ec9a89cacd27420 (patch)
treea9ce2d363c2d51598f6c323d1113bc38d54e5acd /UnixPkg/Sec/UnixThunk.c
parent19efd9ec947b56397e24195144bddd8a89a16fd1 (diff)
downloadedk2-platforms-73aa7f049bcc615f1a09dae29ec9a89cacd27420.tar.xz
merge the generation of SecMain into the whole build process.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5491 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg/Sec/UnixThunk.c')
-rw-r--r--UnixPkg/Sec/UnixThunk.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/UnixPkg/Sec/UnixThunk.c b/UnixPkg/Sec/UnixThunk.c
index 500568ad52..44dfb1682f 100644
--- a/UnixPkg/Sec/UnixThunk.c
+++ b/UnixPkg/Sec/UnixThunk.c
@@ -58,6 +58,7 @@ VOID
SetTimer (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs))
{
struct itimerval timerval;
+ UINT32 remainder;
if (!settimer_initialized) {
struct sigaction act;
@@ -73,9 +74,10 @@ SetTimer (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs))
printf ("SetTimer: gettimeofday error %s\n", strerror (errno));
}
}
- timerval.it_value.tv_sec = PeriodMs / 1000;
- timerval.it_value.tv_usec = (PeriodMs % 1000) * 1000;
- timerval.it_value.tv_sec = PeriodMs / 1000;
+ timerval.it_value.tv_sec = DivU64x32(PeriodMs, 1000);
+ DivU64x32Remainder(PeriodMs, 1000, &remainder);
+ timerval.it_value.tv_usec = remainder * 1000;
+ timerval.it_value.tv_sec = DivU64x32(PeriodMs, 1000);
timerval.it_interval = timerval.it_value;
if (setitimer (ITIMER_REAL, &timerval, NULL) != 0) {