uti: fix syscall response is mis-consumed by __do_in_kernel_irq_syscall
Refs: #1617 Change-Id: Iddd8ccd81d7f692f1f45ec888d31c2a87ec521ce
This commit is contained in:
committed by
Masamichi Takagi
parent
afea6af667
commit
35296c8210
@ -366,6 +366,7 @@ retry_alloc:
|
||||
|
||||
#define STATUS_IN_PROGRESS 0
|
||||
#define STATUS_SYSCALL 4
|
||||
#define __NR_syscall_response 8001
|
||||
req->valid = 0;
|
||||
|
||||
if (__notify_syscall_requester(usrdata->os, packet, resp) < 0) {
|
||||
@ -440,7 +441,7 @@ retry_alloc:
|
||||
req->valid = 0;
|
||||
|
||||
/* check result */
|
||||
if (req->number != __NR_mmap) {
|
||||
if (req->number != __NR_syscall_response) {
|
||||
printk("%s:unexpected response. %lx %lx\n",
|
||||
__FUNCTION__, req->number, req->args[0]);
|
||||
syscall_ret = -EIO;
|
||||
|
||||
@ -244,6 +244,7 @@ long do_syscall(struct syscall_request *req, int cpu)
|
||||
#define STATUS_COMPLETED 1
|
||||
#define STATUS_PAGE_FAULT 3
|
||||
#define STATUS_SYSCALL 4
|
||||
#define __NR_syscall_response 8001
|
||||
while (smp_load_acquire(&res.status) != STATUS_COMPLETED) {
|
||||
while (smp_load_acquire(&res.status) == STATUS_IN_PROGRESS) {
|
||||
struct cpu_local_var *v;
|
||||
@ -372,7 +373,7 @@ long do_syscall(struct syscall_request *req, int cpu)
|
||||
}
|
||||
|
||||
/* send result */
|
||||
req2.number = __NR_mmap;
|
||||
req2.number = __NR_syscall_response;
|
||||
req2.args[1] = syscall_ret;
|
||||
/* The current thread is the requester and only the waiting thread
|
||||
* may serve the request */
|
||||
|
||||
Reference in New Issue
Block a user