libchip/serial: Add const qualifier

This commit is contained in:
Sebastian Huber
2013-02-08 13:39:59 +01:00
parent e4933743ef
commit c8bd3cda93
38 changed files with 64 additions and 64 deletions

View File

@@ -31,7 +31,7 @@ static void fbcons_write_polled(int minor, char c);
static int fbcons_set_attributes(int minor, const struct termios *t);
/* Pointers to functions for handling the UART. */
console_fns fbcons_fns =
const console_fns fbcons_fns =
{
libchip_serial_default_probe,
fbcons_first_open,

View File

@@ -29,24 +29,24 @@
#include <libchip/sersupp.h>
#include <bspopts.h>
extern console_fns dbgu_fns;
extern const console_fns dbgu_fns;
#if ENABLE_LCD
extern console_fns fbcons_fns;
extern const console_fns fbcons_fns;
#define LCD_DEV 1
#else
#define LCD_DEV 0
#endif
#if (ENABLE_UMON && ENABLE_UMON_CONSOLE)
extern console_fns umoncons_fns;
extern const console_fns umoncons_fns;
#define UMON_CONS_DEV 1
#else
#define UMON_CONS_DEV 0
#endif
#if ENABLE_USART0 || ENABLE_USART1 || ENABLE_USART2 || ENABLE_USART3
extern console_fns usart_polling_fns;
extern const console_fns usart_polling_fns;
#endif
#if ENABLE_USART0

View File

@@ -30,7 +30,7 @@ static int uart_set_attributes(int minor, const struct termios *t);
unsigned long Console_Configuration_Count = NUM_DEVS;
console_fns uart_fns =
const console_fns uart_fns =
{
libchip_serial_default_probe,
uart_first_open,

View File

@@ -45,7 +45,7 @@ static int uart_set_attributes(int minor, const struct termios *t);
unsigned long Console_Configuration_Count = NUM_DEVS;
/* Pointers to functions for handling the UART. */
console_fns uart_fns =
const console_fns uart_fns =
{
libchip_serial_default_probe,
uart_first_open,

View File

@@ -27,7 +27,7 @@
/* These are used by code in console.c */
unsigned long Console_Configuration_Count = NUM_DEVS;
extern console_fns ffuart_fns;
extern const console_fns ffuart_fns;
/*
* There's one item in array for each UART.

View File

@@ -91,7 +91,7 @@ static int set_attribues(int minor, const struct termios *term)
return -1;
}
console_fns lm3s69xx_uart_fns = {
const console_fns lm3s69xx_uart_fns = {
.deviceProbe = libchip_serial_default_probe,
.deviceFirstOpen = first_open,
.deviceLastClose = last_close,

View File

@@ -77,7 +77,7 @@ typedef struct {
uint32_t icr;
} lm3s69xx_uart;
extern console_fns lm3s69xx_uart_fns;
extern const console_fns lm3s69xx_uart_fns;
#ifdef __cplusplus
}

View File

@@ -26,7 +26,7 @@
#include <bsp/lpc32xx.h>
#include <bsp/irq.h>
extern console_fns lpc32xx_hsu_fns;
extern const console_fns lpc32xx_hsu_fns;
static uint8_t lpc32xx_uart_get_register(uintptr_t addr, uint8_t i)
{

View File

@@ -189,7 +189,7 @@ static int lpc32xx_hsu_set_attributes(int minor, const struct termios *term)
return 0;
}
console_fns lpc32xx_hsu_fns = {
const console_fns lpc32xx_hsu_fns = {
.deviceProbe = libchip_serial_default_probe,
.deviceFirstOpen = lpc32xx_hsu_first_open,
.deviceLastClose = NULL,

View File

@@ -47,7 +47,7 @@ static int uart_set_attributes(int minor, const struct termios *t);
unsigned long Console_Configuration_Count = NUM_DEVS;
/* Pointers to functions for handling the UART. */
console_fns uart_fns =
const console_fns uart_fns =
{
libchip_serial_default_probe,
uart_first_open,

View File

@@ -199,7 +199,7 @@ static int usart_set_attributes(int minor, const struct termios *term)
return -1;
}
console_fns stm32f4_usart_fns = {
const console_fns stm32f4_usart_fns = {
.deviceProbe = libchip_serial_default_probe,
.deviceFirstOpen = usart_first_open,
.deviceLastClose = usart_last_close,

View File

@@ -21,7 +21,7 @@
extern "C" {
#endif /* __cplusplus */
extern console_fns stm32f4_usart_fns;
extern const console_fns stm32f4_usart_fns;
#ifdef __cplusplus
}

View File

@@ -186,7 +186,7 @@ bool vgacons_probe(
return true;
}
console_fns vgacons_fns =
const console_fns vgacons_fns =
{
libchip_serial_default_probe, /* deviceProbe */
vgacons_open, /* deviceFirstOpen */

View File

@@ -32,7 +32,7 @@ bool vgacons_probe( int minor );
/*
* Driver function table
*/
extern console_fns vgacons_fns;
extern const console_fns vgacons_fns;
#ifdef __cplusplus
}

View File

@@ -39,7 +39,7 @@ static bool config_68360_scc_base_probe_10(int minor);
static bool config_68360_scc_base_probe_11(int minor);
static bool config_68360_scc_base_probe_12(int minor);
extern console_fns mc68360_scc_fns;
extern const console_fns mc68360_scc_fns;
/*
* The following table configures the console drivers used in this BSP.

View File

@@ -959,7 +959,7 @@ int mc68360_scc_create_chip( PPMCQ1BoardData BoardData, uint8_t int_vector )
return RTEMS_SUCCESSFUL;
}
console_fns mc68360_scc_fns = {
const console_fns mc68360_scc_fns = {
libchip_serial_default_probe, /* deviceProbe */
mc68360_scc_open, /* deviceFirstOpen */
NULL, /* deviceLastClose */
@@ -971,7 +971,7 @@ console_fns mc68360_scc_fns = {
TRUE /* deviceOutputUsesInterrupts */
};
console_fns mc68360_scc_polled = {
const console_fns mc68360_scc_polled = {
libchip_serial_default_probe, /* deviceProbe */
mc68360_scc_open, /* deviceFirstOpen */
mc68360_scc_close, /* deviceLastClose */

View File

@@ -31,8 +31,8 @@ void Write_ns16550_register(
uint8_t ucData
);
extern console_fns ns16550_fns_8245;
extern console_fns ns16550_fns_polled_8245;
extern const console_fns ns16550_fns_8245;
extern const console_fns ns16550_fns_polled_8245;
#ifdef __cplusplus
}

View File

@@ -182,7 +182,7 @@ static int set_attributes(int minor, const struct termios *term)
return -1;
}
console_fns qoriq_uart_bridge_master = {
const console_fns qoriq_uart_bridge_master = {
.deviceProbe = libchip_serial_default_probe,
.deviceFirstOpen = first_open,
.deviceLastClose = last_close,

View File

@@ -198,7 +198,7 @@ static int set_attribues(int minor, const struct termios *term)
return -1;
}
console_fns qoriq_uart_bridge_slave = {
const console_fns qoriq_uart_bridge_slave = {
.deviceProbe = libchip_serial_default_probe,
.deviceFirstOpen = first_open,
.deviceLastClose = last_close,

View File

@@ -55,9 +55,9 @@ typedef struct {
rtems_chain_control transmit_fifo;
} uart_bridge_slave_control;
extern console_fns qoriq_uart_bridge_master;
extern const console_fns qoriq_uart_bridge_master;
extern console_fns qoriq_uart_bridge_slave;
extern const console_fns qoriq_uart_bridge_slave;
/** @} */

View File

@@ -112,7 +112,7 @@ static int set_attribues(int minor, const struct termios *term)
return -1;
}
static console_fns t32mppc_console_fns = {
static const console_fns t32mppc_console_fns = {
.deviceProbe = libchip_serial_default_probe,
.deviceFirstOpen = first_open,
.deviceLastClose = last_close,

View File

@@ -228,7 +228,7 @@ int xlite_set_attributes(int minor, const struct termios *t)
console_fns xlite_fns_polled =
const console_fns xlite_fns_polled =
{
libchip_serial_default_probe, /* deviceProbe */
xlite_open, /* deviceFirstOpen */

View File

@@ -25,7 +25,7 @@
/*
* Function set for interrupt enabled termios console
*/
console_fns sh_sci_fns =
const console_fns sh_sci_fns =
{
libchip_serial_default_probe, /* deviceProbe */
sh_sci_first_open, /* deviceFirstOpen */
@@ -41,7 +41,7 @@ console_fns sh_sci_fns =
/*
* Function set for polled termios console
*/
console_fns sh_sci_fns_polled =
const console_fns sh_sci_fns_polled =
{
libchip_serial_default_probe, /* deviceProbe */
sh_sci_first_open, /* deviceFirstOpen */

View File

@@ -26,7 +26,7 @@ static void umoncons_write_polled(int minor, char c);
static int umoncons_set_attributes(int minor, const struct termios *t);
/* Pointers to functions for handling the UART. */
console_fns umoncons_fns =
const console_fns umoncons_fns =
{
libchip_serial_default_probe,
umoncons_first_open,

View File

@@ -57,7 +57,7 @@ static int erc32_console_first_open(int major, int minor, void *arg);
static void erc32_console_initialize(int minor);
#if (CONSOLE_USE_INTERRUPTS)
console_fns erc32_fns = {
const console_fns erc32_fns = {
libchip_serial_default_probe, /* deviceProbe */
erc32_console_first_open, /* deviceFirstOpen */
NULL, /* deviceLastClose */
@@ -69,7 +69,7 @@ static void erc32_console_initialize(int minor);
TERMIOS_IRQ_DRIVEN /* deviceOutputUsesInterrupts */
};
#else
console_fns erc32_fns = {
const console_fns erc32_fns = {
libchip_serial_default_probe, /* deviceProbe */
erc32_console_first_open, /* deviceFirstOpen */
NULL, /* deviceLastClose */

View File

@@ -45,7 +45,7 @@ bool sun4v_console_deviceProbe (int minor){
/*
* Polled mode functions
*/
console_fns pooled_functions={
const console_fns pooled_functions={
sun4v_console_deviceProbe, /* deviceProbe */
sun4v_console_device_first_open, /* deviceFirstOpen */
NULL, /* deviceLastClose */
@@ -57,7 +57,7 @@ console_fns pooled_functions={
NULL /* deviceOutputUsesInterrupts */
};
console_flow sun4v_console_console_flow = {
const console_flow sun4v_console_console_flow = {
NULL, /* deviceStopRemoteTx */
NULL /* deviceStartRemoteTx */
};

View File

@@ -35,7 +35,7 @@ static void dbgu_write_polled(int minor, char c);
static int dbgu_set_attributes(int minor, const struct termios *t);
/* Pointers to functions for handling the UART. */
console_fns dbgu_fns =
const console_fns dbgu_fns =
{
libchip_serial_default_probe,
dbgu_first_open,

View File

@@ -37,7 +37,7 @@ static int usart_set_attributes(int minor, const struct termios *t);
at91rm9200_usart_regs_t *usart_get_base(int minor);
/* Pointers to functions for handling the UART polled. */
console_fns usart_polling_fns = {
const console_fns usart_polling_fns = {
libchip_serial_default_probe, /* deviceProbe */
usart_first_open, /* deviceFirstOpen */
usart_last_close, /* deviceLastClose */

View File

@@ -29,7 +29,7 @@ static void ffuart_write_polled(int minor, char c);
static int ffuart_set_attributes(int minor, const struct termios *t);
/* Pointers to functions for handling the UART. */
console_fns ffuart_fns =
const console_fns ffuart_fns =
{
libchip_serial_default_probe,
ffuart_first_open,

View File

@@ -893,7 +893,7 @@ MG5UART_STATIC void mg5uart_enable_interrupts(
* Flow control is only supported when using interrupts
*/
console_fns mg5uart_fns =
const console_fns mg5uart_fns =
{
libchip_serial_default_probe, /* deviceProbe */
mg5uart_open, /* deviceFirstOpen */
@@ -906,7 +906,7 @@ console_fns mg5uart_fns =
TRUE /* deviceOutputUsesInterrupts */
};
console_fns mg5uart_fns_polled =
const console_fns mg5uart_fns_polled =
{
libchip_serial_default_probe, /* deviceProbe */
mg5uart_open, /* deviceFirstOpen */

View File

@@ -73,8 +73,8 @@ extern "C" {
* Driver function table
*/
extern console_fns mg5uart_fns;
extern console_fns mg5uart_fns_polled;
extern const console_fns mg5uart_fns;
extern const console_fns mg5uart_fns_polled;
/*
* Default register access routines

View File

@@ -27,7 +27,7 @@
* Flow control is only supported when using interrupts
*/
console_fns mc68681_fns =
const console_fns mc68681_fns =
{
libchip_serial_default_probe, /* deviceProbe */
mc68681_open, /* deviceFirstOpen */
@@ -40,7 +40,7 @@ console_fns mc68681_fns =
true /* deviceOutputUsesInterrupts */
};
console_fns mc68681_fns_polled =
const console_fns mc68681_fns_polled =
{
libchip_serial_default_probe, /* deviceProbe */
mc68681_open, /* deviceFirstOpen */

View File

@@ -61,8 +61,8 @@ extern mc68681_baud_t
* Driver function table
*/
extern console_fns mc68681_fns;
extern console_fns mc68681_fns_polled;
extern const console_fns mc68681_fns;
extern const console_fns mc68681_fns_polled;
/*
* Default register access routines

View File

@@ -62,17 +62,17 @@
* Flow control is only supported when using interrupts
*/
console_flow ns16550_flow_RTSCTS = {
const console_flow ns16550_flow_RTSCTS = {
ns16550_negate_RTS, /* deviceStopRemoteTx */
ns16550_assert_RTS /* deviceStartRemoteTx */
};
console_flow ns16550_flow_DTRCTS = {
const console_flow ns16550_flow_DTRCTS = {
ns16550_negate_DTR, /* deviceStopRemoteTx */
ns16550_assert_DTR /* deviceStartRemoteTx */
};
console_fns ns16550_fns = {
const console_fns ns16550_fns = {
libchip_serial_default_probe, /* deviceProbe */
ns16550_open, /* deviceFirstOpen */
ns16550_close, /* deviceLastClose */
@@ -84,7 +84,7 @@ console_fns ns16550_fns = {
true /* deviceOutputUsesInterrupts */
};
console_fns ns16550_fns_polled = {
const console_fns ns16550_fns_polled = {
libchip_serial_default_probe, /* deviceProbe */
ns16550_open, /* deviceFirstOpen */
ns16550_close, /* deviceLastClose */

View File

@@ -35,15 +35,15 @@ extern "C" {
* Driver function table
*/
extern console_fns ns16550_fns;
extern console_fns ns16550_fns_polled;
extern const console_fns ns16550_fns;
extern const console_fns ns16550_fns_polled;
/*
* Flow control function tables
*/
extern console_flow ns16550_flow_RTSCTS;
extern console_flow ns16550_flow_DTRCTS;
extern const console_flow ns16550_flow_RTSCTS;
extern const console_flow ns16550_flow_DTRCTS;
/*
* Helpers for printk

View File

@@ -123,7 +123,7 @@ typedef struct _console_tbl {
*/
console_devs deviceType;
/** pDeviceFns This is a pointer to the set of driver routines to use. */
console_fns *pDeviceFns;
const console_fns *pDeviceFns;
/** This value is passed to the serial device driver for use. In termios
* itself the number is ignored.
*/
@@ -135,7 +135,7 @@ typedef struct _console_tbl {
* should be necessary as RTS will be driven automatically
* when the transmitter is active.
*/
console_flow *pDeviceFlow;
const console_flow *pDeviceFlow;
/** The high water mark in the input buffer is set to the buffer
* size less ulMargin. Once this level is reached, the driver's
* flow control routine used to stop the remote transmitter will

View File

@@ -40,12 +40,12 @@
* Flow control is only supported when using interrupts
*/
console_flow z85c30_flow_RTSCTS = {
const console_flow z85c30_flow_RTSCTS = {
z85c30_negate_RTS, /* deviceStopRemoteTx */
z85c30_assert_RTS /* deviceStartRemoteTx */
};
console_flow z85c30_flow_DTRCTS = {
const console_flow z85c30_flow_DTRCTS = {
z85c30_negate_DTR, /* deviceStopRemoteTx */
z85c30_assert_DTR /* deviceStartRemoteTx */
};
@@ -54,7 +54,7 @@ console_flow z85c30_flow_DTRCTS = {
* Exported driver function table
*/
console_fns z85c30_fns = {
const console_fns z85c30_fns = {
libchip_serial_default_probe, /* deviceProbe */
z85c30_open, /* deviceFirstOpen */
NULL, /* deviceLastClose */
@@ -66,7 +66,7 @@ console_fns z85c30_fns = {
true /* deviceOutputUsesInterrupts */
};
console_fns z85c30_fns_polled = {
const console_fns z85c30_fns_polled = {
libchip_serial_default_probe, /* deviceProbe */
z85c30_open, /* deviceFirstOpen */
z85c30_close, /* deviceLastClose */

View File

@@ -42,15 +42,15 @@ extern "C" {
* Driver function table
*/
extern console_fns z85c30_fns;
extern console_fns z85c30_fns_polled;
extern const console_fns z85c30_fns;
extern const console_fns z85c30_fns_polled;
/*
* Flow control function tables
*/
extern console_flow z85c30_flow_RTSCTS;
extern console_flow z85c30_flow_DTRCTS;
extern const console_flow z85c30_flow_RTSCTS;
extern const console_flow z85c30_flow_DTRCTS;
/*
* Default register access routines