summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/uintr_fd.c
diff options
context:
space:
mode:
authorYour Name <[email protected]>2023-07-14 10:12:10 +0000
committerYour Name <[email protected]>2023-07-14 10:12:10 +0000
commitffb2fd46016692b13b861ce57ac81ae29e75fe00 (patch)
tree6f658d56508c2ea30166c9a4b906e6d01ae5953f /arch/x86/kernel/uintr_fd.c
parent0decdced202d32ca2357ab258640d77a602aa72b (diff)
添加 5.18 的 uintr_wait 的修复uintr-next
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);
}