summaryrefslogtreecommitdiff
path: root/InOsEmuPkg/Unix/Sec/EmuThunk.c
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-17 18:21:16 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-17 18:21:16 +0000
commit57c7d70ff9bcd4365d75b854046bbb390cb579c6 (patch)
treef55a5d5c20115d918df260ef03071015b36ee1d3 /InOsEmuPkg/Unix/Sec/EmuThunk.c
parentd8387fa4af2abae05dc6ec502b27adea455cdaaa (diff)
downloadedk2-platforms-57c7d70ff9bcd4365d75b854046bbb390cb579c6.tar.xz
InOsEmuPkg: Implement gIdleLoopEventGuid.
Added a CpuSleep () API to the Emulator Thunk. We needed to do this as the Stall() works hard to not get broken by the timer tic (POSIX signal). nanosleep() gets interrupted by the timer signal so it is a good emulator of a CpuSleep(); I was also able to remove some stalls in the X11 keyboard and mouse checking events, now that the gIdleLoopEventGuid was added. Signed-off-by: andrewfish git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11846 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'InOsEmuPkg/Unix/Sec/EmuThunk.c')
-rw-r--r--InOsEmuPkg/Unix/Sec/EmuThunk.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/InOsEmuPkg/Unix/Sec/EmuThunk.c b/InOsEmuPkg/Unix/Sec/EmuThunk.c
index 579f67fa1a..ca8be55a0f 100644
--- a/InOsEmuPkg/Unix/Sec/EmuThunk.c
+++ b/InOsEmuPkg/Unix/Sec/EmuThunk.c
@@ -286,6 +286,22 @@ SecSleep (
}
}
+
+VOID
+SecCpuSleep (
+ VOID
+ )
+{
+ struct timespec rq, rm;
+
+ // nanosleep gets interrupted by the timer tic
+ rq.tv_sec = 1;
+ rq.tv_nsec = 0;
+
+ nanosleep (&rq, &rm);
+}
+
+
VOID
SecExit (
UINTN Status
@@ -362,6 +378,7 @@ EMU_THUNK_PROTOCOL gEmuThunkProtocol = {
GasketQueryPerformanceFrequency,
GasketQueryPerformanceCounter,
GasketSecSleep,
+ GasketSecCpuSleep,
GasketSecExit,
GasketSecGetTime,
GasketSecSetTime,