Changeset 1d5d6de in rtems


Ignore:
Timestamp:
11/26/13 08:11:57 (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
a54179d2
Parents:
6fe6d017
git-author:
Sebastian Huber <sebastian.huber@…> (11/26/13 08:11:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/04/14 13:54:27)
Message:

bsp/leon3: Console driver changes

Move declaration of global variables and functions to <leon.h> header
file. Make several global variables and functions static.

Location:
c/src/lib/libbsp/sparc/leon3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon3/console/console.c

    r6fe6d017 r1d5d6de  
    3232#include <assert.h>
    3333#include <rtems/bspIo.h>
    34 #include <amba.h>
     34#include <leon.h>
    3535#include <rtems/termiostypes.h>
    3636
    37 /* Let user override which on-chip APBUART will be debug UART
    38  * 0 = Default APBUART. On MP system CPU0=APBUART0, CPU1=APBUART1...
    39  * 1 = APBUART[0]
    40  * 2 = APBUART[1]
    41  * 3 = APBUART[2]
    42  * ...
    43  */
    4437int syscon_uart_index __attribute__((weak)) = 0;
    45 
    46 /*
    47  *  apbuart_outbyte_polled
    48  *
    49  *  This routine transmits a character using polling.
    50  */
    51 
    52 extern void apbuart_outbyte_polled(
    53   struct apbuart_regs *regs,
    54   unsigned char ch,
    55   int do_cr_on_newline,
    56   int wait_sent
    57   );
    58 
    59 
    60 /* body is in printk_support.c */
    61 
    62 /*
    63  *  apbuart_inbyte_nonblocking
    64  *
    65  *  This routine polls for a character.
    66  */
    67 
    68 extern int apbuart_inbyte_nonblocking(struct apbuart_regs *regs);
    6938
    7039/* body is in debugputs.c */
     
    155124
    156125/*
    157  * Prototypes to avoid warnings
    158  */
    159 ssize_t console_write_polled(int minor, const char *buf, size_t len);
    160 int console_pollRead(int minor);
    161 
    162 /*
    163126 *  Console Termios Support Entry Points
    164127 */
    165 ssize_t console_write_polled(int minor, const char *buf, size_t len)
     128static ssize_t leon3_console_write_polled(
     129  int minor,
     130  const char *buf,
     131  size_t len
     132)
    166133{
    167134  struct apbuart_priv *uart = leon3_console_get_uart(minor);
     
    175142}
    176143
    177 int console_pollRead(int minor)
     144static int leon3_console_pollRead(int minor)
    178145{
    179146  struct apbuart_priv *uart = leon3_console_get_uart(minor);
     
    184151#endif
    185152
    186 /*
    187  * Prototypes to avoid warnings
    188  */
    189 int console_set_attributes(int minor, const struct termios *t);
    190 int find_matching_apbuart(struct ambapp_dev *dev, int index, void *arg);
    191 int console_scan_uarts(void);
    192 
    193 
    194 int console_set_attributes(int minor, const struct termios *t)
     153static int leon3_console_set_attributes(int minor, const struct termios *t)
    195154{
    196155  struct apbuart_priv *uart = leon3_console_get_uart(minor);
     
    260219
    261220/* AMBA PP find routine. Extract AMBA PnP information into data structure. */
    262 int find_matching_apbuart(struct ambapp_dev *dev, int index, void *arg)
     221static int find_matching_apbuart(struct ambapp_dev *dev, int index, void *arg)
    263222{
    264223  struct ambapp_apb_info *apb = (struct ambapp_apb_info *)dev->devinfo;
     
    282241
    283242/* Find all UARTs */
    284 int console_scan_uarts(void)
     243static void leon3_console_scan_uarts(void)
    285244{
    286245  memset(apbuarts, 0, sizeof(apbuarts));
     
    289248  ambapp_for_each(&ambapp_plb, (OPTIONS_ALL|OPTIONS_APB_SLVS), VENDOR_GAISLER,
    290249                  GAISLER_APBUART, find_matching_apbuart, NULL);
    291 
    292   return uarts;
    293250}
    294251
     
    311268
    312269  /* Find UARTs */
    313   console_scan_uarts();
     270  leon3_console_scan_uarts();
    314271
    315272  /* Update syscon_uart_index to index used as /dev/console
     
    430387    NULL,                        /* pollRead */
    431388    leon3_console_write_support, /* write */
    432     console_set_attributes,      /* setAttributes */
     389    leon3_console_set_attributes,/* setAttributes */
    433390    NULL,                        /* stopRemoteTx */
    434391    NULL,                        /* startRemoteTx */
     
    440397    leon3_console_first_open,    /* firstOpen */
    441398    NULL,                        /* lastClose */
    442     console_pollRead,            /* pollRead */
    443     console_write_polled,        /* write */
    444     console_set_attributes,      /* setAttributes */
     399    leon3_console_pollRead,      /* pollRead */
     400    leon3_console_write_polled,  /* write */
     401    leon3_console_set_attributes,/* setAttributes */
    445402    NULL,                        /* stopRemoteTx */
    446403    NULL,                        /* startRemoteTx */
  • c/src/lib/libbsp/sparc/leon3/console/printk_support.c

    r6fe6d017 r1d5d6de  
    1717
    1818#include <bsp.h>
     19#include <leon.h>
    1920#include <rtems/libio.h>
    2021#include <stdlib.h>
     
    2223#include <stdio.h>
    2324
    24 /* Let user override which on-chip APBUART will be debug UART
    25  * 0 = Default APBUART. On MP system CPU0=APBUART0, CPU1=APBUART1...
    26  * 1 = APBUART[0]
    27  * 2 = APBUART[1]
    28  * 3 = APBUART[2]
    29  * ...
    30  */
    3125int debug_uart_index __attribute__((weak)) = 0;
    32 struct apbuart_regs *dbg_uart = NULL;
     26static struct apbuart_regs *dbg_uart = NULL;
    3327
    3428/* Before UART driver has registered (or when no UART is available), calls to
     
    3731 * early BSP boot.. At least the last printk() will be caught.
    3832 */
    39 char pre_printk_dbgbuf[32] = {0};
    40 int pre_printk_pos = 0;
     33static char pre_printk_dbgbuf[32] = {0};
     34static int pre_printk_pos = 0;
    4135
    4236/* Initialize the BSP system debug console layer. It will scan AMBA Plu&Play
  • c/src/lib/libbsp/sparc/leon3/include/leon.h

    r6fe6d017 r1d5d6de  
    274274}
    275275
     276/* Let user override which on-chip APBUART will be debug UART
     277 * 0 = Default APBUART. On MP system CPU0=APBUART0, CPU1=APBUART1...
     278 * 1 = APBUART[0]
     279 * 2 = APBUART[1]
     280 * 3 = APBUART[2]
     281 * ...
     282 */
     283extern int syscon_uart_index;
     284
     285/* Let user override which on-chip APBUART will be debug UART
     286 * 0 = Default APBUART. On MP system CPU0=APBUART0, CPU1=APBUART1...
     287 * 1 = APBUART[0]
     288 * 2 = APBUART[1]
     289 * 3 = APBUART[2]
     290 * ...
     291 */
     292extern int debug_uart_index;
     293
     294/*
     295 *  apbuart_outbyte_polled
     296 *
     297 *  This routine transmits a character using polling.
     298 */
     299void apbuart_outbyte_polled(
     300  struct apbuart_regs *regs,
     301  unsigned char ch,
     302  int do_cr_on_newline,
     303  int wait_sent
     304);
     305
     306/*
     307 *  apbuart_inbyte_nonblocking
     308 *
     309 *  This routine polls for a character.
     310 */
     311int apbuart_inbyte_nonblocking(struct apbuart_regs *regs);
     312
    276313#endif /* !ASM */
    277314
Note: See TracChangeset for help on using the changeset viewer.