aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/include')
-rw-r--r--arch/um/include/line.h36
-rw-r--r--arch/um/include/sysdep-i386/syscalls.h99
-rw-r--r--arch/um/include/sysdep-x86_64/syscalls.h59
3 files changed, 19 insertions, 175 deletions
diff --git a/arch/um/include/line.h b/arch/um/include/line.h
index 6d81ecc17be5..4c5e92c04ccb 100644
--- a/arch/um/include/line.h
+++ b/arch/um/include/line.h
@@ -10,7 +10,7 @@
#include "linux/workqueue.h"
#include "linux/tty.h"
#include "linux/interrupt.h"
-#include "asm/semaphore.h"
+#include "linux/spinlock.h"
#include "chan_user.h"
#include "mconsole_kern.h"
@@ -37,10 +37,18 @@ struct line {
struct list_head chan_list;
int valid;
int count;
- struct semaphore sem;
+ /*This lock is actually, mostly, local to*/
+ spinlock_t lock;
+
+ /* 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 work_struct task;
struct line_driver *driver;
@@ -52,7 +60,6 @@ struct line {
init_pri : INIT_STATIC, \
chan_list : { }, \
valid : 1, \
- sem : { }, \
buffer : NULL, \
head : NULL, \
tail : NULL, \
@@ -69,15 +76,18 @@ struct lines {
extern void line_close(struct tty_struct *tty, struct file * filp);
extern int line_open(struct line *lines, struct tty_struct *tty,
struct chan_opts *opts);
-extern int line_setup(struct line *lines, int num, char *init,
+extern int line_setup(struct line *lines, unsigned int sizeof_lines, char *init,
int all_allowed);
extern int line_write(struct tty_struct *tty, const unsigned char *buf, int len);
extern void line_put_char(struct tty_struct *tty, unsigned char ch);
extern void line_set_termios(struct tty_struct *tty, struct termios * 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, struct file * file,
unsigned int cmd, unsigned long arg);
+
extern char *add_xterm_umid(char *base);
extern int line_setup_irq(int fd, int input, int output, struct tty_struct *tty);
extern void line_close_chan(struct line *line);
@@ -89,20 +99,10 @@ extern struct tty_driver * line_register_devfs(struct lines *set,
int nlines);
extern void lines_init(struct line *lines, int nlines);
extern void close_lines(struct line *lines, int nlines);
-extern int line_config(struct line *lines, int num, char *str);
-extern int line_remove(struct line *lines, int num, char *str);
-extern int line_get_config(char *dev, struct line *lines, int num, char *str,
+
+extern int line_config(struct line *lines, unsigned int sizeof_lines, char *str);
+extern int line_remove(struct line *lines, unsigned int sizeof_lines, char *str);
+extern int line_get_config(char *dev, struct line *lines, unsigned int sizeof_lines, char *str,
int size, char **error_out);
#endif
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
diff --git a/arch/um/include/sysdep-i386/syscalls.h b/arch/um/include/sysdep-i386/syscalls.h
index 5db81ec9087d..be0a3e3469eb 100644
--- a/arch/um/include/sysdep-i386/syscalls.h
+++ b/arch/um/include/sysdep-i386/syscalls.h
@@ -22,102 +22,3 @@ extern syscall_handler_t old_mmap_i386;
extern long sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff);
-
-/* On i386 they choose a meaningless naming.*/
-#define __NR_kexec_load __NR_sys_kexec_load
-
-#define ARCH_SYSCALLS \
- [ __NR_waitpid ] = (syscall_handler_t *) sys_waitpid, \
- [ __NR_break ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_oldstat ] = (syscall_handler_t *) sys_stat, \
- [ __NR_umount ] = (syscall_handler_t *) sys_oldumount, \
- [ __NR_stime ] = um_stime, \
- [ __NR_oldfstat ] = (syscall_handler_t *) sys_fstat, \
- [ __NR_stty ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_gtty ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_nice ] = (syscall_handler_t *) sys_nice, \
- [ __NR_ftime ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_prof ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_signal ] = (syscall_handler_t *) sys_signal, \
- [ __NR_lock ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_mpx ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_ulimit ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_oldolduname ] = (syscall_handler_t *) sys_olduname, \
- [ __NR_sigaction ] = (syscall_handler_t *) sys_sigaction, \
- [ __NR_sgetmask ] = (syscall_handler_t *) sys_sgetmask, \
- [ __NR_ssetmask ] = (syscall_handler_t *) sys_ssetmask, \
- [ __NR_sigsuspend ] = (syscall_handler_t *) sys_sigsuspend, \
- [ __NR_sigpending ] = (syscall_handler_t *) sys_sigpending, \
- [ __NR_oldlstat ] = (syscall_handler_t *) sys_lstat, \
- [ __NR_readdir ] = old_readdir, \
- [ __NR_profil ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_socketcall ] = (syscall_handler_t *) sys_socketcall, \
- [ __NR_olduname ] = (syscall_handler_t *) sys_uname, \
- [ __NR_iopl ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_idle ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_ipc ] = (syscall_handler_t *) sys_ipc, \
- [ __NR_sigreturn ] = (syscall_handler_t *) sys_sigreturn, \
- [ __NR_sigprocmask ] = (syscall_handler_t *) sys_sigprocmask, \
- [ __NR_bdflush ] = (syscall_handler_t *) sys_bdflush, \
- [ __NR__llseek ] = (syscall_handler_t *) sys_llseek, \
- [ __NR__newselect ] = (syscall_handler_t *) sys_select, \
- [ __NR_vm86 ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_mmap ] = (syscall_handler_t *) old_mmap_i386, \
- [ __NR_ugetrlimit ] = (syscall_handler_t *) sys_getrlimit, \
- [ __NR_mmap2 ] = (syscall_handler_t *) sys_mmap2, \
- [ __NR_truncate64 ] = (syscall_handler_t *) sys_truncate64, \
- [ __NR_ftruncate64 ] = (syscall_handler_t *) sys_ftruncate64, \
- [ __NR_stat64 ] = (syscall_handler_t *) sys_stat64, \
- [ __NR_lstat64 ] = (syscall_handler_t *) sys_lstat64, \
- [ __NR_fstat64 ] = (syscall_handler_t *) sys_fstat64, \
- [ __NR_fcntl64 ] = (syscall_handler_t *) sys_fcntl64, \
- [ __NR_sendfile64 ] = (syscall_handler_t *) sys_sendfile64, \
- [ __NR_statfs64 ] = (syscall_handler_t *) sys_statfs64, \
- [ __NR_fstatfs64 ] = (syscall_handler_t *) sys_fstatfs64, \
- [ __NR_fadvise64_64 ] = (syscall_handler_t *) sys_fadvise64_64, \
- [ __NR_select ] = (syscall_handler_t *) old_select, \
- [ __NR_vm86old ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_modify_ldt ] = (syscall_handler_t *) sys_modify_ldt, \
- [ __NR_lchown32 ] = (syscall_handler_t *) sys_lchown, \
- [ __NR_getuid32 ] = (syscall_handler_t *) sys_getuid, \
- [ __NR_getgid32 ] = (syscall_handler_t *) sys_getgid, \
- [ __NR_geteuid32 ] = (syscall_handler_t *) sys_geteuid, \
- [ __NR_getegid32 ] = (syscall_handler_t *) sys_getegid, \
- [ __NR_setreuid32 ] = (syscall_handler_t *) sys_setreuid, \
- [ __NR_setregid32 ] = (syscall_handler_t *) sys_setregid, \
- [ __NR_getgroups32 ] = (syscall_handler_t *) sys_getgroups, \
- [ __NR_setgroups32 ] = (syscall_handler_t *) sys_setgroups, \
- [ __NR_fchown32 ] = (syscall_handler_t *) sys_fchown, \
- [ __NR_setresuid32 ] = (syscall_handler_t *) sys_setresuid, \
- [ __NR_getresuid32 ] = (syscall_handler_t *) sys_getresuid, \
- [ __NR_setresgid32 ] = (syscall_handler_t *) sys_setresgid, \
- [ __NR_getresgid32 ] = (syscall_handler_t *) sys_getresgid, \
- [ __NR_chown32 ] = (syscall_handler_t *) sys_chown, \
- [ __NR_setuid32 ] = (syscall_handler_t *) sys_setuid, \
- [ __NR_setgid32 ] = (syscall_handler_t *) sys_setgid, \
- [ __NR_setfsuid32 ] = (syscall_handler_t *) sys_setfsuid, \
- [ __NR_setfsgid32 ] = (syscall_handler_t *) sys_setfsgid, \
- [ __NR_pivot_root ] = (syscall_handler_t *) sys_pivot_root, \
- [ __NR_mincore ] = (syscall_handler_t *) sys_mincore, \
- [ __NR_madvise ] = (syscall_handler_t *) sys_madvise, \
- [ 222 ] = (syscall_handler_t *) sys_ni_syscall, \
- [ 223 ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_set_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_get_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \
- [ 251 ] = (syscall_handler_t *) sys_ni_syscall, \
- [ 285 ] = (syscall_handler_t *) sys_ni_syscall,
-
-/* 222 doesn't yet have a name in include/asm-i386/unistd.h */
-
-#define LAST_ARCH_SYSCALL 285
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
diff --git a/arch/um/include/sysdep-x86_64/syscalls.h b/arch/um/include/sysdep-x86_64/syscalls.h
index b187a4157ff3..67923cca5691 100644
--- a/arch/um/include/sysdep-x86_64/syscalls.h
+++ b/arch/um/include/sysdep-x86_64/syscalls.h
@@ -26,66 +26,9 @@ extern syscall_handler_t *ia32_sys_call_table[];
extern long old_mmap(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff);
-extern syscall_handler_t wrap_sys_shmat;
extern syscall_handler_t sys_modify_ldt;
extern syscall_handler_t sys_arch_prctl;
-#define ARCH_SYSCALLS \
- [ __NR_mmap ] = (syscall_handler_t *) old_mmap, \
- [ __NR_select ] = (syscall_handler_t *) sys_select, \
- [ __NR_mincore ] = (syscall_handler_t *) sys_mincore, \
- [ __NR_madvise ] = (syscall_handler_t *) sys_madvise, \
- [ __NR_shmget ] = (syscall_handler_t *) sys_shmget, \
- [ __NR_shmat ] = (syscall_handler_t *) wrap_sys_shmat, \
- [ __NR_shmctl ] = (syscall_handler_t *) sys_shmctl, \
- [ __NR_semop ] = (syscall_handler_t *) sys_semop, \
- [ __NR_semget ] = (syscall_handler_t *) sys_semget, \
- [ __NR_semctl ] = (syscall_handler_t *) sys_semctl, \
- [ __NR_shmdt ] = (syscall_handler_t *) sys_shmdt, \
- [ __NR_msgget ] = (syscall_handler_t *) sys_msgget, \
- [ __NR_msgsnd ] = (syscall_handler_t *) sys_msgsnd, \
- [ __NR_msgrcv ] = (syscall_handler_t *) sys_msgrcv, \
- [ __NR_msgctl ] = (syscall_handler_t *) sys_msgctl, \
- [ __NR_pivot_root ] = (syscall_handler_t *) sys_pivot_root, \
- [ __NR_tuxcall ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_security ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_epoll_ctl_old ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_epoll_wait_old ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_modify_ldt ] = (syscall_handler_t *) sys_modify_ldt, \
- [ __NR_arch_prctl ] = (syscall_handler_t *) sys_arch_prctl, \
- [ __NR_socket ] = (syscall_handler_t *) sys_socket, \
- [ __NR_connect ] = (syscall_handler_t *) sys_connect, \
- [ __NR_accept ] = (syscall_handler_t *) sys_accept, \
- [ __NR_recvfrom ] = (syscall_handler_t *) sys_recvfrom, \
- [ __NR_recvmsg ] = (syscall_handler_t *) sys_recvmsg, \
- [ __NR_sendmsg ] = (syscall_handler_t *) sys_sendmsg, \
- [ __NR_bind ] = (syscall_handler_t *) sys_bind, \
- [ __NR_listen ] = (syscall_handler_t *) sys_listen, \
- [ __NR_getsockname ] = (syscall_handler_t *) sys_getsockname, \
- [ __NR_getpeername ] = (syscall_handler_t *) sys_getpeername, \
- [ __NR_socketpair ] = (syscall_handler_t *) sys_socketpair, \
- [ __NR_sendto ] = (syscall_handler_t *) sys_sendto, \
- [ __NR_shutdown ] = (syscall_handler_t *) sys_shutdown, \
- [ __NR_setsockopt ] = (syscall_handler_t *) sys_setsockopt, \
- [ __NR_getsockopt ] = (syscall_handler_t *) sys_getsockopt, \
- [ __NR_iopl ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_set_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_get_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \
- [ __NR_semtimedop ] = (syscall_handler_t *) sys_semtimedop, \
- [ 251 ] = (syscall_handler_t *) sys_ni_syscall,
-
-#define LAST_ARCH_SYSCALL 251
-#define NR_syscalls 1024
+#define NR_syscalls (__NR_syscall_max + 1)
#endif
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */