summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/uintr_fd.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/uintr_fd.c')
-rw-r--r--arch/x86/kernel/uintr_fd.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/x86/kernel/uintr_fd.c b/arch/x86/kernel/uintr_fd.c
index f2e59d445733..5e6784b50132 100644
--- a/arch/x86/kernel/uintr_fd.c
+++ b/arch/x86/kernel/uintr_fd.c
@@ -304,16 +304,23 @@ out_fdput:
}
/*
- * sys_uintr_wait - Wait for a user interrupt
+ * sys_uintr_wait - Wait for a user interrupt for the specified time
*/
-SYSCALL_DEFINE1(uintr_wait, unsigned int, flags)
+SYSCALL_DEFINE2(uintr_wait, u64, usec, unsigned int, flags)
{
+ ktime_t expires;
+
if (!uintr_arch_enabled())
return -EOPNOTSUPP;
if (flags)
return -EINVAL;
- /* TODO: Add a timeout option */
- return uintr_receiver_wait(); // 主要逻辑在这了
+ if (usec == 0)
+ return 0;
+
+ /* For now, use a default timeout value of 100 usec */
+ /* For qemu 2575 is recommend*/
+ expires = usec * NSEC_PER_USEC;
+ return uintr_receiver_wait(&expires);
}