diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-10-15 14:20:14 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-10-16 08:58:49 -0500 |
commit | 0626dba48a5190abe2ec90db5febde46c951b3af (patch) | |
tree | 7785bb6280bbbf77a183429a65a3d04149d1eb99 /c/src/lib/libcpu | |
parent | arm/rtl22xx/startup/bspstart.c: Ensure bsp_start_default() is static (diff) | |
download | rtems-0626dba48a5190abe2ec90db5febde46c951b3af.tar.bz2 |
SH libcpu and libbsp: Fix warnings
Diffstat (limited to 'c/src/lib/libcpu')
-rw-r--r-- | c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c | 1 | ||||
-rw-r--r-- | c/src/lib/libcpu/sh/sh7045/sci/sci.c | 89 | ||||
-rw-r--r-- | c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c | 8 | ||||
-rw-r--r-- | c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c | 7 | ||||
-rw-r--r-- | c/src/lib/libcpu/sh/shgdb/score/cpu_asm.c | 7 |
5 files changed, 51 insertions, 61 deletions
diff --git a/c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c b/c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c index b121feb4df..dc1546ef95 100644 --- a/c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c +++ b/c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c @@ -35,6 +35,7 @@ #include <rtems/score/isr.h> #include <rtems/score/threaddispatch.h> #include <rtems/score/sh.h> +#include <rtems/score/ispsh7032.h> #include <rtems/score/ispsh7032.h> #include <rtems/score/iosh7032.h> diff --git a/c/src/lib/libcpu/sh/sh7045/sci/sci.c b/c/src/lib/libcpu/sh/sh7045/sci/sci.c index f48fef18ec..e6c54e2aa1 100644 --- a/c/src/lib/libcpu/sh/sh7045/sci/sci.c +++ b/c/src/lib/libcpu/sh/sh7045/sci/sci.c @@ -8,7 +8,9 @@ * This approach is similar to installing a sym-link from one device to * another device. If rtems once will support sym-links for devices files, * this implementation could be dropped. - * + */ + +/* * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de) * * COPYRIGHT (c) 1997-1998, FAW Ulm, Germany @@ -75,11 +77,11 @@ /* #define SH_SCI_DEF_COMM_1 B9600 | CS8 */ struct scidev_t { - char * name; - uint32_t addr; - rtems_device_minor_number minor; - unsigned short opened; - tcflag_t cflags; + char * name; + uint32_t addr; + rtems_device_minor_number minor; + unsigned short opened; + tcflag_t cflags; } sci_device[SCI_MINOR_DEVICES] = { { "/dev/sci0", SH_SCI_BASE_0, 0, 0, SH_SCI_DEF_COMM_0 }, @@ -104,8 +106,8 @@ static int _sci_set_cflags( tcflag_t c_cflag ) { - uint8_t smr; - uint8_t brr; + uint8_t smr; + uint8_t brr; if ( c_cflag & CBAUD ) { @@ -148,7 +150,7 @@ static int _sci_set_cflags( * local functions operate SCI ports 0 and 1 * called from polling routines or ISRs */ -bool wrtSCI0(unsigned char ch) +static bool wrtSCI0(unsigned char ch) { uint8_t temp; bool result = false; @@ -164,7 +166,7 @@ bool wrtSCI0(unsigned char ch) return result; } /* wrtSCI0 */ -bool wrtSCI1(unsigned char ch) +static bool wrtSCI1(unsigned char ch) { uint8_t temp; bool result = false; @@ -181,27 +183,27 @@ bool wrtSCI1(unsigned char ch) } /* wrtSCI1 */ /* polled output steers byte to selected port */ -void sh_sci_outbyte_polled( +static void sh_sci_outbyte_polled( rtems_device_minor_number minor, char ch ) { - if (minor == 0) /* blocks until port ready */ - while (wrtSCI0(ch) != true); /* SCI0*/ - else - while (wrtSCI1(ch) != true); /* SCI1*/ + if (minor == 0) /* blocks until port ready */ + while (wrtSCI0(ch) != true); /* SCI0*/ + else + while (wrtSCI1(ch) != true); /* SCI1*/ } /* sh_sci_outbyte_polled */ /* * Initial version calls polled output driver and blocks */ -void outbyte( +static void outbyte( rtems_device_minor_number minor, char ch) { - sh_sci_outbyte_polled(minor, (unsigned char)ch); + sh_sci_outbyte_polled(minor, (unsigned char)ch); } /* outbyte */ -bool rdSCI0(unsigned char *ch) +static bool rdSCI0(unsigned char *ch) { uint8_t temp; bool result = false; @@ -225,7 +227,7 @@ bool rdSCI0(unsigned char *ch) return result; } /* rdSCI0 */ -bool rdSCI1(unsigned char *ch) +static bool rdSCI1(unsigned char *ch) { uint8_t temp; bool result = false; @@ -249,9 +251,8 @@ bool rdSCI1(unsigned char *ch) return result; } /* rdSCI1 */ - /* initial version pulls byte from selected port */ -char sh_sci_inbyte_polled( rtems_device_minor_number minor ) +static char sh_sci_inbyte_polled( rtems_device_minor_number minor ) { uint8_t ch = 0; @@ -263,7 +264,7 @@ char sh_sci_inbyte_polled( rtems_device_minor_number minor ) } /* sh_sci_inbyte_polled */ /* Initial version calls polled input driver */ -char inbyte( rtems_device_minor_number minor ) +static char inbyte( rtems_device_minor_number minor ) { char ch; @@ -271,7 +272,6 @@ char inbyte( rtems_device_minor_number minor ) return ch; } /* inbyte */ - /* sh_sci_initialize * * This routine initializes (registers) the sh_sci IO drivers. @@ -283,9 +283,7 @@ char inbyte( rtems_device_minor_number minor ) * Return values: RTEMS_SUCCESSFUL * if all sci[...] register, else calls * rtems_fatal_error_occurred(status) - * */ - rtems_device_driver sh_sci_initialize( rtems_device_major_number major, rtems_device_minor_number minor, @@ -295,7 +293,6 @@ rtems_device_driver sh_sci_initialize( rtems_device_minor_number i; rtems_driver_name_t driver; - /* * register all possible devices. * the initialization of the hardware is done by sci_open @@ -303,19 +300,17 @@ rtems_device_driver sh_sci_initialize( * One of devices could be previously registered by console * initialization therefore we check it everytime */ - - for ( i = 0 ; i < SCI_MINOR_DEVICES ; i++ ) - { + for ( i = 0 ; i < SCI_MINOR_DEVICES ; i++ ) { status = rtems_io_lookup_name( sci_device[i].name, &driver); - if ( status != RTEMS_SUCCESSFUL ) - { + if ( status != RTEMS_SUCCESSFUL ) { /* OK. We assume it is not registered yet. */ status = rtems_io_register_name( sci_device[i].name, major, - sci_device[i].minor ); + sci_device[i].minor + ); if (status != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred(status); } @@ -326,31 +321,27 @@ rtems_device_driver sh_sci_initialize( return RTEMS_SUCCESSFUL; } - /* * Open entry point * Sets up port and pins for selected sci. */ - rtems_device_driver sh_sci_open( rtems_device_major_number major, rtems_device_minor_number minor, void * arg ) { - uint8_t temp8; + uint8_t temp8; uint16_t temp16; - unsigned a; + unsigned a; /* check for valid minor number */ - if (( minor > ( SCI_MINOR_DEVICES -1 )) || ( minor < 0 )) - { - return RTEMS_INVALID_NUMBER; - } + if (( minor > ( SCI_MINOR_DEVICES -1 )) || ( minor < 0 )) { + return RTEMS_INVALID_NUMBER; + } /* device already opened */ - if ( sci_device[minor].opened > 0 ) - { + if ( sci_device[minor].opened > 0 ) { sci_device[minor].opened++; return RTEMS_SUCCESSFUL; } @@ -372,7 +363,7 @@ rtems_device_driver sh_sci_open( } /* add other devices and pins as req'd. */ /* set up SCI registers */ - write8(0x00, sci_device[minor].addr + SCI_SCR); /* Clear SCR */ + write8(0x00, sci_device[minor].addr + SCI_SCR); /* Clear SCR */ /* set SMR and BRR */ _sci_set_cflags( &sci_device[minor], sci_device[minor].cflags ); @@ -381,7 +372,7 @@ rtems_device_driver sh_sci_open( } write8((SCI_RE | SCI_TE), /* enable async. Tx and Rx */ - sci_device[minor].addr + SCI_SCR); + sci_device[minor].addr + SCI_SCR); /* clear error flags */ temp8 = read8(sci_device[minor].addr + SCI_SSR); @@ -409,7 +400,6 @@ rtems_device_driver sh_sci_open( /* * Close entry point */ - rtems_device_driver sh_sci_close( rtems_device_major_number major, rtems_device_minor_number minor, @@ -428,7 +418,6 @@ rtems_device_driver sh_sci_close( /* * read bytes from the serial port. We only have stdin. */ - rtems_device_driver sh_sci_read( rtems_device_major_number major, rtems_device_minor_number minor, @@ -460,7 +449,6 @@ rtems_device_driver sh_sci_read( /* * write bytes to the serial port. Stdout and stderr are the same. */ - rtems_device_driver sh_sci_write( rtems_device_major_number major, rtems_device_minor_number minor, @@ -491,7 +479,6 @@ rtems_device_driver sh_sci_write( /* * IO Control entry point */ - rtems_device_driver sh_sci_control( rtems_device_major_number major, rtems_device_minor_number minor, @@ -573,7 +560,7 @@ const rtems_termios_callbacks sci_interrupt_callbacks; const rtems_termios_callbacks* sh_sci_get_termios_handlers( bool poll ) { - return poll ? - &sci_poll_callbacks : - &sci_interrupt_callbacks; + return poll ? + &sci_poll_callbacks : + &sci_interrupt_callbacks; } diff --git a/c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c b/c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c index f2a32c91ae..db9040e409 100644 --- a/c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c +++ b/c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c @@ -1,6 +1,8 @@ /* * Termios console serial driver. - * + */ + +/* * Based on SCI driver by Ralf Corsepius and John M. Mills * * Author: Radzislaw Galler <rgaller@et.put.poznan.pl> @@ -124,7 +126,7 @@ int sh_sci_set_attributes( * * The same routine for all interrupt sources of the same type. */ -rtems_isr sh_sci_rx_isr(rtems_vector_number vector) +static rtems_isr sh_sci_rx_isr(rtems_vector_number vector) { int minor; @@ -151,7 +153,7 @@ rtems_isr sh_sci_rx_isr(rtems_vector_number vector) * * The same routine for all interrupt sources of the same type. */ -rtems_isr sh_sci_tx_isr(rtems_vector_number vector) +static rtems_isr sh_sci_tx_isr(rtems_vector_number vector) { int minor; diff --git a/c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c b/c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c index a4fefaece2..c64dac5b73 100644 --- a/c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c +++ b/c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c @@ -77,7 +77,7 @@ sh4uart_init(sh4uart *uart, void *tty, int chn, int int_driven) * RETURNS: * peripheral module clock in Hz. */ -uint32_t +static uint32_t sh4uart_get_Pph(void) { uint16_t frqcr = *(volatile uint16_t*)SH7750_FRQCR; @@ -418,7 +418,7 @@ sh4uart_set_attributes(sh4uart *uart, const struct termios *t) * RETURNS: * nothing */ -void +static void sh4uart_handle_error(sh4uart *uart) { if (uart->chn == SH4_SCI) { @@ -451,7 +451,6 @@ int sh4uart_poll_read(sh4uart *uart) { int chn = uart->chn; - int error_occured = 0; int parity_error = 0; int break_occured = 0; int ch; @@ -464,7 +463,6 @@ sh4uart_poll_read(sh4uart *uart) if (chn == SH4_SCI) { if ((SCSSR1 & (SH7750_SCSSR1_PER | SH7750_SCSSR1_FER | SH7750_SCSSR1_ORER)) != 0) { - error_occured = 1; if (SCSSR1 & (SH7750_SCSSR1_PER | SH7750_SCSSR1_FER)) parity_error = 1; sh4uart_handle_error(uart); @@ -475,7 +473,6 @@ sh4uart_poll_read(sh4uart *uart) if ((SCSSR2 & (SH7750_SCSSR2_ER | SH7750_SCSSR2_DR | SH7750_SCSSR2_BRK)) != 0 || (SCLSR2 & SH7750_SCLSR2_ORER) != 0) { - error_occured = 1; if (SCSSR2 & (SH7750_SCSSR1_PER | SH7750_SCSSR1_FER)) parity_error = 1; if (SCSSR2 & SH7750_SCSSR2_BRK) diff --git a/c/src/lib/libcpu/sh/shgdb/score/cpu_asm.c b/c/src/lib/libcpu/sh/shgdb/score/cpu_asm.c index 91c1a31447..823f538852 100644 --- a/c/src/lib/libcpu/sh/shgdb/score/cpu_asm.c +++ b/c/src/lib/libcpu/sh/shgdb/score/cpu_asm.c @@ -1,6 +1,8 @@ /* * Support for SuperH Simulator in GDB - * + */ + +/* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * @@ -22,10 +24,11 @@ register unsigned long *stack_ptr __asm__ ("r15"); +void __ISR_Handler(uint32_t vector); + /* * This routine provides the RTEMS interrupt management. */ - void __ISR_Handler( uint32_t vector) { ISR_Level level; |