aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/chan_kern.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-10-16 04:26:39 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:04 -0400
commit89fe64766ab76b02c65a806b8b5a864652493bd6 (patch)
tree7da7c84014acded2d74c8d04a3eec57de2bc7622 /arch/um/drivers/chan_kern.c
parent2090ab05fe4bc6b70e7245a9d3ea37afc49150ad (diff)
uml: move userspace code to userspace file
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>
Diffstat (limited to 'arch/um/drivers/chan_kern.c')
-rw-r--r--arch/um/drivers/chan_kern.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c
index 629b00e3b0b0..9a6222f1a51b 100644
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@ -89,54 +89,6 @@ static const struct chan_ops not_configged_ops = {
89}; 89};
90#endif /* CONFIG_NOCONFIG_CHAN */ 90#endif /* CONFIG_NOCONFIG_CHAN */
91 91
92void generic_close(int fd, void *unused)
93{
94 os_close_file(fd);
95}
96
97int generic_read(int fd, char *c_out, void *unused)
98{
99 int n;
100
101 n = os_read_file(fd, c_out, sizeof(*c_out));
102
103 if(n == -EAGAIN)
104 return 0;
105 else if(n == 0)
106 return -EIO;
107 return n;
108}
109
110/* XXX Trivial wrapper around os_write_file */
111
112int generic_write(int fd, const char *buf, int n, void *unused)
113{
114 return os_write_file(fd, buf, n);
115}
116
117int generic_window_size(int fd, void *unused, unsigned short *rows_out,
118 unsigned short *cols_out)
119{
120 int rows, cols;
121 int ret;
122
123 ret = os_window_size(fd, &rows, &cols);
124 if(ret < 0)
125 return ret;
126
127 ret = ((*rows_out != rows) || (*cols_out != cols));
128
129 *rows_out = rows;
130 *cols_out = cols;
131
132 return ret;
133}
134
135void generic_free(void *data)
136{
137 kfree(data);
138}
139
140static void tty_receive_char(struct tty_struct *tty, char ch) 92static void tty_receive_char(struct tty_struct *tty, char ch)
141{ 93{
142 if(tty == NULL) return; 94 if(tty == NULL) return;