]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
um: take chan_*.h and line.h to arch/um/drivers
authorAl Viro <viro@ftp.linux.org.uk>
Thu, 18 Aug 2011 19:08:29 +0000 (20:08 +0100)
committerRichard Weinberger <richard@nod.at>
Wed, 2 Nov 2011 13:15:12 +0000 (14:15 +0100)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/drivers/chan.h [new file with mode: 0644]
arch/um/drivers/chan_kern.c
arch/um/drivers/chan_user.h [new file with mode: 0644]
arch/um/drivers/line.c
arch/um/drivers/line.h [new file with mode: 0644]
arch/um/drivers/ssl.c
arch/um/drivers/stdio_console.c
arch/um/include/shared/chan_kern.h [deleted file]
arch/um/include/shared/chan_user.h [deleted file]
arch/um/include/shared/line.h [deleted file]
arch/um/os-Linux/skas/process.c

diff --git a/arch/um/drivers/chan.h b/arch/um/drivers/chan.h
new file mode 100644 (file)
index 0000000..8df0fd9
--- /dev/null
@@ -0,0 +1,50 @@
+/* 
+ * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
+ * Licensed under the GPL
+ */
+
+#ifndef __CHAN_KERN_H__
+#define __CHAN_KERN_H__
+
+#include <linux/tty.h>
+#include <linux/list.h>
+#include <linux/console.h>
+#include "chan_user.h"
+#include "line.h"
+
+struct chan {
+       struct list_head list;
+       struct list_head free_list;
+       struct line *line;
+       char *dev;
+       unsigned int primary:1;
+       unsigned int input:1;
+       unsigned int output:1;
+       unsigned int opened:1;
+       unsigned int enabled:1;
+       int fd;
+       const struct chan_ops *ops;
+       void *data;
+};
+
+extern void chan_interrupt(struct list_head *chans, struct delayed_work *task,
+                          struct tty_struct *tty, int irq);
+extern int parse_chan_pair(char *str, struct line *line, int device,
+                          const struct chan_opts *opts, char **error_out);
+extern int write_chan(struct list_head *chans, const char *buf, int len,
+                            int write_irq);
+extern int console_write_chan(struct list_head *chans, const char *buf, 
+                             int len);
+extern int console_open_chan(struct line *line, struct console *co);
+extern void deactivate_chan(struct list_head *chans, int irq);
+extern void reactivate_chan(struct list_head *chans, int irq);
+extern void chan_enable_winch(struct list_head *chans, struct tty_struct *tty);
+extern int enable_chan(struct line *line);
+extern void close_chan(struct list_head *chans, int delay_free_irq);
+extern int chan_window_size(struct list_head *chans, 
+                            unsigned short *rows_out, 
+                            unsigned short *cols_out);
+extern int chan_config_string(struct list_head *chans, char *str, int size,
+                             char **error_out);
+
+#endif
index d4191fe1ceded2e87b1ed08dacc748810f0a79d8..e0406832df89e7fad23a22cd09273f43ddc5a1f9 100644 (file)
@@ -6,7 +6,7 @@
 #include <linux/slab.h>
 #include <linux/tty.h>
 #include <linux/tty_flip.h>
-#include "chan_kern.h"
+#include "chan.h"
 #include "os.h"
 
 #ifdef CONFIG_NOCONFIG_CHAN
