m68k/mvme162: Fix warnings

This commit is contained in:
Joel Sherrill
2014-10-15 17:17:08 -05:00
parent 2674e84c21
commit c186f2ed9e
9 changed files with 855 additions and 884 deletions

View File

@@ -5,7 +5,9 @@
*
* To run with interrupt-driven I/O, ensure m360_smc1_interrupt
* is set before calling the initialization routine.
*
*/
/*
* Author:
* W. Eric Norum
* Saskatchewan Accelerator Laboratory
@@ -197,9 +199,8 @@ smc1Initialize (int major, int minor, void *arg)
if (m360_smc1_interrupt) {
rtems_isr_entry old_handler;
rtems_status_code sc;
sc = rtems_interrupt_catch (smc1InterruptHandler,
(void) rtems_interrupt_catch (smc1InterruptHandler,
(m360.cicr & 0xE0) | 0x04,
&old_handler);
m360.smc1.smcm = 3; /* Enable SMC1 TX and RX interrupts */

View File

@@ -152,8 +152,11 @@ void _Init68360 (void)
M360_MEMC_BR_V;
for (i = 0; i < 50000; i++)
continue;
for (i = 0; i < 8; ++i)
*RamBase_p;
for (i = 0; i < 8; ++i) {
unsigned long rambase_value;
rambase_value = *RamBase_p;
(void) rambase_value; /* avoid set but not used warning */
}
/*
* Step 13: Copy the exception vector table to system RAM

View File

@@ -1038,7 +1038,6 @@ rtems_device_driver SciRead (
{
rtems_libio_rw_args_t *rw_args; /* ptr to argument struct */
char *buffer;
uint16_t length;
rw_args = (rtems_libio_rw_args_t *) arg; /* arguments to read() */
@@ -1054,8 +1053,6 @@ rtems_device_driver SciRead (
buffer = rw_args->buffer; /* points to user's buffer */
length = rw_args->count; /* how many bytes they want */
/* *buffer = SciReadCharWait(); wait for a character */
/* if there isn't a character available, wait until one shows up */
@@ -1147,7 +1144,6 @@ rtems_device_driver SciControl (
{
rtems_libio_ioctl_args_t *args = arg; /* rtems arg struct */
uint16_t command; /* the cmd to execute */
uint16_t unused; /* maybe later */
uint16_t *ptr; /* ptr to user data */
/*printk("%s major=%d minor=%d\r\n", __FUNCTION__,major,minor); */

View File

@@ -1,7 +1,9 @@
/*
* This file contains the MVME162 console IO package.
*
* COPYRIGHT (c) 1989-1999.
*/
/*
* COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -24,19 +26,10 @@
Ring_buffer_t Console_Buffer[2];
static bool Console_Is_Initialized = false;
/* Printk function */
static void _162Bug_output_char( char c );
static void _BSP_output_char( char c );
BSP_output_char_function_type BSP_output_char = _BSP_output_char;
/*
* Interrupt handler for receiver interrupts
*/
rtems_isr C_Receive_ISR(rtems_vector_number vector)
static rtems_isr C_Receive_ISR(rtems_vector_number vector)
{
register int ipend, port;
@@ -55,44 +48,6 @@ rtems_isr C_Receive_ISR(rtems_vector_number vector)
}
}
/*
* _162Bug_output_char
*
* Output a single character using the 162Bug functions. The character
* will be written to the default output port.
*/
void _162Bug_output_char( char c )
{
asm volatile( "moveb %0, -(%%sp)\n\t" /* char to output */
"trap #15\n\t" /* Trap to 162Bug */
".short 0x20" /* Code for .OUTCHR */
:: "d" (c) );
}
/*
* _BSP_output_char
*
* printk() function prototyped in bspIo.h. Does not use termios.
*
* If we have initialized the console device then use it, otherwise
* use the 162Bug routines to send it to the default output port.
*/
void _BSP_output_char(char c)
{
if (Console_Is_Initialized)
putchar(c);
else
_162Bug_output_char(c);
if ('\n' == c)
_BSP_output_char('\r');
}
rtems_device_driver console_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor,
@@ -105,7 +60,6 @@ rtems_device_driver console_initialize(
/*
* Initialise receiver interrupts on both ports
*/
for (i = 0; i <= 1; i++) {
Ring_buffer_Initialize( &Console_Buffer[i] );
ZWRITE(i, 2, SCC_VECTOR);
@@ -153,7 +107,6 @@ rtems_device_driver console_initialize(
/*
* Non-blocking char input
*/
bool char_ready(int port, char *ch)
{
if ( Ring_buffer_Is_empty( &Console_Buffer[port] ) )
@@ -167,8 +120,7 @@ bool char_ready(int port, char *ch)
/*
* Block on char input
*/
char inbyte(int port)
static char inbyte(int port)
{
char tmp_char;
@@ -180,8 +132,7 @@ char inbyte(int port)
* This routine transmits a character out the SCC. It no longer supports
* XON/XOFF flow control.
*/
void outbyte(char ch, int port)
static void outbyte(char ch, int port)
{
while (1) {
if (ZREAD0(port) & TX_BUFFER_EMPTY) break;
@@ -192,7 +143,6 @@ void outbyte(char ch, int port)
/*
* Open entry point
*/
rtems_device_driver console_open(
rtems_device_major_number major,
rtems_device_minor_number minor,
@@ -205,7 +155,6 @@ rtems_device_driver console_open(
/*
* Close entry point
*/
rtems_device_driver console_close(
rtems_device_major_number major,
rtems_device_minor_number minor,
@@ -218,7 +167,6 @@ rtems_device_driver console_close(
/*
* read bytes from the serial port. We only have stdin.
*/
rtems_device_driver console_read(
rtems_device_major_number major,
rtems_device_minor_number minor,
@@ -253,7 +201,6 @@ rtems_device_driver console_read(
/*
* write bytes to the serial port. Stdout and stderr are the same.
*/
rtems_device_driver console_write(
rtems_device_major_number major,
rtems_device_minor_number minor,
@@ -287,7 +234,6 @@ rtems_device_driver console_write(
/*
* IO Control entry point
*/
rtems_device_driver console_control(
rtems_device_major_number major,
rtems_device_minor_number minor,
@@ -296,3 +242,33 @@ rtems_device_driver console_control(
{
return RTEMS_SUCCESSFUL;
}
/*
* _162Bug_output_char
*
* Output a single character using the 162Bug functions. The character
* will be written to the default output port.
*/
static void _162Bug_output_char( char c )
{
asm volatile( "moveb %0, -(%%sp)\n\t" /* char to output */
"trap #15\n\t" /* Trap to 162Bug */
".short 0x20" /* Code for .OUTCHR */
:: "d" (c) );
}
/*
* _BSP_output_char
*
* printk() function prototyped in bspIo.h. Does not use termios.
*
* If we have initialized the console device then use it, otherwise
* use the 162Bug routines to send it to the default output port.
*/
static void _BSP_output_char(char c)
{
_162Bug_output_char(c);
}
/* Printk function */
BSP_output_char_function_type BSP_output_char = _BSP_output_char;

View File

@@ -1,8 +1,9 @@
/* bsp.h
*
/*
* This include file contains all MVME162fx board IO definitions.
*
* COPYRIGHT (c) 1989-1999.
*/
/*
* COPYRIGHT (c) 1989-2014.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -162,7 +163,6 @@ typedef volatile struct {
#define EXTERN extern
#endif
/*
* This value is the default address location of the 162Bug vector table
* and is also the default start address of the boards DRAM. This value
@@ -194,6 +194,12 @@ rtems_isr_entry set_vector(
int type
);
/*
* Prototypes for methods in the BSP that cross file boundaries.
*/
bool char_ready(int port, char *ch);
#ifdef __cplusplus
}
#endif

View File

@@ -1,7 +1,9 @@
/*
* This routine returns control to 162Bug.
*
* COPYRIGHT (c) 1989-2010.
*/
/*
* COPYRIGHT (c) 1989-2014.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -21,9 +23,9 @@
#include <rtems/zilog/z8036.h>
#include <page_table.h>
extern void start( void );
void bsp_return_to_monitor_trap(void)
static rtems_isr bsp_return_to_monitor_trap(
rtems_vector_number vector
)
{
page_table_teardown();
@@ -32,18 +34,6 @@ void bsp_return_to_monitor_trap(void)
__asm__ volatile( "trap #15" ); /* trap to 162Bug */
__asm__ volatile( ".short 0x63" ); /* return to 162Bug (.RETURN) */
/* restart program */
/*
* This does not work on the 162....
*/
#if 0
{ register volatile void *start_addr;
start_addr = start;
__asm__ volatile ( "jmp %0@" : "=a" (start_addr) : "0" (start_addr) );
}
#endif
}
void bsp_fatal_extension(
@@ -53,5 +43,5 @@ void bsp_fatal_extension(
)
{
M68Kvec[ 45 ] = bsp_return_to_monitor_trap; /* install handler */
__asm__ volatile( "trap #13" ); /* insures SUPV mode */
__asm__ volatile( "trap #13" ); /* ensures SUPV mode */
}

View File

@@ -27,7 +27,7 @@
uint32_t Ttimer_val;
bool benchmark_timer_find_average_overhead;
rtems_isr timerisr(void);
rtems_isr timerisr(rtems_vector_number vector);
void benchmark_timer_initialize(void)
{

View File

@@ -229,9 +229,8 @@ rtems_isr_entry Prev_modem_isr; /* Previous modem/timer isr */
)
{
unsigned long i = 20000; /* In case clock is off */
rtems_interval ticks_per_second, start_ticks, end_ticks, current_ticks;
rtems_interval start_ticks, end_ticks, current_ticks;
ticks_per_second = rtems_clock_get_ticks_per_second();
start_ticks = rtems_clock_get_ticks_since_boot();
end_ticks = start_ticks + delay;

View File

@@ -31,9 +31,11 @@ rtems_isr bsp_spurious_handler(
CPU_Interrupt_frame *isf */
)
{
#if 0
printk( "Unexpected interrupt (0x%x)\n", vector );
#else
char *s;
printk( "Unexpected interrupt (0x%x)\n", vector );
/*
printk( "It looks like we got the interrupt at 0x%x\n", isf->interrupted );
*/
@@ -41,9 +43,7 @@ rtems_isr bsp_spurious_handler(
/*
* Can we print a name?
*/
s = 0;
#if 0
if ( vector <= 0x1f ) {
switch ( vector ) {
case 1: s = "INT0"; break;