aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/drivers/chan.h2
-rw-r--r--arch/um/drivers/chan_kern.c4
-rw-r--r--arch/um/drivers/chan_user.c12
-rw-r--r--arch/um/drivers/chan_user.h6
-rw-r--r--arch/um/drivers/line.c42
-rw-r--r--arch/um/drivers/net_kern.c2
-rw-r--r--arch/um/drivers/ssl.c1
-rw-r--r--arch/um/drivers/stdio_console.c1
-rw-r--r--arch/um/os-Linux/signal.c2
-rw-r--r--arch/um/os-Linux/start_up.c2
10 files changed, 41 insertions, 33 deletions
diff --git a/arch/um/drivers/chan.h b/arch/um/drivers/chan.h
index 78f1b8999964..c512b0306dd4 100644
--- a/arch/um/drivers/chan.h
+++ b/arch/um/drivers/chan.h
@@ -37,7 +37,7 @@ extern int console_write_chan(struct chan *chan, const char *buf,
37extern int console_open_chan(struct line *line, struct console *co); 37extern int console_open_chan(struct line *line, struct console *co);
38extern void deactivate_chan(struct chan *chan, int irq); 38extern void deactivate_chan(struct chan *chan, int irq);
39extern void reactivate_chan(struct chan *chan, int irq); 39extern void reactivate_chan(struct chan *chan, int irq);
40extern void chan_enable_winch(struct chan *chan, struct tty_struct *tty); 40extern void chan_enable_winch(struct chan *chan, struct tty_port *port);
41extern int enable_chan(struct line *line); 41extern int enable_chan(struct line *line);
42extern void close_chan(struct line *line); 42extern void close_chan(struct line *line);
43extern int chan_window_size(struct line *line, 43extern int chan_window_size(struct line *line,
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c
index bf42825ba54f..acbe6c67afba 100644
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@ -122,10 +122,10 @@ static int open_chan(struct list_head *chans)
122 return err; 122 return err;
123} 123}
124 124
125void chan_enable_winch(struct chan *chan, struct tty_struct *tty) 125void chan_enable_winch(struct chan *chan, struct tty_port *port)
126{ 126{
127 if (chan && chan->primary && chan->ops->winch) 127 if (chan && chan->primary && chan->ops->winch)
128 register_winch(chan->fd, tty); 128 register_winch(chan->fd, port);
129} 129}
130 130
131static void line_timer_cb(struct work_struct *work) 131static void line_timer_cb(struct work_struct *work)
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index 9be670ad23b5..3fd7c3efdb18 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -216,7 +216,7 @@ static int winch_thread(void *arg)
216 } 216 }
217} 217}
218 218
219static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out, 219static int winch_tramp(int fd, struct tty_port *port, int *fd_out,
220 unsigned long *stack_out) 220 unsigned long *stack_out)
221{ 221{
222 struct winch_data data; 222 struct winch_data data;
@@ -271,7 +271,7 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out,
271 return err; 271 return err;
272} 272}
273 273
274void register_winch(int fd, struct tty_struct *tty) 274void register_winch(int fd, struct tty_port *port)
275{ 275{
276 unsigned long stack; 276 unsigned long stack;
277 int pid, thread, count, thread_fd = -1; 277 int pid, thread, count, thread_fd = -1;
@@ -281,17 +281,17 @@ void register_winch(int fd, struct tty_struct *tty)
281 return; 281 return;
282 282
283 pid = tcgetpgrp(fd); 283 pid = tcgetpgrp(fd);
284 if (is_skas_winch(pid, fd, tty)) { 284 if (is_skas_winch(pid, fd, port)) {
285 register_winch_irq(-1, fd, -1, tty, 0); 285 register_winch_irq(-1, fd, -1, port, 0);
286 return; 286 return;
287 } 287 }
288 288
289 if (pid == -1) { 289 if (pid == -1) {
290 thread = winch_tramp(fd, tty, &thread_fd, &stack); 290 thread = winch_tramp(fd, port, &thread_fd, &stack);
291 if (thread < 0) 291 if (thread < 0)
292 return; 292 return;
293 293
294 register_winch_irq(thread_fd, fd, thread, tty, stack); 294 register_winch_irq(thread_fd, fd, thread, port, stack);
295 295
296 count = write(thread_fd, &c, sizeof(c)); 296 count = write(thread_fd, &c, sizeof(c));
297 if (count != sizeof(c)) 297 if (count != sizeof(c))
diff --git a/arch/um/drivers/chan_user.h b/arch/um/drivers/chan_user.h
index dc693298eb8f..03f1b565c5f9 100644
--- a/arch/um/drivers/chan_user.h
+++ b/arch/um/drivers/chan_user.h
@@ -38,10 +38,10 @@ extern int generic_window_size(int fd, void *unused, unsigned short *rows_out,
38 unsigned short *cols_out); 38 unsigned short *cols_out);
39extern void generic_free(void *data); 39extern void generic_free(void *data);
40 40
41struct tty_struct; 41struct tty_port;
42extern void register_winch(int fd, struct tty_struct *tty); 42extern void register_winch(int fd, struct tty_port *port);
43extern void register_winch_irq(int fd, int tty_fd, int pid, 43extern void register_winch_irq(int fd, int tty_fd, int pid,
44 struct tty_struct *tty, unsigned long stack); 44 struct tty_port *port, unsigned long stack);
45 45
46#define __channel_help(fn, prefix) \ 46#define __channel_help(fn, prefix) \
47__uml_help(fn, prefix "[0-9]*=<channel description>\n" \ 47__uml_help(fn, prefix "[0-9]*=<channel description>\n" \
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index cc206eda245c..8035145f043b 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -299,7 +299,7 @@ static int line_activate(struct tty_port *port, struct tty_struct *tty)
299 return ret; 299 return ret;
300 300
301 if (!line->sigio) { 301 if (!line->sigio) {
302 chan_enable_winch(line->chan_out, tty); 302 chan_enable_winch(line->chan_out, port);
303 line->sigio = 1; 303 line->sigio = 1;
304 } 304 }
305 305
@@ -309,8 +309,22 @@ static int line_activate(struct tty_port *port, struct tty_struct *tty)
309 return 0; 309 return 0;
310} 310}
311 311
312static void unregister_winch(struct tty_struct *tty);
313
314static void line_destruct(struct tty_port *port)
315{
316 struct tty_struct *tty = tty_port_tty_get(port);
317 struct line *line = tty->driver_data;
318
319 if (line->sigio) {
320 unregister_winch(tty);
321 line->sigio = 0;
322 }
323}
324
312static const struct tty_port_operations line_port_ops = { 325static const struct tty_port_operations line_port_ops = {
313 .activate = line_activate, 326 .activate = line_activate,
327 .destruct = line_destruct,
314}; 328};
315 329
316int line_open(struct tty_struct *tty, struct file *filp) 330int line_open(struct tty_struct *tty, struct file *filp)
@@ -334,18 +348,6 @@ int line_install(struct tty_driver *driver, struct tty_struct *tty,
334 return 0; 348 return 0;
335} 349}
336 350
337static void unregister_winch(struct tty_struct *tty);
338
339void line_cleanup(struct tty_struct *tty)
340{
341 struct line *line = tty->driver_data;
342
343 if (line->sigio) {
344 unregister_winch(tty);
345 line->sigio = 0;
346 }
347}
348
349void line_close(struct tty_struct *tty, struct file * filp) 351void line_close(struct tty_struct *tty, struct file * filp)
350{ 352{
351 struct line *line = tty->driver_data; 353 struct line *line = tty->driver_data;
@@ -595,7 +597,7 @@ struct winch {
595 int fd; 597 int fd;
596 int tty_fd; 598 int tty_fd;
597 int pid; 599 int pid;
598 struct tty_struct *tty; 600 struct tty_port *port;
599 unsigned long stack; 601 unsigned long stack;
600 struct work_struct work; 602 struct work_struct work;
601}; 603};
@@ -649,7 +651,7 @@ static irqreturn_t winch_interrupt(int irq, void *data)
649 goto out; 651 goto out;
650 } 652 }
651 } 653 }
652 tty = winch->tty; 654 tty = tty_port_tty_get(winch->port);
653 if (tty != NULL) { 655 if (tty != NULL) {
654 line = tty->driver_data; 656 line = tty->driver_data;
655 if (line != NULL) { 657 if (line != NULL) {
@@ -657,6 +659,7 @@ static irqreturn_t winch_interrupt(int irq, void *data)
657 &tty->winsize.ws_col); 659 &tty->winsize.ws_col);
658 kill_pgrp(tty->pgrp, SIGWINCH, 1); 660 kill_pgrp(tty->pgrp, SIGWINCH, 1);
659 } 661 }
662 tty_kref_put(tty);
660 } 663 }
661 out: 664 out:
662 if (winch->fd != -1) 665 if (winch->fd != -1)
@@ -664,7 +667,7 @@ static irqreturn_t winch_interrupt(int irq, void *data)
664 return IRQ_HANDLED; 667 return IRQ_HANDLED;
665} 668}
666 669
667void register_winch_irq(int fd, int tty_fd, int pid, struct tty_struct *tty, 670void register_winch_irq(int fd, int tty_fd, int pid, struct tty_port *port,
668 unsigned long stack) 671 unsigned long stack)
669{ 672{
670 struct winch *winch; 673 struct winch *winch;
@@ -679,7 +682,7 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_struct *tty,
679 .fd = fd, 682 .fd = fd,
680 .tty_fd = tty_fd, 683 .tty_fd = tty_fd,
681 .pid = pid, 684 .pid = pid,
682 .tty = tty, 685 .port = port,
683 .stack = stack }); 686 .stack = stack });
684 687
685 if (um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt, 688 if (um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt,
@@ -708,15 +711,18 @@ static void unregister_winch(struct tty_struct *tty)
708{ 711{
709 struct list_head *ele, *next; 712 struct list_head *ele, *next;
710 struct winch *winch; 713 struct winch *winch;
714 struct tty_struct *wtty;
711 715
712 spin_lock(&winch_handler_lock); 716 spin_lock(&winch_handler_lock);
713 717
714 list_for_each_safe(ele, next, &winch_handlers) { 718 list_for_each_safe(ele, next, &winch_handlers) {
715 winch = list_entry(ele, struct winch, list); 719 winch = list_entry(ele, struct winch, list);
716 if (winch->tty == tty) { 720 wtty = tty_port_tty_get(winch->port);
721 if (wtty == tty) {
717 free_winch(winch); 722 free_winch(winch);
718 break; 723 break;
719 } 724 }
725 tty_kref_put(wtty);
720 } 726 }
721 spin_unlock(&winch_handler_lock); 727 spin_unlock(&winch_handler_lock);
722} 728}
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index d8926c303629..39f186252e02 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -218,6 +218,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
218 spin_lock_irqsave(&lp->lock, flags); 218 spin_lock_irqsave(&lp->lock, flags);
219 219
220 len = (*lp->write)(lp->fd, skb, lp); 220 len = (*lp->write)(lp->fd, skb, lp);
221 skb_tx_timestamp(skb);
221 222
222 if (len == skb->len) { 223 if (len == skb->len) {
223 dev->stats.tx_packets++; 224 dev->stats.tx_packets++;
@@ -281,6 +282,7 @@ static void uml_net_get_drvinfo(struct net_device *dev,
281static const struct ethtool_ops uml_net_ethtool_ops = { 282static const struct ethtool_ops uml_net_ethtool_ops = {
282 .get_drvinfo = uml_net_get_drvinfo, 283 .get_drvinfo = uml_net_get_drvinfo,
283 .get_link = ethtool_op_get_link, 284 .get_link = ethtool_op_get_link,
285 .get_ts_info = ethtool_op_get_ts_info,
284}; 286};
285 287
286static void uml_net_user_timer_expire(unsigned long _conn) 288static void uml_net_user_timer_expire(unsigned long _conn)
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c
index 16fdd0a0f9d6..b8d14fa52059 100644
--- a/arch/um/drivers/ssl.c
+++ b/arch/um/drivers/ssl.c
@@ -105,7 +105,6 @@ static const struct tty_operations ssl_ops = {
105 .throttle = line_throttle, 105 .throttle = line_throttle,
106 .unthrottle = line_unthrottle, 106 .unthrottle = line_unthrottle,
107 .install = ssl_install, 107 .install = ssl_install,
108 .cleanup = line_cleanup,
109 .hangup = line_hangup, 108 .hangup = line_hangup,
110}; 109};
111 110
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c
index 827777af3f6d..7b361f36ca96 100644
--- a/arch/um/drivers/stdio_console.c
+++ b/arch/um/drivers/stdio_console.c
@@ -110,7 +110,6 @@ static const struct tty_operations console_ops = {
110 .set_termios = line_set_termios, 110 .set_termios = line_set_termios,
111 .throttle = line_throttle, 111 .throttle = line_throttle,
112 .unthrottle = line_unthrottle, 112 .unthrottle = line_unthrottle,
113 .cleanup = line_cleanup,
114 .hangup = line_hangup, 113 .hangup = line_hangup,
115}; 114};
116 115
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index b1469fe93295..9d9f1b4bf826 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -15,7 +15,7 @@
15#include <sysdep/mcontext.h> 15#include <sysdep/mcontext.h>
16#include "internal.h" 16#include "internal.h"
17 17
18void (*sig_info[NSIG])(int, siginfo_t *, struct uml_pt_regs *) = { 18void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = {
19 [SIGTRAP] = relay_signal, 19 [SIGTRAP] = relay_signal,
20 [SIGFPE] = relay_signal, 20 [SIGFPE] = relay_signal,
21 [SIGILL] = relay_signal, 21 [SIGILL] = relay_signal,
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index da4b9e9999fd..337518c5042a 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -15,6 +15,8 @@
15#include <sys/mman.h> 15#include <sys/mman.h>
16#include <sys/stat.h> 16#include <sys/stat.h>
17#include <sys/wait.h> 17#include <sys/wait.h>
18#include <sys/time.h>
19#include <sys/resource.h>
18#include <asm/unistd.h> 20#include <asm/unistd.h>
19#include <init.h> 21#include <init.h>
20#include <os.h> 22#include <os.h>