diff --git a/arch/um/drivers/chan_user.h b/arch/um/drivers/chan_user.h
new file mode 100644 (file)
index 0000000..9b9ced8
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
+ * Licensed under the GPL
+ */
+
+#ifndef __CHAN_USER_H__
+#define __CHAN_USER_H__
+
+#include "init.h"
+
+struct chan_opts {
+       void (*const announce)(char *dev_name, int dev);
+       char *xterm_title;
+       const int raw;
+};
+
+enum chan_init_pri { INIT_STATIC, INIT_ALL, INIT_ONE };
+
+struct chan_ops {
+       char *type;
+       void *(*init)(char *, int, const struct chan_opts *);
+       int (*open)(int, int, int, void *, char **);
+       void (*close)(int, void *);
+       int (*read)(int, char *, void *);
+       int (*write)(int, const char *, int, void *);
+       int (*console_write)(int, const char *, int);
+       int (*window_size)(int, void *, unsigned short *, unsigned short *);
+       void (*free)(void *);
+       int winch;
+};
+
+extern const struct chan_ops fd_ops, null_ops, port_ops, pts_ops, pty_ops,
+       tty_ops, xterm_ops;
+
+extern void generic_close(int fd, void *unused);
+extern int generic_read(int fd, char *c_out, void *unused);
+extern int generic_write(int fd, const char *buf, int n, void *unused);
+extern int generic_console_write(int fd, const char *buf, int n);
+extern int generic_window_size(int fd, void *unused, unsigned short *rows_out,
+                              unsigned short *cols_out);
+extern void generic_free(void *data);
+
+struct tty_struct;
+extern void register_winch(int fd,  struct tty_struct *tty);
+extern void register_winch_irq(int fd, int tty_fd, int pid,
+                              struct tty_struct *tty, unsigned long stack);
+
+#define __channel_help(fn, prefix) \
+__uml_help(fn, prefix "[0-9]*=<channel description>\n" \
+"    Attach a console or serial line to a host channel.  See\n" \
+"    http://user-mode-linux.sourceforge.net/old/input.html for a complete\n" \
+"    description of this switch.\n\n" \
+);
+
+#endif
index 364c8a15c4c33a6113a2ff36f526a88089a062e5..c1cf2206b84bcebb6326a48787c93f965326763b 100644 (file)
@@ -7,7 +7,7 @@
 #include "linux/kd.h"
 #include "linux/sched.h"
 #include "linux/slab.h"
-#include "chan_kern.h"
+#include "chan.h"
 #include "irq_kern.h"
 #include "irq_user.h"
 #include "kern_util.h"
diff --git a/arch/um/drivers/line.h b/arch/um/drivers/line.h
new file mode 100644 (file)
index 0000000..63df3ca
--- /dev/null
@@ -0,0 +1,106 @@
+/* 
+ * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
+ * Licensed under the GPL
+ */
+
+#ifndef __LINE_H__
+#define __LINE_H__
+
+#include "linux/list.h"
+#include "linux/workqueue.h"
+#include "linux/tty.h"
+#include "linux/interrupt.h"
+#include "linux/spinlock.h"
+#include "linux/mutex.h"
+#include "chan_user.h"
+#include "mconsole_kern.h"
+
+/* There's only one modifiable field in this - .mc.list */
+struct line_driver {
+       const char *name;
+       const char *device_name;
+       const short major;
+       const short minor_start;
+       const short type;
+       const short subtype;
+       const int read_irq;
+       const char *read_irq_name;
+       const int write_irq;
+       const char *write_irq_name;
+       struct mc_device mc;
+};
+
+struct line {
+       struct tty_struct *tty;
+       spinlock_t count_lock;
+       unsigned long count;
+       int valid;
+
+       char *init_str;
+       int init_pri;
+       struct list_head chan_list;
+
+       /*This lock is actually, mostly, local to*/
+       spinlock_t lock;
+       int throttled;
+       /* Yes, this is a real circular buffer.
+        * XXX: And this should become a struct kfifo!
+        *
+        * buffer points to a buffer allocated on demand, of length
+        * LINE_BUFSIZE, head to the start of the ring, tail to the end.*/
+       char *buffer;
+       char *head;
+       char *tail;
+
+       int sigio;
+       struct delayed_work task;
+       const struct line_driver *driver;
+       int have_irq;
+};
+
+#define LINE_INIT(str, d) \
+       { .count_lock = __SPIN_LOCK_UNLOCKED((str).count_lock), \
+         .init_str =   str,    \
+         .init_pri =   INIT_STATIC, \
+         .valid =      1, \
+         .lock =       __SPIN_LOCK_UNLOCKED((str).lock), \
+         .driver =     d }
+
+extern void line_close(struct tty_struct *tty, struct file * filp);
+extern int line_open(struct line *lines, struct tty_struct *tty);
+extern int line_setup(struct line *lines, unsigned int sizeof_lines,
+                     char *init, char **error_out);
+extern int line_write(struct tty_struct *tty, const unsigned char *buf,
+                     int len);
+extern int line_put_char(struct tty_struct *tty, unsigned char ch);
+extern void line_set_termios(struct tty_struct *tty, struct ktermios * old);
+extern int line_chars_in_buffer(struct tty_struct *tty);
+extern void line_flush_buffer(struct tty_struct *tty);
+extern void line_flush_chars(struct tty_struct *tty);
+extern int line_write_room(struct tty_struct *tty);
+extern int line_ioctl(struct tty_struct *tty, unsigned int cmd,
+                               unsigned long arg);
+extern void line_throttle(struct tty_struct *tty);
+extern void line_unthrottle(struct tty_struct *tty);
+
+extern char *add_xterm_umid(char *base);
+extern int line_setup_irq(int fd, int input, int output, struct line *line,
+                         void *data);
+extern void line_close_chan(struct line *line);
+extern struct tty_driver *register_lines(struct line_driver *line_driver,
+                                        const struct tty_operations *driver,
+                                        struct line *lines, int nlines);
+extern void lines_init(struct line *lines, int nlines, struct chan_opts *opts);
+extern void close_lines(struct line *lines, int nlines);
+
+extern int line_config(struct line *lines, unsigned int sizeof_lines,
+                      char *str, const struct chan_opts *opts,
+                      char **error_out);
+extern int line_id(char **str, int *start_out, int *end_out);
+extern int line_remove(struct line *lines, unsigned int sizeof_lines, int n,
+                      char **error_out);
+extern int line_get_config(char *dev, struct line *lines,
+                          unsigned int sizeof_lines, char *str,
+                          int size, char **error_out);
+
+#endif
index 678e205adf29b02b357eb9b5db202d80ee2604ca..9d8c20af6f80dac061641ce61de33975c176b892 100644 (file)
@@ -12,9 +12,8 @@
 #include "linux/console.h"
 #include "asm/termbits.h"
 #include "asm/irq.h"
-#include "line.h"
 #include "ssl.h"
-#include "chan_kern.h"
+#include "chan.h"
 #include "init.h"
 #include "irq_user.h"
 #include "mconsole_kern.h"
index 49266f6108c480c3afb7e551c9b0d788f9c90f00..088776f01908e2eb5a27281cbac37b5927012881 100644 (file)
@@ -20,8 +20,7 @@
 #include "asm/current.h"
 #include "asm/irq.h"
 #include "stdio_console.h"
-#include "line.h"
-#include "chan_kern.h"
+#include "chan.h"
 #include "irq_user.h"
 #include "mconsole_kern.h"
 #include "init.h"
