forked from Imagelibrary/rtems
libcpu/powerpc/ppc403: Fix warnings
This commit is contained in:
@@ -228,7 +228,7 @@ static void ClockOn(const rtems_irq_connect_data* unused)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Install_clock(void (*clock_isr)(void *))
|
static void Install_clock(void (*clock_isr)(void *))
|
||||||
{
|
{
|
||||||
rtems_irq_connect_data clockIrqConnData;
|
rtems_irq_connect_data clockIrqConnData;
|
||||||
|
|
||||||
@@ -254,35 +254,6 @@ void Install_clock(void (*clock_isr)(void *))
|
|||||||
atexit(Clock_exit);
|
atexit(Clock_exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReInstall_clock(void (*new_clock_isr)(void *))
|
|
||||||
{
|
|
||||||
uint32_t isrlevel = 0;
|
|
||||||
rtems_irq_connect_data clockIrqConnData;
|
|
||||||
|
|
||||||
rtems_interrupt_disable(isrlevel);
|
|
||||||
|
|
||||||
clockIrqConnData.name = BSP_PIT;
|
|
||||||
if (!BSP_get_current_rtems_irq_handler(&clockIrqConnData)) {
|
|
||||||
printk("Unable to stop system clock\n");
|
|
||||||
rtems_fatal_error_occurred(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
BSP_remove_rtems_irq_handler (&clockIrqConnData);
|
|
||||||
|
|
||||||
clockIrqConnData.on = ClockOn;
|
|
||||||
clockIrqConnData.off = ClockOff;
|
|
||||||
clockIrqConnData.isOn = ClockIsOn;
|
|
||||||
clockIrqConnData.name = BSP_PIT;
|
|
||||||
clockIrqConnData.hdl = new_clock_isr;
|
|
||||||
|
|
||||||
if (!BSP_install_rtems_irq_handler (&clockIrqConnData)) {
|
|
||||||
printk("Unable to connect Clock Irq handler\n");
|
|
||||||
rtems_fatal_error_occurred(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
rtems_interrupt_enable(isrlevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called via atexit()
|
* Called via atexit()
|
||||||
* Remove the clock interrupt handler by setting handler to NULL
|
* Remove the clock interrupt handler by setting handler to NULL
|
||||||
|
|||||||
@@ -56,8 +56,7 @@
|
|||||||
#include <rtems/libio.h>
|
#include <rtems/libio.h>
|
||||||
#include "../irq/ictrl.h"
|
#include "../irq/ictrl.h"
|
||||||
#include <stdlib.h> /* for atexit() */
|
#include <stdlib.h> /* for atexit() */
|
||||||
|
#include <rtems/console.h>
|
||||||
|
|
||||||
|
|
||||||
struct async {
|
struct async {
|
||||||
/*---------------------------------------------------------------------------+
|
/*---------------------------------------------------------------------------+
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include <rtems/libio.h>
|
#include <rtems/libio.h>
|
||||||
#include "../irq/ictrl.h"
|
#include "../irq/ictrl.h"
|
||||||
#include <stdlib.h> /* for atexit() */
|
#include <stdlib.h> /* for atexit() */
|
||||||
|
#include <tty_drv.h>
|
||||||
|
|
||||||
extern uint32_t bsp_serial_per_sec;
|
extern uint32_t bsp_serial_per_sec;
|
||||||
extern bool bsp_serial_external_clock;
|
extern bool bsp_serial_external_clock;
|
||||||
@@ -149,13 +150,14 @@ static const tty0pasync tty0port = (tty0pasync)(0xEF600300 + (TTY0_USE_UART*0x
|
|||||||
static void *tty0ttyp; /* handle for termios */
|
static void *tty0ttyp; /* handle for termios */
|
||||||
|
|
||||||
|
|
||||||
int tty0_round(double x)
|
static int
|
||||||
|
tty0_round(double x)
|
||||||
{
|
{
|
||||||
return (int)((int)((x-(int)x)*1000)>500 ? x+1 : x);
|
return (int)((int)((x-(int)x)*1000)>500 ? x+1 : x);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
tty0BaudSet(uint32_t baudrate)
|
tty0BaudSet(uint32_t baudrate)
|
||||||
{
|
{
|
||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
|
|
||||||
@@ -168,6 +170,7 @@ tty0BaudSet(uint32_t baudrate)
|
|||||||
|
|
||||||
tty0port->LCR = tty0port->LCR & ~LCR_DL;
|
tty0port->LCR = tty0port->LCR & ~LCR_DL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Hardware-dependent portion of tcsetattr().
|
* Hardware-dependent portion of tcsetattr().
|
||||||
*/
|
*/
|
||||||
@@ -176,7 +179,7 @@ tty0SetAttributes (int minor, const struct termios *t)
|
|||||||
{
|
{
|
||||||
int baud;
|
int baud;
|
||||||
|
|
||||||
/* FIXME: check c_cflag & CRTSCTS for hardware flowcontrol */
|
/* FIXME: check c_cflag & CRTSCTS for hardware flow control */
|
||||||
/* FIXME: check and IMPLEMENT XON/XOFF */
|
/* FIXME: check and IMPLEMENT XON/XOFF */
|
||||||
switch (t->c_cflag & CBAUD) {
|
switch (t->c_cflag & CBAUD) {
|
||||||
default: baud = -1; break;
|
default: baud = -1; break;
|
||||||
@@ -323,8 +326,7 @@ static rtems_isr tty0serial_ISR(rtems_vector_number v)
|
|||||||
* deinit TTY0
|
* deinit TTY0
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
static void tty0DeInit(void)
|
||||||
tty0DeInit(void)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* disable interrupts for serial tty0port
|
* disable interrupts for serial tty0port
|
||||||
@@ -343,7 +345,7 @@ tty0DeInit(void)
|
|||||||
* init SPI
|
* init SPI
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
rtems_status_code
|
static rtems_status_code
|
||||||
tty0Initialize(void)
|
tty0Initialize(void)
|
||||||
{
|
{
|
||||||
register unsigned tmp;
|
register unsigned tmp;
|
||||||
@@ -370,6 +372,7 @@ tty0Initialize(void)
|
|||||||
|
|
||||||
/* Disable tty0port interrupts while changing hardware */
|
/* Disable tty0port interrupts while changing hardware */
|
||||||
_ier = tty0port->IER;
|
_ier = tty0port->IER;
|
||||||
|
(void) _ier; /* avoid set but not used warning */
|
||||||
tty0port->IER = 0;
|
tty0port->IER = 0;
|
||||||
|
|
||||||
/* set up tty0port control: 8 bit,1 stop,no parity */
|
/* set up tty0port control: 8 bit,1 stop,no parity */
|
||||||
@@ -395,6 +398,7 @@ tty0Initialize(void)
|
|||||||
_tmp = tty0port->LSR;
|
_tmp = tty0port->LSR;
|
||||||
_tmp = tty0port->RBR;
|
_tmp = tty0port->RBR;
|
||||||
_tmp = tty0port->MSR;
|
_tmp = tty0port->MSR;
|
||||||
|
(void) _tmp; /* avoid set but not used warning */
|
||||||
|
|
||||||
/* Enable recive interrupts, don't enable TxInt yet */
|
/* Enable recive interrupts, don't enable TxInt yet */
|
||||||
tty0port->IER=IER_RCV;
|
tty0port->IER=IER_RCV;
|
||||||
|
|||||||
Reference in New Issue
Block a user