diff options
| author | Your Name <[email protected]> | 2023-07-14 08:06:10 +0000 |
|---|---|---|
| committer | Your Name <[email protected]> | 2023-07-14 08:06:10 +0000 |
| commit | 76b865af2d59d018d8e2805ea9ac7a411361265b (patch) | |
| tree | 8987e7eb6480f6dd0d7709698501540c28209d69 /arch/x86/kernel/uintr_fd.c | |
| parent | 4ca20702c9e9438bdc3736ff3db94aa28ed88297 (diff) | |
sys_uintr_wait 添加超时时间支持.qemu 下建议 2575usuintr_wait_fix
Diffstat (limited to 'arch/x86/kernel/uintr_fd.c')
| -rw-r--r-- | arch/x86/kernel/uintr_fd.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/x86/kernel/uintr_fd.c b/arch/x86/kernel/uintr_fd.c index 891c4568d60b..8ddc6a7575bf 100644 --- a/arch/x86/kernel/uintr_fd.c +++ b/arch/x86/kernel/uintr_fd.c @@ -301,16 +301,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); } |
