udbg_16550.c (463ce0e103f419f51b1769111e73fe8bb305d0ec) | udbg_16550.c (51d3082fe6e55aecfa17113dbe98077c749f724c) |
---|---|
1/* 2 * udbg for for NS16550 compatable serial ports 3 * 4 * Copyright (C) 2001-2005 PPC 64 Team, IBM Corp 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version --- 33 unchanged lines hidden (view full) --- 42#define LSR_THRE 0x20 /* Xmit holding register empty */ 43#define LSR_TEMT 0x40 /* Xmitter empty */ 44#define LSR_ERR 0x80 /* Error */ 45 46#define LCR_DLAB 0x80 47 48static volatile struct NS16550 __iomem *udbg_comport; 49 | 1/* 2 * udbg for for NS16550 compatable serial ports 3 * 4 * Copyright (C) 2001-2005 PPC 64 Team, IBM Corp 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version --- 33 unchanged lines hidden (view full) --- 42#define LSR_THRE 0x20 /* Xmit holding register empty */ 43#define LSR_TEMT 0x40 /* Xmitter empty */ 44#define LSR_ERR 0x80 /* Error */ 45 46#define LCR_DLAB 0x80 47 48static volatile struct NS16550 __iomem *udbg_comport; 49 |
50static void udbg_550_putc(unsigned char c) | 50static void udbg_550_putc(char c) |
51{ 52 if (udbg_comport) { 53 while ((in_8(&udbg_comport->lsr) & LSR_THRE) == 0) 54 /* wait for idle */; 55 out_8(&udbg_comport->thr, c); 56 if (c == '\n') 57 udbg_550_putc('\r'); 58 } --- 5 unchanged lines hidden (view full) --- 64 if ((in_8(&udbg_comport->lsr) & LSR_DR) != 0) 65 return in_8(&udbg_comport->rbr); 66 else 67 return -1; 68 } 69 return -1; 70} 71 | 51{ 52 if (udbg_comport) { 53 while ((in_8(&udbg_comport->lsr) & LSR_THRE) == 0) 54 /* wait for idle */; 55 out_8(&udbg_comport->thr, c); 56 if (c == '\n') 57 udbg_550_putc('\r'); 58 } --- 5 unchanged lines hidden (view full) --- 64 if ((in_8(&udbg_comport->lsr) & LSR_DR) != 0) 65 return in_8(&udbg_comport->rbr); 66 else 67 return -1; 68 } 69 return -1; 70} 71 |
72static unsigned char udbg_550_getc(void) | 72static char udbg_550_getc(void) |
73{ 74 if (udbg_comport) { 75 while ((in_8(&udbg_comport->lsr) & LSR_DR) == 0) 76 /* wait for char */; 77 return in_8(&udbg_comport->rbr); 78 } 79 return 0; 80} --- 86 unchanged lines hidden --- | 73{ 74 if (udbg_comport) { 75 while ((in_8(&udbg_comport->lsr) & LSR_DR) == 0) 76 /* wait for char */; 77 return in_8(&udbg_comport->rbr); 78 } 79 return 0; 80} --- 86 unchanged lines hidden --- |