Commit 7f5a7716 authored by Ralf Baechle's avatar Ralf Baechle

[MIPS] Fix AP/SP to work in the reality of modern kernels.

Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent de46c337
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched.h>
#include <linux/unistd.h> #include <linux/unistd.h>
#include <linux/file.h> #include <linux/file.h>
#include <linux/fs.h> #include <linux/fs.h>
...@@ -198,7 +199,6 @@ void sp_work_handle_request(void) ...@@ -198,7 +199,6 @@ void sp_work_handle_request(void)
int cmd; int cmd;
char *vcwd; char *vcwd;
mm_segment_t old_fs;
int size; int size;
ret.retval = -1; ret.retval = -1;
...@@ -241,8 +241,6 @@ void sp_work_handle_request(void) ...@@ -241,8 +241,6 @@ void sp_work_handle_request(void)
if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv, if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv,
(int)&tz, 0,0)) == 0) (int)&tz, 0,0)) == 0)
ret.retval = tv.tv_sec; ret.retval = tv.tv_sec;
ret.errno = errno;
break; break;
case MTSP_SYSCALL_EXIT: case MTSP_SYSCALL_EXIT:
...@@ -279,7 +277,6 @@ void sp_work_handle_request(void) ...@@ -279,7 +277,6 @@ void sp_work_handle_request(void)
if (cmd >= 0) { if (cmd >= 0) {
ret.retval = sp_syscall(cmd, generic.arg0, generic.arg1, ret.retval = sp_syscall(cmd, generic.arg0, generic.arg1,
generic.arg2, generic.arg3); generic.arg2, generic.arg3);
ret.errno = errno;
} else } else
printk(KERN_WARNING printk(KERN_WARNING
"KSPD: Unknown SP syscall number %d\n", sc.cmd); "KSPD: Unknown SP syscall number %d\n", sc.cmd);
......
...@@ -289,7 +289,7 @@ unsigned int rtlx_write_poll(int index) ...@@ -289,7 +289,7 @@ unsigned int rtlx_write_poll(int index)
return write_spacefree(chan->rt_read, chan->rt_write, chan->buffer_size); return write_spacefree(chan->rt_read, chan->rt_write, chan->buffer_size);
} }
ssize_t rtlx_read(int index, void __user *buff, size_t count, int user) ssize_t rtlx_read(int index, void __user *buff, size_t count)
{ {
size_t lx_write, fl = 0L; size_t lx_write, fl = 0L;
struct rtlx_channel *lx; struct rtlx_channel *lx;
...@@ -331,9 +331,10 @@ ssize_t rtlx_read(int index, void __user *buff, size_t count, int user) ...@@ -331,9 +331,10 @@ ssize_t rtlx_read(int index, void __user *buff, size_t count, int user)
return count; return count;
} }
ssize_t rtlx_write(int index, const void __user *buffer, size_t count, int user) ssize_t rtlx_write(int index, const void __user *buffer, size_t count)
{ {
struct rtlx_channel *rt; struct rtlx_channel *rt;
unsigned long failed;
size_t rt_read; size_t rt_read;
size_t fl; size_t fl;
...@@ -363,7 +364,7 @@ ssize_t rtlx_write(int index, const void __user *buffer, size_t count, int user) ...@@ -363,7 +364,7 @@ ssize_t rtlx_write(int index, const void __user *buffer, size_t count, int user)
} }
out: out:
count -= cailed; count -= failed;
smp_wmb(); smp_wmb();
rt->rt_write = (rt->rt_write + count) % rt->buffer_size; rt->rt_write = (rt->rt_write + count) % rt->buffer_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment