diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2009-11-29 15:33:28 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2009-11-29 15:33:28 +0000 |
commit | 44b06ca617a8d8910a308037ebad06876085a6cc (patch) | |
tree | c9bd98f2ad44ad1fbfab11b51f9b09c9d3561d0b /c/src/lib/libbsp/sparc/shared/uart | |
parent | Whitespace removal. (diff) | |
download | rtems-44b06ca617a8d8910a308037ebad06876085a6cc.tar.bz2 |
Whitespace removal.
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/uart')
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/uart/apbuart.c | 268 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/uart/apbuart_pci.c | 8 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/uart/apbuart_rasta.c | 8 |
3 files changed, 142 insertions, 142 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart.c index 144d394182..58d0eab4dc 100644 --- a/c/src/lib/libbsp/sparc/shared/uart/apbuart.c +++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart.c @@ -83,27 +83,27 @@ typedef struct { int irq; int minor; int scaler; - unsigned int baud; + unsigned int baud; - int txblk; /* Make write block until at least 1 char has + int txblk; /* Make write block until at least 1 char has * been put into software send fifo */ - int tx_flush; /* Set this to block until all data has - * placed into the hardware send fifo + int tx_flush; /* Set this to block until all data has + * placed into the hardware send fifo */ - int rxblk; /* Make read block until at least 1 char has + int rxblk; /* Make read block until at least 1 char has * been received (or taken from software fifo). */ - int started; /* Set to 1 when in running mode */ - + int started; /* Set to 1 when in running mode */ + int ascii_mode; /* Set to 1 to make \n be printed as \r\n */ - + /* TX/RX software FIFO Buffers */ apbuart_fifo *txfifo; apbuart_fifo *rxfifo; - + apbuart_stats stats; - + rtems_id dev_sem; rtems_id rx_sem; rtems_id tx_sem; @@ -126,18 +126,18 @@ static void apbuart_hw_close(apbuart_priv *uart); static void apbuart_hw_open(apbuart_priv *uart); /* Uncomment for debug output */ -/* #define DEBUG 1 +/* #define DEBUG 1 #define FUNCDEBUG 1 */ #ifdef DEBUG #define DBG(x...) printk(x) #else -#define DBG(x...) +#define DBG(x...) #endif #ifdef FUNCDEBUG #define FUNCDBG(x...) printk(x) #else -#define FUNCDBG(x...) +#define FUNCDBG(x...) #endif #ifndef READ_REG @@ -157,7 +157,7 @@ static int apbuart_outbyte_try(ambapp_apb_uart *regs, unsigned char ch) { if ( (READ_REG(®s->status) & LEON_REG_UART_STATUS_THE) == 0 ) return -1; /* Failed */ - + /* There is room in fifo, put ch in it */ regs->data = (unsigned int) ch; return 0; @@ -167,15 +167,15 @@ static int apbuart_outbyte_try(ambapp_apb_uart *regs, unsigned char ch) static int apbuart_inbyte_try(ambapp_apb_uart *regs) { unsigned int status; - /* Clear errors if any */ + /* Clear errors if any */ if ( (status=READ_REG(®s->status)) & LEON_REG_UART_STATUS_ERR) { regs->status = status & ~LEON_REG_UART_STATUS_ERR; } - + /* Is Data available? */ if ( (READ_REG(®s->status) & LEON_REG_UART_STATUS_DR) == 0 ) return -1; /* No data avail */ - + /* Return Data */ return (int)READ_REG(®s->data); } @@ -187,7 +187,7 @@ static int apbuart_write_support(apbuart_priv *uart, const char *buf, int len) while (nwrite < len) { if ( apbuart_outbyte_try(minor, *buf++) ){ /* TX Fifo full */ - + } nwrite++; } @@ -197,17 +197,17 @@ static int apbuart_write_support(apbuart_priv *uart, const char *buf, int len) static void apbuart_hw_open(apbuart_priv *uart){ unsigned int scaler; - + /* Calculate Baudrate */ if ( uart->scaler > 0 ) { scaler = uart->scaler; }else{ scaler = (((sys_freq_hz*10)/(uart->baud*8))-5)/10; } - + /* Set new baud rate */ uart->regs->scaler = scaler; - + /* Enable receiver & Transmitter */ uart->regs->ctrl = APBUART_CTRL_RE | APBUART_CTRL_RF | APBUART_CTRL_RI | APBUART_CTRL_TI; } @@ -221,7 +221,7 @@ static void apbuart_hw_close(apbuart_priv *uart){ /* interrupt handler */ static void apbuart_interrupt_handler(rtems_vector_number v){ int minor; - + /* convert to */ for(minor = 0; minor < dev_cnt; minor++) { if ( v == (apbuarts[minor].irq+0x10) ) { @@ -232,7 +232,7 @@ static void apbuart_interrupt_handler(rtems_vector_number v){ } #endif -/* The interrupt handler, taking care of the +/* The interrupt handler, taking care of the * APBUART hardware */ static void apbuart_interrupt(apbuart_priv *uart){ @@ -240,7 +240,7 @@ static void apbuart_interrupt(apbuart_priv *uart){ int empty; unsigned char c, *next_char = NULL; int signal; - + /* Clear & record any error */ status = READ_REG(&uart->regs->status); if ( status & (APBUART_STATUS_OV|APBUART_STATUS_PE|APBUART_STATUS_FE) ){ @@ -258,7 +258,7 @@ static void apbuart_interrupt(apbuart_priv *uart){ } uart->regs->status = status & ~(APBUART_STATUS_OV|APBUART_STATUS_PE|APBUART_STATUS_FE); } - + /* Empty RX fifo into software fifo */ signal = 0; while ( (status=READ_REG(&uart->regs->status)) & APBUART_STATUS_DR ){ @@ -270,20 +270,20 @@ static void apbuart_interrupt(apbuart_priv *uart){ } /* put into fifo */ apbuart_fifo_put(uart->rxfifo,c); - + /* bump RX counter */ uart->stats.rx_cnt++; - + signal = 1; } - + /* Wake RX thread if any */ if ( signal ) rtems_semaphore_release(uart->rx_sem); - + /* If room in HW fifo and we got more chars to be sent */ if ( !(status & APBUART_STATUS_TF) ){ - + if ( apbuart_fifo_isEmpty(uart->txfifo) ){ /* Turn off TX interrupt when no data is to be sent */ if ( status & APBUART_STATUS_TE ){ @@ -292,11 +292,11 @@ static void apbuart_interrupt(apbuart_priv *uart){ } return; } - + /* signal when there will be more room in SW fifo */ if ( apbuart_fifo_isFull(uart->txfifo) ) signal = 1; - + do{ /* Put data into HW TX fifo */ apbuart_fifo_peek(uart->txfifo,&next_char); @@ -310,9 +310,9 @@ static void apbuart_interrupt(apbuart_priv *uart){ } uart->regs->ctrl = READ_REG(&uart->regs->ctrl) | APBUART_CTRL_TE | APBUART_CTRL_TF; DBG("!"); - }while(!(empty=apbuart_fifo_isEmpty(uart->txfifo)) && + }while(!(empty=apbuart_fifo_isEmpty(uart->txfifo)) && !((status=READ_REG(&uart->regs->status))&APBUART_STATUS_TF) ); - + /* Wake userspace thread, on empty or full fifo * This makes tx_flush and block work. */ @@ -336,7 +336,7 @@ int APBUART_PREFIX(_register)(amba_confarea_type *bus) { switch(r) { case RTEMS_TOO_MANY: printk("APBUART rtems_io_register_driver failed: RTEMS_TOO_MANY\n"); return -1; - case RTEMS_INVALID_NUMBER: + case RTEMS_INVALID_NUMBER: printk("APBUART rtems_io_register_driver failed: RTEMS_INVALID_NUMBER\n"); return -1; case RTEMS_RESOURCE_IN_USE: printk("APBUART rtems_io_register_driver failed: RTEMS_RESOURCE_IN_USE\n"); return -1; @@ -350,7 +350,7 @@ int APBUART_PREFIX(_register)(amba_confarea_type *bus) { static rtems_device_driver apbuart_initialize(rtems_device_major_number major, rtems_device_minor_number minor, void *arg) { - + rtems_status_code status; int i; amba_apb_device dev; @@ -365,28 +365,28 @@ static rtems_device_driver apbuart_initialize(rtems_device_major_number major, printk("APBUART: Failed to find any APBUART cores\n\r"); return -1; } - + strcpy(fs_name,APBUART_DEVNAME); - + DBG("Found %d APBUART(s)\n\r",dev_cnt); - + /* Allocate memory for device structures */ apbuarts = malloc(sizeof(apbuart_priv) * dev_cnt); if ( !apbuarts ){ printk("APBUART: Failed to allocate SW memory\n\r"); return -1; } - + memset(apbuarts,0,sizeof(sizeof(apbuart_priv) * dev_cnt)); - + /* Detect System Frequency from initialized timer */ #ifndef SYS_FREQ_HZ #if defined(LEON3) - /* LEON3: find timer address via AMBA Plug&Play info */ + /* LEON3: find timer address via AMBA Plug&Play info */ { amba_apb_device gptimer; LEON3_Timer_Regs_Map *tregs; - + if ( amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_GPTIMER,&gptimer) == 1 ){ tregs = (LEON3_Timer_Regs_Map *)gptimer.start; sys_freq_hz = (tregs->scaler_reload+1)*1000*1000; @@ -395,7 +395,7 @@ static rtems_device_driver apbuart_initialize(rtems_device_major_number major, sys_freq_hz = 40000000; /* Default to 40MHz */ printk("APBUART: Failed to detect system frequency\n\r"); } - + } #elif defined(LEON2) /* LEON2: use hardcoded address to get to timer */ @@ -410,27 +410,27 @@ static rtems_device_driver apbuart_initialize(rtems_device_major_number major, /* Use hardcoded frequency */ sys_freq_hz = SYS_FREQ_HZ; #endif - + for(i=0; i<dev_cnt; i++){ /* Get AMBA AHB device info from Plug&Play */ amba_find_next_apbslv(amba_bus,VENDOR_GAISLER,GAISLER_APBUART,&dev,i); - + printk("APBUART[%d]: at 0x%x irq %d (0x%x)\n\r",i,dev.start,dev.irq,(unsigned int)&apbuarts[i]); - + apbuarts[i].regs = (ambapp_apb_uart *)dev.start; apbuarts[i].irq = dev.irq; apbuarts[i].minor = i; - + /* Clear HW regs */ apbuarts[i].regs->status = 0; - apbuarts[i].regs->ctrl = 0; - + apbuarts[i].regs->ctrl = 0; + /* Allocate default software buffers */ - apbuarts[i].txfifo = apbuart_fifo_create(DEFAULT_TXBUF_SIZE); + apbuarts[i].txfifo = apbuart_fifo_create(DEFAULT_TXBUF_SIZE); apbuarts[i].rxfifo = apbuart_fifo_create(DEFAULT_RXBUF_SIZE); if ( !apbuarts[i].txfifo || !apbuarts[i].rxfifo ) rtems_fatal_error_occurred(RTEMS_NO_MEMORY); - + APBUART_DEVNAME_NO(fs_name,i); /* Bind name to device */ @@ -438,28 +438,28 @@ static rtems_device_driver apbuart_initialize(rtems_device_major_number major, status = rtems_io_register_name(fs_name, major, i); if (status != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred(status); - + /* Setup interrupt handler for each channel */ APBUART_REG_INT(APBUART_PREFIX(_interrupt_handler), apbuarts[i].irq, &apbuarts[i]); - + /* Device A Semaphore created with count = 1 */ if ( rtems_semaphore_create(rtems_build_name('A', 'U', 'D', '0'+i), 1, - RTEMS_FIFO|RTEMS_SIMPLE_BINARY_SEMAPHORE|RTEMS_NO_INHERIT_PRIORITY|RTEMS_LOCAL|RTEMS_NO_PRIORITY_CEILING, + RTEMS_FIFO|RTEMS_SIMPLE_BINARY_SEMAPHORE|RTEMS_NO_INHERIT_PRIORITY|RTEMS_LOCAL|RTEMS_NO_PRIORITY_CEILING, 0, &apbuarts[i].dev_sem) != RTEMS_SUCCESSFUL ) return RTEMS_INTERNAL_ERROR; - + if ( rtems_semaphore_create(rtems_build_name('A', 'U', 'T', '0'+i), 1, - RTEMS_FIFO|RTEMS_SIMPLE_BINARY_SEMAPHORE|RTEMS_NO_INHERIT_PRIORITY|RTEMS_LOCAL|RTEMS_NO_PRIORITY_CEILING, + RTEMS_FIFO|RTEMS_SIMPLE_BINARY_SEMAPHORE|RTEMS_NO_INHERIT_PRIORITY|RTEMS_LOCAL|RTEMS_NO_PRIORITY_CEILING, 0, &apbuarts[i].tx_sem) != RTEMS_SUCCESSFUL ) return RTEMS_INTERNAL_ERROR; - + if ( rtems_semaphore_create(rtems_build_name('A', 'U', 'R', '0'+i), 1, - RTEMS_FIFO|RTEMS_SIMPLE_BINARY_SEMAPHORE|RTEMS_NO_INHERIT_PRIORITY|RTEMS_LOCAL|RTEMS_NO_PRIORITY_CEILING, + RTEMS_FIFO|RTEMS_SIMPLE_BINARY_SEMAPHORE|RTEMS_NO_INHERIT_PRIORITY|RTEMS_LOCAL|RTEMS_NO_PRIORITY_CEILING, 0, &apbuarts[i].rx_sem) != RTEMS_SUCCESSFUL ) return RTEMS_INTERNAL_ERROR; @@ -469,95 +469,95 @@ static rtems_device_driver apbuart_initialize(rtems_device_major_number major, } static rtems_device_driver apbuart_open(rtems_device_major_number major, rtems_device_minor_number minor, void *arg) -{ +{ apbuart_priv *uart; - + FUNCDBG("apbuart_open: major %d, minor %d\n", major, minor); if ( (minor < 0) || (minor >= dev_cnt) ) { DBG("Wrong minor %d\n", minor); return RTEMS_INVALID_NAME; } - + uart = &apbuarts[minor]; if (rtems_semaphore_obtain(uart->dev_sem, RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT) != RTEMS_SUCCESSFUL) { DBG("apbuart_open: resource in use\n"); return RTEMS_RESOURCE_IN_USE; } - + /* Clear HW regs */ uart->regs->status = 0; uart->regs->ctrl = 0; - + /* Set Defaults */ - + /* 38400 baudrate */ uart->scaler = 0; /* use uart->baud */ uart->baud = 38400; - + /* Default to Blocking mode */ uart->txblk = 1; uart->rxblk = 1; - + /* Default to no flush mode */ uart->tx_flush = 0; /* non-ascii mode */ uart->ascii_mode = 0; - + /* not started */ uart->started = 0; - + if ( !uart->txfifo || (uart->txfifo->size!=DEFAULT_TXBUF_SIZE) ){ apbuart_fifo_free(uart->txfifo); uart->txfifo = apbuart_fifo_create(DEFAULT_TXBUF_SIZE); } - + if ( !uart->rxfifo || (uart->rxfifo->size!=DEFAULT_RXBUF_SIZE) ){ apbuart_fifo_free(uart->rxfifo); uart->rxfifo = apbuart_fifo_create(DEFAULT_RXBUF_SIZE); } - + if ( !uart->rxfifo || !uart->txfifo ){ /* Failed to get memory */ return RTEMS_NO_MEMORY; } - + /* Now user must call ioctl(START,0) to begin */ - + return RTEMS_SUCCESSFUL; } static rtems_device_driver apbuart_close(rtems_device_major_number major, rtems_device_minor_number minor, void *arg) { apbuart_priv *uart = &apbuarts[minor]; - + FUNCDBG("apbuart_close[%d]:\n",minor); - + apbuart_hw_close(uart); /* Software state will be set when open is called again */ rtems_semaphore_release(uart->rx_sem); rtems_semaphore_release(uart->tx_sem); uart->started = 0; - + rtems_semaphore_release(uart->dev_sem); - + return RTEMS_SUCCESSFUL; } - + static rtems_device_driver apbuart_read(rtems_device_major_number major, rtems_device_minor_number minor, void *arg) { rtems_libio_rw_args_t *rw_args; unsigned int count = 0, oldLevel; unsigned char *buf; apbuart_priv *uart = &apbuarts[minor]; - + rw_args = (rtems_libio_rw_args_t *) arg; FUNCDBG("apbuart_read\n"); - + buf = (unsigned char *)rw_args->buffer; if ( (rw_args->count < 1) || !buf ) return RTEMS_INVALID_NAME; /* EINVAL */ @@ -568,35 +568,35 @@ static rtems_device_driver apbuart_read(rtems_device_major_number major, rtems_d printk("UART %x is screwed\n",uart); } /* Read from SW fifo */ - if ( apbuart_fifo_get(uart->rxfifo,&buf[count]) != 0 ){ + if ( apbuart_fifo_get(uart->rxfifo,&buf[count]) != 0 ){ /* non blocking or read at least 1 byte */ if ( (count > 0) || (!uart->rxblk) ) break; /* Return */ - + rtems_interrupt_enable(oldLevel); /* Block thread until a char is received */ rtems_semaphore_obtain(uart->rx_sem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - + rtems_interrupt_disable(oldLevel); continue; } - + /* Got char from SW FIFO */ count++; - + } while (count < rw_args->count ); - + rtems_interrupt_enable(oldLevel); rw_args->bytes_moved = count; - + if (count == 0) return RTEMS_TIMEOUT; /* ETIMEDOUT should be EAGAIN/EWOULDBLOCK */ return RTEMS_SUCCESSFUL; } - + static rtems_device_driver apbuart_write(rtems_device_major_number major, rtems_device_minor_number minor, void *arg) { rtems_libio_rw_args_t *rw_args; @@ -604,26 +604,26 @@ static rtems_device_driver apbuart_write(rtems_device_major_number major, rtems_ char *buf; apbuart_priv *uart = &apbuarts[minor]; int direct=0; - - + + rw_args = (rtems_libio_rw_args_t *) arg; - + FUNCDBG("apbuart_write\n"); - + buf = rw_args->buffer; - + if ( rw_args->count < 1 || !buf ) - return RTEMS_INVALID_NAME; /* EINVAL */ - + return RTEMS_INVALID_NAME; /* EINVAL */ + count = 0; rtems_interrupt_disable(oldLevel); /* Do we need to start to send first char direct via HW * to get IRQ going. */ - + ctrl = READ_REG(&uart->regs->ctrl); if ( (ctrl & APBUART_CTRL_TF) == 0 ){ - /* TX interrupt is disabled ==> + /* TX interrupt is disabled ==> * SW FIFO is empty and, * HW FIFO empty */ @@ -637,7 +637,7 @@ static rtems_device_driver apbuart_write(rtems_device_major_number major, rtems_ uart->regs->ctrl = ctrl | APBUART_CTRL_TE | APBUART_CTRL_TF; direct = 1; } - + while( count < rw_args->count ) { /* write to HW FIFO direct skipping SW FIFO */ if ( direct && ((READ_REG(&uart->regs->status) & APBUART_STATUS_TF) == 0) ){ @@ -647,23 +647,23 @@ static rtems_device_driver apbuart_write(rtems_device_major_number major, rtems_ else if ( apbuart_fifo_put(uart->txfifo,buf[count]) ){ direct = 0; DBG("APBUART[%d]: write: SW FIFO Full\n\r",minor); - + /* is full, block? */ if ( ((count < 1) && uart->txblk) || uart->tx_flush ){ - + rtems_interrupt_enable(oldLevel); - + rtems_semaphore_obtain(uart->tx_sem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - + rtems_interrupt_disable(oldLevel); - + /* Do we need to start to send first char direct via HW * to get IRQ going. */ - + ctrl = READ_REG(&uart->regs->ctrl); if ( (ctrl & APBUART_CTRL_TF) == 0 ){ - /* TX interrupt is disabled ==> + /* TX interrupt is disabled ==> * SW FIFO is empty and, * HW FIFO empty */ @@ -677,7 +677,7 @@ static rtems_device_driver apbuart_write(rtems_device_major_number major, rtems_ uart->regs->ctrl = ctrl | APBUART_CTRL_TF | APBUART_CTRL_TE; direct = 1; } - + continue; } /* don't block, return current status */ @@ -685,18 +685,18 @@ static rtems_device_driver apbuart_write(rtems_device_major_number major, rtems_ }else{ direct = 0; } - + count++; - + } rtems_interrupt_enable(oldLevel); - + rw_args->bytes_moved = count; - + if (count == 0) return RTEMS_TIMEOUT; /* ETIMEDOUT should be EAGAIN/EWOULDBLOCK */ - + return RTEMS_SUCCESSFUL; } @@ -710,13 +710,13 @@ static rtems_device_driver apbuart_control(rtems_device_major_number major, rtem apbuart_stats *stats; FUNCDBG("apbuart_control [%i,%i]\n",major, minor); - + if (!ioarg) return RTEMS_INVALID_NAME; ioarg->ioctl_return = 0; switch(ioarg->command) { - + /* Enable Receiver & transmitter */ case APBUART_START: if ( uart->started ) @@ -724,7 +724,7 @@ static rtems_device_driver apbuart_control(rtems_device_major_number major, rtem apbuart_hw_open(uart); uart->started = 1; break; - + /* Close Receiver & transmitter */ case APBUART_STOP: if ( !uart->started ) @@ -732,49 +732,49 @@ static rtems_device_driver apbuart_control(rtems_device_major_number major, rtem apbuart_hw_close(uart); uart->started = 0; break; - - /* Set RX FIFO Software buffer length + + /* Set RX FIFO Software buffer length * It is only possible to change buffer size in * non-running mode. */ case APBUART_SET_RXFIFO_LEN: if ( uart->started ) return RTEMS_RESOURCE_IN_USE; /* EBUSY */ - + size = (int)ioarg->buffer; - if ( size < 1 ) + if ( size < 1 ) return RTEMS_INVALID_NAME; /* EINVAL */ - + /* Free old buffer */ apbuart_fifo_free(uart->rxfifo); - + /* Allocate new buffer & init it */ uart->rxfifo = apbuart_fifo_create(size); if ( !uart->rxfifo ) return RTEMS_NO_MEMORY; break; - /* Set TX FIFO Software buffer length - * It is only possible to change buffer size + /* Set TX FIFO Software buffer length + * It is only possible to change buffer size * while in non-running mode. */ case APBUART_SET_TXFIFO_LEN: if ( uart->started ) return RTEMS_RESOURCE_IN_USE; /* EBUSY */ - + size = (int)ioarg->buffer; - if ( size < 1 ) + if ( size < 1 ) return RTEMS_INVALID_NAME; /* EINVAL */ - + /* Free old buffer */ apbuart_fifo_free(uart->txfifo); - + /* Allocate new buffer & init it */ uart->txfifo = apbuart_fifo_create(size); if ( !uart->txfifo ) return RTEMS_NO_MEMORY; break; - + case APBUART_SET_BAUDRATE: /* Set baud rate of */ baudrate = (int)ioarg->buffer; @@ -784,37 +784,37 @@ static rtems_device_driver apbuart_control(rtems_device_major_number major, rtem uart->scaler = 0; /* use uart->baud */ uart->baud = baudrate; break; - + case APBUART_SET_SCALER: /* use uart->scaler not uart->baud */ uart->scaler = data[0]; break; - + case APBUART_SET_BLOCKING: blocking = (unsigned int)ioarg->buffer; uart->rxblk = ( blocking & APBUART_BLK_RX ); uart->txblk = ( blocking & APBUART_BLK_TX ); uart->tx_flush = ( blocking & APBUART_BLK_FLUSH ); break; - + case APBUART_GET_STATS: stats = (void *)ioarg->buffer; if ( !stats ) return RTEMS_INVALID_NAME; - + /* Copy Stats */ *stats = uart->stats; break; - + case APBUART_CLR_STATS: /* Clear/reset Stats */ memset(&uart->stats,0,sizeof(uart->stats)); break; - + case APBUART_SET_ASCII_MODE: uart->ascii_mode = (int)ioarg->buffer; break; - + default: return RTEMS_NOT_DEFINED; } diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart_pci.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart_pci.c index ad2effa065..54d14ce459 100644 --- a/c/src/lib/libbsp/sparc/shared/uart/apbuart_pci.c +++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart_pci.c @@ -8,7 +8,7 @@ /* Any non-static function will begin with */ #define APBUART_PREFIX(name) apbuartpci##name -/* do nothing, assume that the interrupt handler is called +/* do nothing, assume that the interrupt handler is called * setup externally calling apbuartpci_interrupt_handler. */ #define APBUART_REG_INT(handler,irq,arg) \ @@ -27,15 +27,15 @@ void apbuartpci_interrupt_handler(int irq, void *arg); int apbuart_pci_register(amba_confarea_type *bus) { /* Setup configuration */ - + /* Register the driver */ return APBUART_PREFIX(_register)(bus); } -/* Call this from PCI interrupt handler +/* Call this from PCI interrupt handler * irq = the irq number of the HW device local to that IRQMP controller - * + * */ void apbuartpci_interrupt_handler(int irq, void *arg){ apbuart_interrupt(arg); diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart_rasta.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart_rasta.c index a5c365eb77..4b8734fdb6 100644 --- a/c/src/lib/libbsp/sparc/shared/uart/apbuart_rasta.c +++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart_rasta.c @@ -8,7 +8,7 @@ /* Any non-static function will begin with */ #define APBUART_PREFIX(name) apbuartrasta##name -/* do nothing, assume that the interrupt handler is called +/* do nothing, assume that the interrupt handler is called * setup externally calling apbuartrasta_interrupt_handler. */ #define APBUART_REG_INT(handler,irq,arg) \ @@ -27,15 +27,15 @@ void apbuartrasta_interrupt_handler(int irq, void *arg); int apbuart_rasta_register(amba_confarea_type *bus) { /* Setup configuration */ - + /* Register the driver */ return APBUART_PREFIX(_register)(bus); } -/* Call this from RASTA interrupt handler +/* Call this from RASTA interrupt handler * irq = the irq number of the HW device local to that IRQMP controller - * + * */ void apbuartrasta_interrupt_handler(int irq, void *arg){ apbuart_interrupt(arg); |