diff --git a/arch/um/include/shared/chan_kern.h b/arch/um/include/shared/chan_kern.h
deleted file mode 100644 (file)
index 1e65145..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/* 
- * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
- * Licensed under the GPL
- */
-
-#ifndef __CHAN_KERN_H__
-#define __CHAN_KERN_H__
-
-#include "linux/tty.h"
-#include "linux/list.h"
-#include "linux/console.h"
-#include "chan_user.h"
-#include "line.h"
-
-struct chan {
-       struct list_head list;
-       struct list_head free_list;
-       struct line *line;
-       char *dev;
-       unsigned int primary:1;
-       unsigned int input:1;
-       unsigned int output:1;
-       unsigned int opened:1;
-       unsigned int enabled:1;
-       int fd;
-       const struct chan_ops *ops;
-       void *data;
-};
-
-extern void chan_interrupt(struct list_head *chans, struct delayed_work *task,
-                          struct tty_struct *tty, int irq);
-extern int parse_chan_pair(char *str, struct line *line, int device,
-                          const struct chan_opts *opts, char **error_out);
-extern int write_chan(struct list_head *chans, const char *buf, int len,
-                            int write_irq);
-extern int console_write_chan(struct list_head *chans, const char *buf, 
-                             int len);
-extern int console_open_chan(struct line *line, struct console *co);
-extern void deactivate_chan(struct list_head *chans, int irq);
-extern void reactivate_chan(struct list_head *chans, int irq);
-extern void chan_enable_winch(struct list_head *chans, struct tty_struct *tty);
-extern int enable_chan(struct line *line);
-extern void close_chan(struct list_head *chans, int delay_free_irq);
-extern int chan_window_size(struct list_head *chans, 
-                            unsigned short *rows_out, 
-                            unsigned short *cols_out);
-extern int chan_config_string(struct list_head *chans, char *str, int size,
-                             char **error_out);
-
-#endif
diff --git a/arch/um/include/shared/chan_user.h b/arch/um/include/shared/chan_user.h
deleted file mode 100644 (file)
index 9b9ced8..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
- * Licensed under the GPL
- */
-
-#ifndef __CHAN_USER_H__
-#define __CHAN_USER_H__
-
-#include "init.h"
-
-struct chan_opts {
-       void (*const announce)(char *dev_name, int dev);
-       char *xterm_title;
-       const int raw;
-};
-
-enum chan_init_pri { INIT_STATIC, INIT_ALL, INIT_ONE };
-
-struct chan_ops {
-       char *type;
-       void *(*init)(char *, int, const struct chan_opts *);
-       int (*open)(int, int, int, void *, char **);
-       void (*close)(int, void *);
-       int (*read)(int, char *, void *);
-       int (*write)(int, const char *, int, void *);
-       int (*console_write)(int, const char *, int);
-       int (*window_size)(int, void *, unsigned short *, unsigned short *);
-       void (*free)(void *);
-       int winch;
-};
-
-extern const struct chan_ops fd_ops, null_ops, port_ops, pts_ops, pty_ops,
-       tty_ops, xterm_ops;
-
-extern void generic_close(int fd, void *unused);
-extern int generic_read(int fd, char *c_out, void *unused);
-extern int generic_write(int fd, const char *buf, int n, void *unused);
-extern int generic_console_write(int fd, const char *buf, int n);
-extern int generic_window_size(int fd, void *unused, unsigned short *rows_out,
-                              unsigned short *cols_out);
-extern void generic_free(void *data);
-
-struct tty_struct;
-extern void register_winch(int fd,  struct tty_struct *tty);
-extern void register_winch_irq(int fd, int tty_fd, int pid,
-                              struct tty_struct *tty, unsigned long stack);
-
-#define __channel_help(fn, prefix) \
-__uml_help(fn, prefix "[0-9]*=<channel description>\n" \
-"    Attach a console or serial line to a host channel.  See\n" \
-"    http://user-mode-linux.sourceforge.net/old/input.html for a complete\n" \
-"    description of this switch.\n\n" \
-);
-
-#endif
diff --git a/arch/um/include/shared/line.h b/arch/um/include/shared/line.h
deleted file mode 100644 (file)
index 63df3ca..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/* 
- * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
- * Licensed under the GPL
- */
-
-#ifndef __LINE_H__
-#define __LINE_H__
-
-#include "linux/list.h"
-#include "linux/workqueue.h"
-#include "linux/tty.h"
-#include "linux/interrupt.h"
-#include "linux/spinlock.h"
-#include "linux/mutex.h"
-#include "chan_user.h"
-#include "mconsole_kern.h"
-
-/* There's only one modifiable field in this - .mc.list */
-struct line_driver {
-       const char *name;
-       const char *device_name;
-       const short major;
-       const short minor_start;
-       const short type;
-       const short subtype;
-       const int read_irq;
-       const char *read_irq_name;
-       const int write_irq;
-       const char *write_irq_name;
-       struct mc_device mc;
-};
-
-struct line {
-       struct tty_struct *tty;
-       spinlock_t count_lock;
-       unsigned long count;
-       int valid;
-
-       char *init_str;
-       int init_pri;
-       struct list_head chan_list;
-
-       /*This lock is actually, mostly, local to*/
-       spinlock_t lock;
-       int throttled;
-       /* Yes, this is a real circular buffer.
-        * XXX: And this should become a struct kfifo!
-        *
-        * buffer points to a buffer allocated on demand, of length
-        * LINE_BUFSIZE, head to the start of the ring, tail to the end.*/
-       char *buffer;
-       char *head;
-       char *tail;
-
-       int sigio;
-       struct delayed_work task;
-       const struct line_driver *driver;
-       int have_irq;
-};
-
-#define LINE_INIT(str, d) \
-       { .count_lock = __SPIN_LOCK_UNLOCKED((str).count_lock), \
-         .init_str =   str,    \
-         .init_pri =   INIT_STATIC, \
-         .valid =      1, \
-         .lock =       __SPIN_LOCK_UNLOCKED((str).lock), \
-         .driver =     d }
-
-extern void line_close(struct tty_struct *tty, struct file * filp);
-extern int line_open(struct line *lines, struct tty_struct *tty);
-extern int line_setup(struct line *lines, unsigned int sizeof_lines,
-                     char *init, char **error_out);
-extern int line_write(struct tty_struct *tty, const unsigned char *buf,
-                     int len);
-extern int line_put_char(struct tty_struct *tty, unsigned char ch);
-extern void line_set_termios(struct tty_struct *tty, struct ktermios * old);
-extern int line_chars_in_buffer(struct tty_struct *tty);
-extern void line_flush_buffer(struct tty_struct *tty);
-extern void line_flush_chars(struct tty_struct *tty);
-extern int line_write_room(struct tty_struct *tty);
-extern int line_ioctl(struct tty_struct *tty, unsigned int cmd,
-                               unsigned long arg);
-extern void line_throttle(struct tty_struct *tty);
-extern void line_unthrottle(struct tty_struct *tty);
-
-extern char *add_xterm_umid(char *base);
-extern int line_setup_irq(int fd, int input, int output, struct line *line,
-                         void *data);
-extern void line_close_chan(struct line *line);
-extern struct tty_driver *register_lines(struct line_driver *line_driver,
-                                        const struct tty_operations *driver,
-                                        struct line *lines, int nlines);
-extern void lines_init(struct line *lines, int nlines, struct chan_opts *opts);
-extern void close_lines(struct line *lines, int nlines);
-
-extern int line_config(struct line *lines, unsigned int sizeof_lines,
-                      char *str, const struct chan_opts *opts,
-                      char **error_out);
-extern int line_id(char **str, int *start_out, int *end_out);
-extern int line_remove(struct line *lines, unsigned int sizeof_lines, int n,
-                      char **error_out);
-extern int line_get_config(char *dev, struct line *lines,
-                          unsigned int sizeof_lines, char *str,
-                          int size, char **error_out);
-
-#endif
index 29e4ab7eb3695f648a9e686a4800e176db00de5a..6c34f14708a958ac622b74eca22eff0ecd35b5db 100644 (file)
@@ -13,7 +13,7 @@
 #include <sys/wait.h>
 #include <asm/unistd.h>
 #include "as-layout.h"
-#include "chan_user.h"
+#include "init.h"
 #include "kern_util.h"
 #include "mem.h"
 #include "os.h"