Changes in kernel/genarch/src/drivers/s3c24xx/uart.c [28a5ebd:e9bc927] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/drivers/s3c24xx/uart.c
r28a5ebd re9bc927 49 49 #include <str.h> 50 50 51 static void s3c24xx_uart_sendb( outdev_t *dev, uint8_t byte)51 static void s3c24xx_uart_sendb(s3c24xx_uart_t *uart, uint8_t byte) 52 52 { 53 s3c24xx_uart_t *uart =54 (s3c24xx_uart_t *) dev->data;55 56 53 /* Wait for space becoming available in Tx FIFO. */ 57 54 while ((pio_read_32(&uart->io->ufstat) & S3C24XX_UFSTAT_TX_FULL) != 0) … … 61 58 } 62 59 63 static void s3c24xx_uart_ putuchar(outdev_t *dev, char32_t ch)60 static void s3c24xx_uart_write(outdev_t *dev, const char *s, size_t n) 64 61 { 65 s3c24xx_uart_t *uart = 66 (s3c24xx_uart_t *) dev->data; 62 s3c24xx_uart_t *uart = dev->data; 67 63 68 if ((!uart->parea.mapped) || (console_override)) { 69 if (!ascii_check(ch)) { 70 s3c24xx_uart_sendb(dev, U_SPECIAL); 71 } else { 72 if (ch == '\n') 73 s3c24xx_uart_sendb(dev, (uint8_t) '\r'); 74 s3c24xx_uart_sendb(dev, (uint8_t) ch); 75 } 64 /* If the userspace owns the console, do not output anything. */ 65 if (uart->parea.mapped && !console_override) 66 return; 67 68 const char *top = s + n; 69 assert(top >= s); 70 71 for (; s < top; s++) { 72 if (*s == '\n') 73 s3c24xx_uart_sendb(uart, '\r'); 74 75 s3c24xx_uart_sendb(uart, (uint8_t) *s); 76 76 } 77 77 } … … 94 94 95 95 static outdev_operations_t s3c24xx_uart_ops = { 96 .write = s3c24xx_uart_ putuchar,96 .write = s3c24xx_uart_write, 97 97 .redraw = NULL, 98 98 .scroll_up = NULL,
Note:
See TracChangeset
for help on using the changeset viewer.