]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
uml: move userspace code to userspace file
authorJeff Dike <jdike@addtoit.com>
Tue, 16 Oct 2007 08:26:39 +0000 (01:26 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:43:04 +0000 (09:43 -0700)
Move some code from a kernelspace file to a userspace file where it fits
better.  This enables some tidying which is the subject of a later patch.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/drivers/chan_kern.c
arch/um/drivers/chan_user.c

index 629b00e3b0b0c36f39800836d8525afd14456999..9a6222f1a51b8a95c63384710c7fe6f3e538f872 100644 (file)
@@ -89,54 +89,6 @@ static const struct chan_ops not_configged_ops = {
 };
 #endif /* CONFIG_NOCONFIG_CHAN */
 
-void generic_close(int fd, void *unused)
-{
-       os_close_file(fd);
-}
-
-int generic_read(int fd, char *c_out, void *unused)
-{
-       int n;
-
-       n = os_read_file(fd, c_out, sizeof(*c_out));
-
-       if(n == -EAGAIN)
-               return 0;
-       else if(n == 0)
-               return -EIO;
-       return n;
-}
-
-/* XXX Trivial wrapper around os_write_file */
-
-int generic_write(int fd, const char *buf, int n, void *unused)
-{
-       return os_write_file(fd, buf, n);
-}
-
-int generic_window_size(int fd, void *unused, unsigned short *rows_out,
-                       unsigned short *cols_out)
-{
-       int rows, cols;
-       int ret;
-
-       ret = os_window_size(fd, &rows, &cols);
-       if(ret < 0)
-               return ret;
-
-       ret = ((*rows_out != rows) || (*cols_out != cols));
-
-       *rows_out = rows;
-       *cols_out = cols;
-
-       return ret;
-}
-
-void generic_free(void *data)
-{
-       kfree(data);
-}
-
 static void tty_receive_char(struct tty_struct *tty, char ch)
 {
        if(tty == NULL) return;
index 4d438f36ea2e66b68451dd6f9039b28e6dab11c2..249c877410d73b0105c9adb8770abaef600bafdd 100644 (file)
 #include "os.h"
 #include "choose-mode.h"
 #include "mode.h"
+#include "um_malloc.h"
+
+void generic_close(int fd, void *unused)
+{
+       os_close_file(fd);
+}
+
+int generic_read(int fd, char *c_out, void *unused)
+{
+       int n;
+
+       n = os_read_file(fd, c_out, sizeof(*c_out));
+
+       if(n == -EAGAIN)
+               return 0;
+       else if(n == 0)
+               return -EIO;
+       return n;
+}
+
+/* XXX Trivial wrapper around os_write_file */
+
+int generic_write(int fd, const char *buf, int n, void *unused)
+{
+       return os_write_file(fd, buf, n);
+}
+
+int generic_window_size(int fd, void *unused, unsigned short *rows_out,
+                       unsigned short *cols_out)
+{
+       int rows, cols;
+       int ret;
+
+       ret = os_window_size(fd, &rows, &cols);
+       if(ret < 0)
+               return ret;
+
+       ret = ((*rows_out != rows) || (*cols_out != cols));
+
+       *rows_out = rows;
+       *cols_out = cols;
+
+       return ret;
+}
+
+void generic_free(void *data)
+{
+       kfree(data);
+}
 
 int generic_console_write(int fd, const char *buf, int n)
 {