aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/cyclades.h11
-rw-r--r--include/linux/hayesesp.h1
-rw-r--r--include/linux/kfifo.h4
-rw-r--r--include/linux/perf_counter.h80
-rw-r--r--include/linux/serial.h2
-rw-r--r--include/linux/serial_8250.h1
-rw-r--r--include/linux/serial_core.h93
-rw-r--r--include/linux/tty.h19
-rw-r--r--include/linux/usb/serial.h10
-rw-r--r--include/linux/vt.h32
-rw-r--r--include/linux/vt_kern.h16
-rw-r--r--include/trace/events/power.h81
-rw-r--r--include/trace/events/sched.h33
13 files changed, 292 insertions, 91 deletions
diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h
index 1fbdea4f08eb..a5049eaf782d 100644
--- a/include/linux/cyclades.h
+++ b/include/linux/cyclades.h
@@ -499,6 +499,7 @@ struct cyclades_card {
499 void __iomem *p9050; 499 void __iomem *p9050;
500 struct RUNTIME_9060 __iomem *p9060; 500 struct RUNTIME_9060 __iomem *p9060;
501 } ctl_addr; 501 } ctl_addr;
502 struct BOARD_CTRL __iomem *board_ctrl; /* cyz specific */
502 int irq; 503 int irq;
503 unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */ 504 unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */
504 unsigned int first_line; /* minor number of first channel on card */ 505 unsigned int first_line; /* minor number of first channel on card */
@@ -541,6 +542,15 @@ struct cyclades_port {
541 int magic; 542 int magic;
542 struct tty_port port; 543 struct tty_port port;
543 struct cyclades_card *card; 544 struct cyclades_card *card;
545 union {
546 struct {
547 void __iomem *base_addr;
548 } cyy;
549 struct {
550 struct CH_CTRL __iomem *ch_ctrl;
551 struct BUF_CTRL __iomem *buf_ctrl;
552 } cyz;
553 } u;
544 int line; 554 int line;
545 int flags; /* defined in tty.h */ 555 int flags; /* defined in tty.h */
546 int type; /* UART type */ 556 int type; /* UART type */
@@ -568,7 +578,6 @@ struct cyclades_port {
568 struct cyclades_idle_stats idle_stats; 578 struct cyclades_idle_stats idle_stats;
569 struct cyclades_icount icount; 579 struct cyclades_icount icount;
570 struct completion shutdown_wait; 580 struct completion shutdown_wait;
571 wait_queue_head_t delta_msr_wait;
572 int throttle; 581 int throttle;
573}; 582};
574 583
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h
index 940aeb51d53f..92b08cfe4a75 100644
--- a/include/linux/hayesesp.h
+++ b/include/linux/hayesesp.h
@@ -96,7 +96,6 @@ struct esp_struct {
96 int xmit_head; 96 int xmit_head;
97 int xmit_tail; 97 int xmit_tail;
98 int xmit_cnt; 98 int xmit_cnt;
99 wait_queue_head_t delta_msr_wait;
100 wait_queue_head_t break_wait; 99 wait_queue_head_t break_wait;
101 struct async_icount icount; /* kernel counters for the 4 input interrupts */ 100 struct async_icount icount; /* kernel counters for the 4 input interrupts */
102 struct hayes_esp_config config; /* port configuration */ 101 struct hayes_esp_config config; /* port configuration */
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 29f62e1733ff..ad6bdf5a5970 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -38,7 +38,7 @@ extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask,
38 spinlock_t *lock); 38 spinlock_t *lock);
39extern void kfifo_free(struct kfifo *fifo); 39extern void kfifo_free(struct kfifo *fifo);
40extern unsigned int __kfifo_put(struct kfifo *fifo, 40extern unsigned int __kfifo_put(struct kfifo *fifo,
41 unsigned char *buffer, unsigned int len); 41 const unsigned char *buffer, unsigned int len);
42extern unsigned int __kfifo_get(struct kfifo *fifo, 42extern unsigned int __kfifo_get(struct kfifo *fifo,
43 unsigned char *buffer, unsigned int len); 43 unsigned char *buffer, unsigned int len);
44 44
@@ -77,7 +77,7 @@ static inline void kfifo_reset(struct kfifo *fifo)
77 * bytes copied. 77 * bytes copied.
78 */ 78 */
79static inline unsigned int kfifo_put(struct kfifo *fifo, 79static inline unsigned int kfifo_put(struct kfifo *fifo,
80 unsigned char *buffer, unsigned int len) 80 const unsigned char *buffer, unsigned int len)
81{ 81{
82 unsigned long flags; 82 unsigned long flags;
83 unsigned int ret; 83 unsigned int ret;
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 972f90d7a32f..bd341007c4fc 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -199,10 +199,14 @@ struct perf_counter_attr {
199 inherit_stat : 1, /* per task counts */ 199 inherit_stat : 1, /* per task counts */
200 enable_on_exec : 1, /* next exec enables */ 200 enable_on_exec : 1, /* next exec enables */
201 task : 1, /* trace fork/exit */ 201 task : 1, /* trace fork/exit */
202 watermark : 1, /* wakeup_watermark */
202 203
203 __reserved_1 : 50; 204 __reserved_1 : 49;
204 205
205 __u32 wakeup_events; /* wakeup every n events */ 206 union {
207 __u32 wakeup_events; /* wakeup every n events */
208 __u32 wakeup_watermark; /* bytes before wakeup */
209 };
206 __u32 __reserved_2; 210 __u32 __reserved_2;
207 211
208 __u64 __reserved_3; 212 __u64 __reserved_3;
@@ -332,6 +336,7 @@ enum perf_event_type {
332 * struct perf_event_header header; 336 * struct perf_event_header header;
333 * u32 pid, ppid; 337 * u32 pid, ppid;
334 * u32 tid, ptid; 338 * u32 tid, ptid;
339 * u64 time;
335 * }; 340 * };
336 */ 341 */
337 PERF_EVENT_EXIT = 4, 342 PERF_EVENT_EXIT = 4,
@@ -352,6 +357,7 @@ enum perf_event_type {
352 * struct perf_event_header header; 357 * struct perf_event_header header;
353 * u32 pid, ppid; 358 * u32 pid, ppid;
354 * u32 tid, ptid; 359 * u32 tid, ptid;
360 * { u64 time; } && PERF_SAMPLE_TIME
355 * }; 361 * };
356 */ 362 */
357 PERF_EVENT_FORK = 7, 363 PERF_EVENT_FORK = 7,
@@ -521,6 +527,8 @@ struct perf_mmap_data {
521 atomic_t wakeup; /* needs a wakeup */ 527 atomic_t wakeup; /* needs a wakeup */
522 atomic_t lost; /* nr records lost */ 528 atomic_t lost; /* nr records lost */
523 529
530 long watermark; /* wakeup watermark */
531
524 struct perf_counter_mmap_page *user_page; 532 struct perf_counter_mmap_page *user_page;
525 void *data_pages[0]; 533 void *data_pages[0];
526}; 534};
@@ -685,6 +693,17 @@ struct perf_cpu_context {
685 int recursion[4]; 693 int recursion[4];
686}; 694};
687 695
696struct perf_output_handle {
697 struct perf_counter *counter;
698 struct perf_mmap_data *data;
699 unsigned long head;
700 unsigned long offset;
701 int nmi;
702 int sample;
703 int locked;
704 unsigned long flags;
705};
706
688#ifdef CONFIG_PERF_COUNTERS 707#ifdef CONFIG_PERF_COUNTERS
689 708
690/* 709/*
@@ -716,16 +735,38 @@ extern int hw_perf_group_sched_in(struct perf_counter *group_leader,
716extern void perf_counter_update_userpage(struct perf_counter *counter); 735extern void perf_counter_update_userpage(struct perf_counter *counter);
717 736
718struct perf_sample_data { 737struct perf_sample_data {
719 struct pt_regs *regs; 738 u64 type;
739
740 u64 ip;
741 struct {
742 u32 pid;
743 u32 tid;
744 } tid_entry;
745 u64 time;
720 u64 addr; 746 u64 addr;
747 u64 id;
748 u64 stream_id;
749 struct {
750 u32 cpu;
751 u32 reserved;
752 } cpu_entry;
721 u64 period; 753 u64 period;
754 struct perf_callchain_entry *callchain;
722 struct perf_raw_record *raw; 755 struct perf_raw_record *raw;
723}; 756};
724 757
758extern void perf_output_sample(struct perf_output_handle *handle,
759 struct perf_event_header *header,
760 struct perf_sample_data *data,
761 struct perf_counter *counter);
762extern void perf_prepare_sample(struct perf_event_header *header,
763 struct perf_sample_data *data,
764 struct perf_counter *counter,
765 struct pt_regs *regs);
766
725extern int perf_counter_overflow(struct perf_counter *counter, int nmi, 767extern int perf_counter_overflow(struct perf_counter *counter, int nmi,
726 struct perf_sample_data *data); 768 struct perf_sample_data *data,
727extern void perf_counter_output(struct perf_counter *counter, int nmi, 769 struct pt_regs *regs);
728 struct perf_sample_data *data);
729 770
730/* 771/*
731 * Return 1 for a software counter, 0 for a hardware counter 772 * Return 1 for a software counter, 0 for a hardware counter
@@ -775,6 +816,12 @@ extern void perf_tpcounter_event(int event_id, u64 addr, u64 count,
775#define perf_instruction_pointer(regs) instruction_pointer(regs) 816#define perf_instruction_pointer(regs) instruction_pointer(regs)
776#endif 817#endif
777 818
819extern int perf_output_begin(struct perf_output_handle *handle,
820 struct perf_counter *counter, unsigned int size,
821 int nmi, int sample);
822extern void perf_output_end(struct perf_output_handle *handle);
823extern void perf_output_copy(struct perf_output_handle *handle,
824 const void *buf, unsigned int len);
778#else 825#else
779static inline void 826static inline void
780perf_counter_task_sched_in(struct task_struct *task, int cpu) { } 827perf_counter_task_sched_in(struct task_struct *task, int cpu) { }
@@ -801,7 +848,28 @@ static inline void perf_counter_mmap(struct vm_area_struct *vma) { }
801static inline void perf_counter_comm(struct task_struct *tsk) { } 848static inline void perf_counter_comm(struct task_struct *tsk) { }
802static inline void perf_counter_fork(struct task_struct *tsk) { } 849static inline void perf_counter_fork(struct task_struct *tsk) { }
803static inline void perf_counter_init(void) { } 850static inline void perf_counter_init(void) { }
851
852static inline int
853perf_output_begin(struct perf_output_handle *handle, struct perf_counter *c,
854 unsigned int size, int nmi, int sample) { }
855static inline void perf_output_end(struct perf_output_handle *handle) { }
856static inline void
857perf_output_copy(struct perf_output_handle *handle,
858 const void *buf, unsigned int len) { }
859static inline void
860perf_output_sample(struct perf_output_handle *handle,
861 struct perf_event_header *header,
862 struct perf_sample_data *data,
863 struct perf_counter *counter) { }
864static inline void
865perf_prepare_sample(struct perf_event_header *header,
866 struct perf_sample_data *data,
867 struct perf_counter *counter,
868 struct pt_regs *regs) { }
804#endif 869#endif
805 870
871#define perf_output_put(handle, x) \
872 perf_output_copy((handle), &(x), sizeof(x))
873
806#endif /* __KERNEL__ */ 874#endif /* __KERNEL__ */
807#endif /* _LINUX_PERF_COUNTER_H */ 875#endif /* _LINUX_PERF_COUNTER_H */
diff --git a/include/linux/serial.h b/include/linux/serial.h
index e5bb75a63802..c8613c3ff9d3 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -122,6 +122,7 @@ struct serial_uart_config {
122 122
123/* Internal flags used only by kernel */ 123/* Internal flags used only by kernel */
124#define ASYNCB_INITIALIZED 31 /* Serial port was initialized */ 124#define ASYNCB_INITIALIZED 31 /* Serial port was initialized */
125#define ASYNCB_SUSPENDED 30 /* Serial port is suspended */
125#define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */ 126#define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */
126#define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */ 127#define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */
127#define ASYNCB_CLOSING 27 /* Serial port is closing */ 128#define ASYNCB_CLOSING 27 /* Serial port is closing */
@@ -133,6 +134,7 @@ struct serial_uart_config {
133#define ASYNCB_FIRST_KERNEL 22 134#define ASYNCB_FIRST_KERNEL 22
134 135
135#define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY) 136#define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY)
137#define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED)
136#define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT) 138#define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT)
137#define ASYNC_SAK (1U << ASYNCB_SAK) 139#define ASYNC_SAK (1U << ASYNCB_SAK)
138#define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS) 140#define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS)
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index d4d2a78ad43e..fb46aba11fb5 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -22,6 +22,7 @@ struct plat_serial8250_port {
22 void __iomem *membase; /* ioremap cookie or NULL */ 22 void __iomem *membase; /* ioremap cookie or NULL */
23 resource_size_t mapbase; /* resource base */ 23 resource_size_t mapbase; /* resource base */
24 unsigned int irq; /* interrupt number */ 24 unsigned int irq; /* interrupt number */
25 unsigned long irqflags; /* request_irq flags */
25 unsigned int uartclk; /* UART clock rate */ 26 unsigned int uartclk; /* UART clock rate */
26 void *private_data; 27 void *private_data;
27 unsigned char regshift; /* register shift */ 28 unsigned char regshift; /* register shift */
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 23d2fb051f97..d58e460844dd 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -20,6 +20,8 @@
20#ifndef LINUX_SERIAL_CORE_H 20#ifndef LINUX_SERIAL_CORE_H
21#define LINUX_SERIAL_CORE_H 21#define LINUX_SERIAL_CORE_H
22 22
23#include <linux/serial.h>
24
23/* 25/*
24 * The type definitions. These are from Ted Ts'o's serial.h 26 * The type definitions. These are from Ted Ts'o's serial.h
25 */ 27 */
@@ -186,7 +188,6 @@
186#include <linux/sysrq.h> 188#include <linux/sysrq.h>
187 189
188struct uart_port; 190struct uart_port;
189struct uart_info;
190struct serial_struct; 191struct serial_struct;
191struct device; 192struct device;
192 193
@@ -265,6 +266,7 @@ struct uart_port {
265 unsigned int (*serial_in)(struct uart_port *, int); 266 unsigned int (*serial_in)(struct uart_port *, int);
266 void (*serial_out)(struct uart_port *, int, int); 267 void (*serial_out)(struct uart_port *, int, int);
267 unsigned int irq; /* irq number */ 268 unsigned int irq; /* irq number */
269 unsigned long irqflags; /* irq flags */
268 unsigned int uartclk; /* base uart clock */ 270 unsigned int uartclk; /* base uart clock */
269 unsigned int fifosize; /* tx fifo size */ 271 unsigned int fifosize; /* tx fifo size */
270 unsigned char x_char; /* xon/xoff char */ 272 unsigned char x_char; /* xon/xoff char */
@@ -283,7 +285,7 @@ struct uart_port {
283 285
284 unsigned int read_status_mask; /* driver specific */ 286 unsigned int read_status_mask; /* driver specific */
285 unsigned int ignore_status_mask; /* driver specific */ 287 unsigned int ignore_status_mask; /* driver specific */
286 struct uart_info *info; /* pointer to parent info */ 288 struct uart_state *state; /* pointer to parent state */
287 struct uart_icount icount; /* statistics */ 289 struct uart_icount icount; /* statistics */
288 290
289 struct console *cons; /* struct console, if any */ 291 struct console *cons; /* struct console, if any */
@@ -335,52 +337,16 @@ struct uart_port {
335}; 337};
336 338
337/* 339/*
338 * This is the state information which is only valid when the port
339 * is open; it may be cleared the core driver once the device has
340 * been closed. Either the low level driver or the core can modify
341 * stuff here.
342 */
343typedef unsigned int __bitwise__ uif_t;
344
345struct uart_info {
346 struct tty_port port;
347 struct circ_buf xmit;
348 uif_t flags;
349
350/*
351 * Definitions for info->flags. These are _private_ to serial_core, and
352 * are specific to this structure. They may be queried by low level drivers.
353 *
354 * FIXME: use the ASY_ definitions
355 */
356#define UIF_CHECK_CD ((__force uif_t) (1 << 25))
357#define UIF_CTS_FLOW ((__force uif_t) (1 << 26))
358#define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29))
359#define UIF_INITIALIZED ((__force uif_t) (1 << 31))
360#define UIF_SUSPENDED ((__force uif_t) (1 << 30))
361
362 struct tasklet_struct tlet;
363 wait_queue_head_t delta_msr_wait;
364};
365
366/*
367 * This is the state information which is persistent across opens. 340 * This is the state information which is persistent across opens.
368 * The low level driver must not to touch any elements contained
369 * within.
370 */ 341 */
371struct uart_state { 342struct uart_state {
372 unsigned int close_delay; /* msec */ 343 struct tty_port port;
373 unsigned int closing_wait; /* msec */
374
375#define USF_CLOSING_WAIT_INF (0)
376#define USF_CLOSING_WAIT_NONE (~0U)
377 344
378 int count;
379 int pm_state; 345 int pm_state;
380 struct uart_info info; 346 struct circ_buf xmit;
381 struct uart_port *port;
382 347
383 struct mutex mutex; 348 struct tasklet_struct tlet;
349 struct uart_port *uart_port;
384}; 350};
385 351
386#define UART_XMIT_SIZE PAGE_SIZE 352#define UART_XMIT_SIZE PAGE_SIZE
@@ -461,7 +427,7 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port);
461 427
462static inline int uart_tx_stopped(struct uart_port *port) 428static inline int uart_tx_stopped(struct uart_port *port)
463{ 429{
464 struct tty_struct *tty = port->info->port.tty; 430 struct tty_struct *tty = port->state->port.tty;
465 if(tty->stopped || tty->hw_stopped) 431 if(tty->stopped || tty->hw_stopped)
466 return 1; 432 return 1;
467 return 0; 433 return 0;
@@ -476,7 +442,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
476#ifdef SUPPORT_SYSRQ 442#ifdef SUPPORT_SYSRQ
477 if (port->sysrq) { 443 if (port->sysrq) {
478 if (ch && time_before(jiffies, port->sysrq)) { 444 if (ch && time_before(jiffies, port->sysrq)) {
479 handle_sysrq(ch, port->info->port.tty); 445 handle_sysrq(ch, port->state->port.tty);
480 port->sysrq = 0; 446 port->sysrq = 0;
481 return 1; 447 return 1;
482 } 448 }
@@ -494,7 +460,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
494 */ 460 */
495static inline int uart_handle_break(struct uart_port *port) 461static inline int uart_handle_break(struct uart_port *port)
496{ 462{
497 struct uart_info *info = port->info; 463 struct uart_state *state = port->state;
498#ifdef SUPPORT_SYSRQ 464#ifdef SUPPORT_SYSRQ
499 if (port->cons && port->cons->index == port->line) { 465 if (port->cons && port->cons->index == port->line) {
500 if (!port->sysrq) { 466 if (!port->sysrq) {
@@ -505,7 +471,7 @@ static inline int uart_handle_break(struct uart_port *port)
505 } 471 }
506#endif 472#endif
507 if (port->flags & UPF_SAK) 473 if (port->flags & UPF_SAK)
508 do_SAK(info->port.tty); 474 do_SAK(state->port.tty);
509 return 0; 475 return 0;
510} 476}
511 477
@@ -515,22 +481,23 @@ static inline int uart_handle_break(struct uart_port *port)
515 * @status: new carrier detect status, nonzero if active 481 * @status: new carrier detect status, nonzero if active
516 */ 482 */
517static inline void 483static inline void
518uart_handle_dcd_change(struct uart_port *port, unsigned int status) 484uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
519{ 485{
520 struct uart_info *info = port->info; 486 struct uart_state *state = uport->state;
487 struct tty_port *port = &state->port;
521 488
522 port->icount.dcd++; 489 uport->icount.dcd++;
523 490
524#ifdef CONFIG_HARD_PPS 491#ifdef CONFIG_HARD_PPS
525 if ((port->flags & UPF_HARDPPS_CD) && status) 492 if ((uport->flags & UPF_HARDPPS_CD) && status)
526 hardpps(); 493 hardpps();
527#endif 494#endif
528 495
529 if (info->flags & UIF_CHECK_CD) { 496 if (port->flags & ASYNC_CHECK_CD) {
530 if (status) 497 if (status)
531 wake_up_interruptible(&info->port.open_wait); 498 wake_up_interruptible(&port->open_wait);
532 else if (info->port.tty) 499 else if (port->tty)
533 tty_hangup(info->port.tty); 500 tty_hangup(port->tty);
534 } 501 }
535} 502}
536 503
@@ -540,24 +507,24 @@ uart_handle_dcd_change(struct uart_port *port, unsigned int status)
540 * @status: new clear to send status, nonzero if active 507 * @status: new clear to send status, nonzero if active
541 */ 508 */
542static inline void 509static inline void
543uart_handle_cts_change(struct uart_port *port, unsigned int status) 510uart_handle_cts_change(struct uart_port *uport, unsigned int status)
544{ 511{
545 struct uart_info *info = port->info; 512 struct tty_port *port = &uport->state->port;
546 struct tty_struct *tty = info->port.tty; 513 struct tty_struct *tty = port->tty;
547 514
548 port->icount.cts++; 515 uport->icount.cts++;
549 516
550 if (info->flags & UIF_CTS_FLOW) { 517 if (port->flags & ASYNC_CTS_FLOW) {
551 if (tty->hw_stopped) { 518 if (tty->hw_stopped) {
552 if (status) { 519 if (status) {
553 tty->hw_stopped = 0; 520 tty->hw_stopped = 0;
554 port->ops->start_tx(port); 521 uport->ops->start_tx(uport);
555 uart_write_wakeup(port); 522 uart_write_wakeup(uport);
556 } 523 }
557 } else { 524 } else {
558 if (!status) { 525 if (!status) {
559 tty->hw_stopped = 1; 526 tty->hw_stopped = 1;
560 port->ops->stop_tx(port); 527 uport->ops->stop_tx(uport);
561 } 528 }
562 } 529 }
563 } 530 }
@@ -569,7 +536,7 @@ static inline void
569uart_insert_char(struct uart_port *port, unsigned int status, 536uart_insert_char(struct uart_port *port, unsigned int status,
570 unsigned int overrun, unsigned int ch, unsigned int flag) 537 unsigned int overrun, unsigned int ch, unsigned int flag)
571{ 538{
572 struct tty_struct *tty = port->info->port.tty; 539 struct tty_struct *tty = port->state->port.tty;
573 540
574 if ((status & port->ignore_status_mask & ~overrun) == 0) 541 if ((status & port->ignore_status_mask & ~overrun) == 0)
575 tty_insert_flip_char(tty, ch, flag); 542 tty_insert_flip_char(tty, ch, flag);
diff --git a/include/linux/tty.h b/include/linux/tty.h
index a916a318004e..f0f43d08d8b8 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -187,7 +187,12 @@ struct tty_port;
187struct tty_port_operations { 187struct tty_port_operations {
188 /* Return 1 if the carrier is raised */ 188 /* Return 1 if the carrier is raised */
189 int (*carrier_raised)(struct tty_port *port); 189 int (*carrier_raised)(struct tty_port *port);
190 /* Control the DTR line */
190 void (*dtr_rts)(struct tty_port *port, int raise); 191 void (*dtr_rts)(struct tty_port *port, int raise);
192 /* Called when the last close completes or a hangup finishes
193 IFF the port was initialized. Do not use to free resources */
194 void (*shutdown)(struct tty_port *port);
195 void (*drop)(struct tty_port *port);
191}; 196};
192 197
193struct tty_port { 198struct tty_port {
@@ -198,11 +203,12 @@ struct tty_port {
198 int count; /* Usage count */ 203 int count; /* Usage count */
199 wait_queue_head_t open_wait; /* Open waiters */ 204 wait_queue_head_t open_wait; /* Open waiters */
200 wait_queue_head_t close_wait; /* Close waiters */ 205 wait_queue_head_t close_wait; /* Close waiters */
206 wait_queue_head_t delta_msr_wait; /* Modem status change */
201 unsigned long flags; /* TTY flags ASY_*/ 207 unsigned long flags; /* TTY flags ASY_*/
202 struct mutex mutex; /* Locking */ 208 struct mutex mutex; /* Locking */
203 unsigned char *xmit_buf; /* Optional buffer */ 209 unsigned char *xmit_buf; /* Optional buffer */
204 int close_delay; /* Close port delay */ 210 unsigned int close_delay; /* Close port delay */
205 int closing_wait; /* Delay for output */ 211 unsigned int closing_wait; /* Delay for output */
206 int drain_delay; /* Set to zero if no pure time 212 int drain_delay; /* Set to zero if no pure time
207 based drain is needed else 213 based drain is needed else
208 set to size of fifo */ 214 set to size of fifo */
@@ -459,6 +465,12 @@ extern int tty_port_block_til_ready(struct tty_port *port,
459extern int tty_port_close_start(struct tty_port *port, 465extern int tty_port_close_start(struct tty_port *port,
460 struct tty_struct *tty, struct file *filp); 466 struct tty_struct *tty, struct file *filp);
461extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); 467extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty);
468extern void tty_port_close(struct tty_port *port,
469 struct tty_struct *tty, struct file *filp);
470extern inline int tty_port_users(struct tty_port *port)
471{
472 return port->count + port->blocked_open;
473}
462 474
463extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); 475extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc);
464extern int tty_unregister_ldisc(int disc); 476extern int tty_unregister_ldisc(int disc);
@@ -524,5 +536,8 @@ extern int pcxe_open(struct tty_struct *tty, struct file *filp);
524extern int vt_ioctl(struct tty_struct *tty, struct file *file, 536extern int vt_ioctl(struct tty_struct *tty, struct file *file,
525 unsigned int cmd, unsigned long arg); 537 unsigned int cmd, unsigned long arg);
526 538
539extern long vt_compat_ioctl(struct tty_struct *tty, struct file * file,
540 unsigned int cmd, unsigned long arg);
541
527#endif /* __KERNEL__ */ 542#endif /* __KERNEL__ */
528#endif 543#endif
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 0ec50ba62139..7b85e327af91 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -238,9 +238,8 @@ struct usb_serial_driver {
238 int (*resume)(struct usb_serial *serial); 238 int (*resume)(struct usb_serial *serial);
239 239
240 /* serial function calls */ 240 /* serial function calls */
241 /* Called by console with tty = NULL and by tty */ 241 /* Called by console and by the tty layer */
242 int (*open)(struct tty_struct *tty, 242 int (*open)(struct tty_struct *tty, struct usb_serial_port *port);
243 struct usb_serial_port *port, struct file *filp);
244 void (*close)(struct usb_serial_port *port); 243 void (*close)(struct usb_serial_port *port);
245 int (*write)(struct tty_struct *tty, struct usb_serial_port *port, 244 int (*write)(struct tty_struct *tty, struct usb_serial_port *port,
246 const unsigned char *buf, int count); 245 const unsigned char *buf, int count);
@@ -261,6 +260,9 @@ struct usb_serial_driver {
261 be an attached tty at this point */ 260 be an attached tty at this point */
262 void (*dtr_rts)(struct usb_serial_port *port, int on); 261 void (*dtr_rts)(struct usb_serial_port *port, int on);
263 int (*carrier_raised)(struct usb_serial_port *port); 262 int (*carrier_raised)(struct usb_serial_port *port);
263 /* Called by the usb serial hooks to allow the user to rework the
264 termios state */
265 void (*init_termios)(struct tty_struct *tty);
264 /* USB events */ 266 /* USB events */
265 void (*read_int_callback)(struct urb *urb); 267 void (*read_int_callback)(struct urb *urb);
266 void (*write_int_callback)(struct urb *urb); 268 void (*write_int_callback)(struct urb *urb);
@@ -300,7 +302,7 @@ static inline void usb_serial_console_disconnect(struct usb_serial *serial) {}
300extern struct usb_serial *usb_serial_get_by_index(unsigned int minor); 302extern struct usb_serial *usb_serial_get_by_index(unsigned int minor);
301extern void usb_serial_put(struct usb_serial *serial); 303extern void usb_serial_put(struct usb_serial *serial);
302extern int usb_serial_generic_open(struct tty_struct *tty, 304extern int usb_serial_generic_open(struct tty_struct *tty,
303 struct usb_serial_port *port, struct file *filp); 305 struct usb_serial_port *port);
304extern int usb_serial_generic_write(struct tty_struct *tty, 306extern int usb_serial_generic_write(struct tty_struct *tty,
305 struct usb_serial_port *port, const unsigned char *buf, int count); 307 struct usb_serial_port *port, const unsigned char *buf, int count);
306extern void usb_serial_generic_close(struct usb_serial_port *port); 308extern void usb_serial_generic_close(struct usb_serial_port *port);
diff --git a/include/linux/vt.h b/include/linux/vt.h
index 02c1c0288770..7afca0d72139 100644
--- a/include/linux/vt.h
+++ b/include/linux/vt.h
@@ -1,17 +1,6 @@
1#ifndef _LINUX_VT_H 1#ifndef _LINUX_VT_H
2#define _LINUX_VT_H 2#define _LINUX_VT_H
3 3
4#ifdef __KERNEL__
5struct notifier_block;
6
7struct vt_notifier_param {
8 struct vc_data *vc; /* VC on which the update happened */
9 unsigned int c; /* Printed char */
10};
11
12extern int register_vt_notifier(struct notifier_block *nb);
13extern int unregister_vt_notifier(struct notifier_block *nb);
14#endif
15 4
16/* 5/*
17 * These constants are also useful for user-level apps (e.g., VC 6 * These constants are also useful for user-level apps (e.g., VC
@@ -74,4 +63,25 @@ struct vt_consize {
74#define VT_UNLOCKSWITCH 0x560C /* allow vt switching */ 63#define VT_UNLOCKSWITCH 0x560C /* allow vt switching */
75#define VT_GETHIFONTMASK 0x560D /* return hi font mask */ 64#define VT_GETHIFONTMASK 0x560D /* return hi font mask */
76 65
66struct vt_event {
67 unsigned int event;
68#define VT_EVENT_SWITCH 0x0001 /* Console switch */
69#define VT_EVENT_BLANK 0x0002 /* Screen blank */
70#define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */
71#define VT_EVENT_RESIZE 0x0008 /* Resize display */
72#define VT_MAX_EVENT 0x000F
73 unsigned int old; /* Old console */
74 unsigned int new; /* New console (if changing) */
75 unsigned int pad[4]; /* Padding for expansion */
76};
77
78#define VT_WAITEVENT 0x560E /* Wait for an event */
79
80struct vt_setactivate {
81 unsigned int console;
82 struct vt_mode mode;
83};
84
85#define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */
86
77#endif /* _LINUX_VT_H */ 87#endif /* _LINUX_VT_H */
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 2f1113467f70..c0c4e1103a73 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -13,6 +13,7 @@
13#include <linux/console_struct.h> 13#include <linux/console_struct.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/consolemap.h> 15#include <linux/consolemap.h>
16#include <linux/notifier.h>
16 17
17/* 18/*
18 * Presently, a lot of graphics programs do not restore the contents of 19 * Presently, a lot of graphics programs do not restore the contents of
@@ -91,7 +92,8 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
91#endif 92#endif
92 93
93/* vt.c */ 94/* vt.c */
94int vt_waitactive(int vt); 95void vt_event_post(unsigned int event, unsigned int old, unsigned int new);
96int vt_waitactive(int n);
95void change_console(struct vc_data *new_vc); 97void change_console(struct vc_data *new_vc);
96void reset_vc(struct vc_data *vc); 98void reset_vc(struct vc_data *vc);
97extern int unbind_con_driver(const struct consw *csw, int first, int last, 99extern int unbind_con_driver(const struct consw *csw, int first, int last,
@@ -116,4 +118,16 @@ struct vt_spawn_console {
116}; 118};
117extern struct vt_spawn_console vt_spawn_con; 119extern struct vt_spawn_console vt_spawn_con;
118 120
121extern int vt_move_to_console(unsigned int vt, int alloc);
122
123/* Interfaces for VC notification of character events (for accessibility etc) */
124
125struct vt_notifier_param {
126 struct vc_data *vc; /* VC on which the update happened */
127 unsigned int c; /* Printed char */
128};
129
130extern int register_vt_notifier(struct notifier_block *nb);
131extern int unregister_vt_notifier(struct notifier_block *nb);
132
119#endif /* _VT_KERN_H */ 133#endif /* _VT_KERN_H */
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
new file mode 100644
index 000000000000..ea6d579261ad
--- /dev/null
+++ b/include/trace/events/power.h
@@ -0,0 +1,81 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM power
3
4#if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_POWER_H
6
7#include <linux/ktime.h>
8#include <linux/tracepoint.h>
9
10#ifndef _TRACE_POWER_ENUM_
11#define _TRACE_POWER_ENUM_
12enum {
13 POWER_NONE = 0,
14 POWER_CSTATE = 1,
15 POWER_PSTATE = 2,
16};
17#endif
18
19
20
21TRACE_EVENT(power_start,
22
23 TP_PROTO(unsigned int type, unsigned int state),
24
25 TP_ARGS(type, state),
26
27 TP_STRUCT__entry(
28 __field( u64, type )
29 __field( u64, state )
30 ),
31
32 TP_fast_assign(
33 __entry->type = type;
34 __entry->state = state;
35 ),
36
37 TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long)__entry->state)
38);
39
40TRACE_EVENT(power_end,
41
42 TP_PROTO(int dummy),
43
44 TP_ARGS(dummy),
45
46 TP_STRUCT__entry(
47 __field( u64, dummy )
48 ),
49
50 TP_fast_assign(
51 __entry->dummy = 0xffff;
52 ),
53
54 TP_printk("dummy=%lu", (unsigned long)__entry->dummy)
55
56);
57
58
59TRACE_EVENT(power_frequency,
60
61 TP_PROTO(unsigned int type, unsigned int state),
62
63 TP_ARGS(type, state),
64
65 TP_STRUCT__entry(
66 __field( u64, type )
67 __field( u64, state )
68 ),
69
70 TP_fast_assign(
71 __entry->type = type;
72 __entry->state = state;
73 ),
74
75 TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long) __entry->state)
76);
77
78#endif /* _TRACE_POWER_H */
79
80/* This part must be outside protection */
81#include <trace/define_trace.h>
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index b48f1ad7c946..4069c43f4187 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -380,6 +380,39 @@ TRACE_EVENT(sched_stat_wait,
380); 380);
381 381
382/* 382/*
383 * Tracepoint for accounting runtime (time the task is executing
384 * on a CPU).
385 */
386TRACE_EVENT(sched_stat_runtime,
387
388 TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime),
389
390 TP_ARGS(tsk, runtime, vruntime),
391
392 TP_STRUCT__entry(
393 __array( char, comm, TASK_COMM_LEN )
394 __field( pid_t, pid )
395 __field( u64, runtime )
396 __field( u64, vruntime )
397 ),
398
399 TP_fast_assign(
400 memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
401 __entry->pid = tsk->pid;
402 __entry->runtime = runtime;
403 __entry->vruntime = vruntime;
404 )
405 TP_perf_assign(
406 __perf_count(runtime);
407 ),
408
409 TP_printk("task: %s:%d runtime: %Lu [ns], vruntime: %Lu [ns]",
410 __entry->comm, __entry->pid,
411 (unsigned long long)__entry->runtime,
412 (unsigned long long)__entry->vruntime)
413);
414
415/*
383 * Tracepoint for accounting sleep time (time the task is not runnable, 416 * Tracepoint for accounting sleep time (time the task is not runnable,
384 * including iowait, see below). 417 * including iowait, see below).
385 */ 418 */