scummvm random work
[patches.git] / blackfin-old-serial-sysrq.patch
1 --- bfin_serial_5xx.c
2 +++ bfin_serial_5xx.c
3 @@ -17,6 +17,7 @@
4 * $Id: bfin_serial_5xx.c,v 1.80 2006/10/12 03:16:38 sonicz Exp $
5 */
6
7 +#include <linux/sysrq.h>
8 #include <linux/module.h>
9 #include <linux/tty.h>
10 #include <linux/tty_flip.h>
11 @@ -650,9 +651,10 @@ static void receive_chars(struct bfin_se
12 struct tty_struct *tty = info->tty;
13 unsigned char ch = 0, flag = 0;
14 unsigned short status = 0;
15 -#if defined(CONFIG_BF531) || defined(CONFIG_BF532) || defined(CONFIG_BF533)
16 - static int in_break=0;
17 +#ifdef CONFIG_MAGIC_SYSRQ
18 + static int in_break = 0;
19 #endif
20 +
21 FUNC_ENTER();
22
23 #ifdef CONFIG_BFIN_UART_CTSRTS
24 @@ -665,16 +667,13 @@ static void receive_chars(struct bfin_se
25 ACCESS_PORT_IER(uart_regs);
26 ch = (unsigned char)bfin_read16(uart_regs->rpUART_RBR);
27
28 - if (!tty) {
29 + if (!tty)
30 goto clear_and_exit;
31 - }
32
33 -#if defined(CONFIG_BF531) || defined(CONFIG_BF532) || defined(CONFIG_BF533)
34 +#ifdef CONFIG_MAGIC_SYSRQ
35 if (in_break) {
36 - if(ch!=0) {
37 - ch = (unsigned char)bfin_read16(uart_regs->rpUART_RBR);
38 - in_break = 0;
39 - }
40 + handle_sysrq(ch, regs, NULL);
41 + in_break = 0;
42 goto clear_and_exit;
43 }
44 #endif
45 @@ -683,7 +682,7 @@ static void receive_chars(struct bfin_se
46 if (status & BI) {
47 flag = TTY_BREAK;
48 status_handle(info, status);
49 -#if defined(CONFIG_BF531) || defined(CONFIG_BF532) || defined(CONFIG_BF533)
50 +#ifdef CONFIG_MAGIC_SYSRQ
51 in_break = 1;
52 #endif
53 } else if (status & PE) {
54 @@ -696,6 +695,7 @@ static void receive_chars(struct bfin_se
55 flag = TTY_FRAME;
56 status_handle(info, status);
57 }
58 +
59 tty_insert_flip_char(tty, ch, flag);
60 }
61 tty_flip_buffer_push(tty);