interrupt handler type change

This commit is contained in:
Thomas Doerfler
2009-10-21 13:24:35 +00:00
parent 2067679bb3
commit 60e5832e23
32 changed files with 159 additions and 247 deletions

View File

@@ -1,3 +1,7 @@
2009-10-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libchip/serial/ns16550.c: Update for interrupt handler type change.
2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org>
* aclocal/bsp-alias.m4: New. * aclocal/bsp-alias.m4: New.

View File

@@ -1,3 +1,8 @@
2009-10-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* i2c/i2c.c, misc/dma-copy.c, network/network.c, ssp/ssp.c: Update for
interrupt handler type change.
2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org>
* make/custom/lpc24xx.inc: Remove RTEMS_BSP_FAMILY. * make/custom/lpc24xx.inc: Remove RTEMS_BSP_FAMILY.

View File

@@ -44,7 +44,7 @@ typedef struct {
uint8_t * volatile end; uint8_t * volatile end;
} lpc24xx_i2c_bus_entry; } lpc24xx_i2c_bus_entry;
static void lpc24xx_i2c_handler( rtems_vector_number vector, void *arg) static void lpc24xx_i2c_handler( void *arg)
{ {
lpc24xx_i2c_bus_entry *e = arg; lpc24xx_i2c_bus_entry *e = arg;
volatile lpc24xx_i2c *regs = e->regs; volatile lpc24xx_i2c *regs = e->regs;

View File

@@ -27,7 +27,7 @@ static rtems_id lpc24xx_dma_sema_table [GPDMA_CH_NUMBER];
static bool lpc24xx_dma_status_table [GPDMA_CH_NUMBER]; static bool lpc24xx_dma_status_table [GPDMA_CH_NUMBER];
static void lpc24xx_dma_copy_handler(rtems_vector_number vector, void *arg) static void lpc24xx_dma_copy_handler(void *arg)
{ {
/* Get interrupt status */ /* Get interrupt status */
uint32_t tc = GPDMA_INT_TCSTAT; uint32_t tc = GPDMA_INT_TCSTAT;

View File

@@ -252,10 +252,7 @@ static void lpc24xx_eth_enable_promiscous_mode(bool enable)
} }
} }
static void lpc24xx_eth_interrupt_handler( static void lpc24xx_eth_interrupt_handler(void *arg)
rtems_vector_number vector,
void *arg
)
{ {
lpc24xx_eth_driver_entry *e = (lpc24xx_eth_driver_entry *) arg; lpc24xx_eth_driver_entry *e = (lpc24xx_eth_driver_entry *) arg;
rtems_event_set re = 0; rtems_event_set re = 0;

View File

@@ -80,7 +80,7 @@ static inline bool lpc24xx_ssp_is_busy(const lpc24xx_ssp_bus_entry *bus)
&& lpc24xx_ssp_dma_data.status != LPC24XX_SSP_DMA_AVAILABLE; && lpc24xx_ssp_dma_data.status != LPC24XX_SSP_DMA_AVAILABLE;
} }
static void lpc24xx_ssp_handler(rtems_vector_number vector, void *arg) static void lpc24xx_ssp_handler(void *arg)
{ {
lpc24xx_ssp_bus_entry *e = (lpc24xx_ssp_bus_entry *) arg; lpc24xx_ssp_bus_entry *e = (lpc24xx_ssp_bus_entry *) arg;
volatile lpc24xx_ssp *regs = e->regs; volatile lpc24xx_ssp *regs = e->regs;
@@ -96,7 +96,7 @@ static void lpc24xx_ssp_handler(rtems_vector_number vector, void *arg)
regs->icr = icr; regs->icr = icr;
} }
static void lpc24xx_ssp_dma_handler(rtems_vector_number vector, void *arg) static void lpc24xx_ssp_dma_handler(void *arg)
{ {
lpc24xx_ssp_dma_entry *e = (lpc24xx_ssp_dma_entry *) arg; lpc24xx_ssp_dma_entry *e = (lpc24xx_ssp_dma_entry *) arg;
lpc24xx_ssp_dma_status status = e->status; lpc24xx_ssp_dma_status status = e->status;

View File

@@ -1,3 +1,7 @@
2009-10-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* clock/clock.c: Update for interrupt handler type change.
2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org>
* make/custom/gen5200.inc: Remove RTEMS_BSP_FAMILY. * make/custom/gen5200.inc: Remove RTEMS_BSP_FAMILY.

View File

@@ -123,7 +123,7 @@ volatile int ClockInitialized = 0;
/* /*
* ISR Handlers * ISR Handlers
*/ */
void mpc5200_gpt_clock_isr(rtems_vector_number vector, void *handle) void mpc5200_gpt_clock_isr(void *handle)
{ {
uint32_t status; uint32_t status;
struct mpc5200_gpt *gpt = (struct mpc5200_gpt *)handle; struct mpc5200_gpt *gpt = (struct mpc5200_gpt *)handle;

View File

@@ -1,3 +1,8 @@
2009-10-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* network/smsc9218i.c, tests/tests.c: Update for interrupt handler
type change.
2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org>
* make/custom/mpc55xx.cfg: Remove RTEMS_BSP_FAMILY. * make/custom/mpc55xx.cfg: Remove RTEMS_BSP_FAMILY.

View File

@@ -1,19 +0,0 @@
/**
* @file
*
* @ingroup mpc55xx
*
* @brief Empty file.
*/
/*
* Copyright (c) 2008
* Embedded Brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
* Germany
* rtems@embedded-brains.de
*
* The license and distribution terms for this file may be found in the file
* LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
*/

View File

@@ -403,10 +403,7 @@ static void smsc9218i_register_dump(volatile smsc9218i_registers *regs)
printf("phy: physcsr: 0x%08" PRIx32 "\n", smsc9218i_phy_read(regs, SMSC9218I_PHY_PHYSCSR)); printf("phy: physcsr: 0x%08" PRIx32 "\n", smsc9218i_phy_read(regs, SMSC9218I_PHY_PHYSCSR));
} }
static void smsc9218i_interrupt_handler( static void smsc9218i_interrupt_handler(void *arg)
rtems_vector_number vector,
void *arg
)
{ {
smsc9218i_driver_entry *e = (smsc9218i_driver_entry *) arg; smsc9218i_driver_entry *e = (smsc9218i_driver_entry *) arg;
volatile smsc9218i_registers *const regs = smsc9218i; volatile smsc9218i_registers *const regs = smsc9218i;

View File

@@ -637,7 +637,7 @@ static inline void test_mpc55xx_intc_worker( void *data)
printk( "(%i): Done\n", i); printk( "(%i): Done\n", i);
} }
static void test_mpc55xx_intc_handler( rtems_vector_number vector, void *data) static void test_mpc55xx_intc_handler( void *data)
{ {
test_mpc55xx_intc_worker( data); test_mpc55xx_intc_worker( data);
} }

View File

@@ -1,3 +1,7 @@
2009-10-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* clock/p_clock.c: Update for interrupt handler type change.
2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org>
* make/custom/tqm8xx.inc: Remove RTEMS_BSP_FAMILY. * make/custom/tqm8xx.inc: Remove RTEMS_BSP_FAMILY.

View File

@@ -23,6 +23,7 @@ include_HEADERS += include/coverhd.h
include_bsp_HEADERS = include/tqm.h include/8xx_immap.h \ include_bsp_HEADERS = include/tqm.h include/8xx_immap.h \
include/irq.h include/irq-config.h \ include/irq.h include/irq-config.h \
../../shared/include/irq-generic.h\ ../../shared/include/irq-generic.h\
spi/spi.h\
../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/vectors.h \ ../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/vectors.h \
../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/ppc_exc_bspsupp.h ../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/ppc_exc_bspsupp.h
@@ -53,6 +54,8 @@ libbsp_a_SOURCES += clock/p_clock.c
# console # console
libbsp_a_SOURCES += console/console.c libbsp_a_SOURCES += console/console.c
# spi
libbsp_a_SOURCES += spi/spi.c
# timer # timer
libbsp_a_SOURCES += timer/timer.c libbsp_a_SOURCES += timer/timer.c
# startup # startup

View File

@@ -22,8 +22,7 @@ extern void clockOff (void*);
extern int clockIsOn(void*); extern int clockIsOn(void*);
extern void Clock_isr(void*); extern void Clock_isr(void*);
void BSP_clock_hdl(rtems_vector_number vecnum, void BSP_clock_hdl(void * arg)
void * arg)
{ {
Clock_isr(arg); Clock_isr(arg);
} }

View File

@@ -54,31 +54,20 @@
#include <stdlib.h> #include <stdlib.h>
#include <bsp.h> #include <bsp.h>
#include <mpc8xx.h> #include <mpc8xx.h>
#include <rtems/irq.h>
#include <bsp/irq.h>
#include <rtems/libio.h> #include <rtems/libio.h>
#include <termios.h> #include <termios.h>
#include <unistd.h> #include <unistd.h>
#include <rtems/termiostypes.h> #include <rtems/termiostypes.h>
#include <rtems/bspIo.h> #include <rtems/bspIo.h>
/*
* Declare clock speed -- may be overwritten by downloader or debugger
*/
int m8xx_clock_rate = 0;
/* /*
* Interrupt-driven input buffer * Interrupt-driven input buffer
*/ */
#define RXBUFSIZE 256 #define RXBUFSIZE 256
#define M8xx_IVEC_SRC_MASK (0x1f)
#define M8xx_IVEC_SRC_SCC1 (0x1E)
#define M8xx_IVEC_SRC_SCC2 (0x1D)
#define M8xx_IVEC_SRC_SCC3 (0x1C)
#define M8xx_IVEC_SRC_SCC4 (0x1B)
#define M8xx_IVEC_SRC_SMC1 (0x04)
#define M8xx_IVEC_SRC_SMC2 (0x03)
#define M8xx_IREG_MASK(src) (1UL << src)
#define M8xx_SICR_BRG1 (0) #define M8xx_SICR_BRG1 (0)
#define M8xx_SICR_BRG2 (1) #define M8xx_SICR_BRG2 (1)
#define M8xx_SICR_BRG3 (2) #define M8xx_SICR_BRG3 (2)
@@ -132,9 +121,8 @@ typedef struct m8xx_console_chan_desc_s {
volatile m8xxSMCRegisters_t *smcr; volatile m8xxSMCRegisters_t *smcr;
} regs; } regs;
int ivec_src; int ivec_src;
uint32_t ireg_mask; int cr_chan_code;
int cr_chan_code; int brg_used;
int brg_used;
} m8xx_console_chan_desc_t; } m8xx_console_chan_desc_t;
m8xx_console_chan_desc_t m8xx_console_chan_desc[CONS_CHN_CNT] = { m8xx_console_chan_desc_t m8xx_console_chan_desc[CONS_CHN_CNT] = {
@@ -142,48 +130,42 @@ m8xx_console_chan_desc_t m8xx_console_chan_desc[CONS_CHN_CNT] = {
{TRUE, {TRUE,
{(m8xxSCCparms_t *)&(m8xx.scc1p),NULL}, {(m8xxSCCparms_t *)&(m8xx.scc1p),NULL},
{&(m8xx.scc1),NULL}, {&(m8xx.scc1),NULL},
M8xx_IVEC_SRC_SCC1, BSP_CPM_IRQ_SCC1,
M8xx_IREG_MASK(M8xx_IVEC_SRC_SCC1),
M8xx_CR_CHAN_SCC1, M8xx_CR_CHAN_SCC1,
-1}, -1},
/* SCC2 */ /* SCC2 */
{TRUE, {TRUE,
{&(m8xx.scc2p),NULL}, {&(m8xx.scc2p),NULL},
{&(m8xx.scc2),NULL}, {&(m8xx.scc2),NULL},
M8xx_IVEC_SRC_SCC2, BSP_CPM_IRQ_SCC2,
M8xx_IREG_MASK(M8xx_IVEC_SRC_SCC2),
M8xx_CR_CHAN_SCC2, M8xx_CR_CHAN_SCC2,
-1}, -1},
/* SCC3 */ /* SCC3 */
{TRUE, {TRUE,
{&(m8xx.scc3p),NULL}, {&(m8xx.scc3p),NULL},
{&(m8xx.scc3),NULL}, {&(m8xx.scc3),NULL},
M8xx_IVEC_SRC_SCC3, BSP_CPM_IRQ_SCC3,
M8xx_IREG_MASK(M8xx_IVEC_SRC_SCC3),
M8xx_CR_CHAN_SCC3, M8xx_CR_CHAN_SCC3,
-1}, -1},
/* SCC4 */ /* SCC4 */
{TRUE, {TRUE,
{&(m8xx.scc4p),NULL}, {&(m8xx.scc4p),NULL},
{&(m8xx.scc4),NULL}, {&(m8xx.scc4),NULL},
M8xx_IVEC_SRC_SCC4, BSP_CPM_IRQ_SCC4,
M8xx_IREG_MASK(M8xx_IVEC_SRC_SCC4),
M8xx_CR_CHAN_SCC4, M8xx_CR_CHAN_SCC4,
-1}, -1},
/* SMC1 */ /* SMC1 */
{FALSE, {FALSE,
{NULL,&(m8xx.smc1p)}, {NULL,&(m8xx.smc1p)},
{NULL,&(m8xx.smc1)}, {NULL,&(m8xx.smc1)},
M8xx_IVEC_SRC_SMC1, BSP_CPM_IRQ_SMC1,
M8xx_IREG_MASK(M8xx_IVEC_SRC_SMC1),
M8xx_CR_CHAN_SMC1, M8xx_CR_CHAN_SMC1,
-1}, -1},
/* SMC2 */ /* SMC2 */
{FALSE, {FALSE,
{NULL,&(m8xx.smc2p)}, {NULL,&(m8xx.smc2p)},
{NULL,&(m8xx.smc2)}, {NULL,&(m8xx.smc2)},
M8xx_IVEC_SRC_SMC2, BSP_CPM_IRQ_SMC2_OR_PIP,
M8xx_IREG_MASK(M8xx_IVEC_SRC_SMC2),
M8xx_CR_CHAN_SMC2, M8xx_CR_CHAN_SMC2,
-1}}; -1}};
@@ -249,7 +231,7 @@ sccBRGval (int baud)
int divisor; int divisor;
int div16 = 0; int div16 = 0;
divisor = ((m8xx_clock_rate / 16) + (baud / 2)) / baud; divisor = ((BSP_bus_frequency / 16) + (baud / 2)) / baud;
if (divisor > 4096) { if (divisor > 4096) {
div16 = 1; div16 = 1;
divisor = (divisor + 8) / 16; divisor = (divisor + 8) / 16;
@@ -283,6 +265,7 @@ static void sccBRGinit(void)
#endif #endif
} }
#if CONS_USE_EXT_CLK
/* /*
* input clock frq for CPM clock inputs * input clock frq for CPM clock inputs
*/ */
@@ -295,6 +278,7 @@ static uint32_t clkin_frq[2][4] = {
{1843000,0,0,0} {1843000,0,0,0}
#endif #endif
}; };
#endif
/* /*
* allocate, set and connect baud rate generators * allocate, set and connect baud rate generators
@@ -310,7 +294,7 @@ static int sccBRGalloc(int chan,int baud)
int old_brg; int old_brg;
int new_brg = -1; int new_brg = -1;
int brg_idx; int brg_idx;
#if 0 /* we do not support external clocked console */ #if CONS_USE_EXT_CLK
int clk_group; int clk_group;
int clk_sel; int clk_sel;
#endif #endif
@@ -319,7 +303,7 @@ static int sccBRGalloc(int chan,int baud)
/* compute brg register contents needed */ /* compute brg register contents needed */
reg_val = sccBRGval(baud); reg_val = sccBRGval(baud);
#if 0 /* we do not support external clocked console */ #if CONS_EXT_CLK
/* search for clock input with this frq */ /* search for clock input with this frq */
clk_group = ((chan == CONS_CHN_SCC3) || clk_group = ((chan == CONS_CHN_SCC3) ||
(chan == CONS_CHN_SCC4) || (chan == CONS_CHN_SCC4) ||
@@ -438,32 +422,9 @@ sccSetAttributes (int minor, const struct termios *t)
* Interrupt handler * Interrupt handler
*/ */
static rtems_isr static rtems_isr
sccInterruptHandler (rtems_vector_number v) sccInterruptHandler (void *arg)
{ {
int chan = 0; int chan = (int)arg;
/*
* calculate channel from vector
*/
switch(v & M8xx_IVEC_SRC_MASK) {
case M8xx_IVEC_SRC_SCC1:
chan = CONS_CHN_SCC1;
break;
case M8xx_IVEC_SRC_SCC2:
chan = CONS_CHN_SCC2;
break;
case M8xx_IVEC_SRC_SCC3:
chan = CONS_CHN_SCC3;
break;
case M8xx_IVEC_SRC_SCC4:
chan = CONS_CHN_SCC4;
break;
case M8xx_IVEC_SRC_SMC1:
chan = CONS_CHN_SMC1;
break;
case M8xx_IVEC_SRC_SMC2:
chan = CONS_CHN_SMC2;
break;
}
/* /*
* Buffer received? * Buffer received?
@@ -533,8 +494,24 @@ sccInterruptHandler (rtems_vector_number v)
} }
} }
} }
}
m8xx.cisr = m8xx_console_chan_desc[chan].ireg_mask;/* Clear interrupt-in-service bit */ static void
mpc8xx_console_irq_on(const rtems_irq_connect_data *irq)
{
CHN_MASK_SET(irq->name,3); /* Enable TX and RX interrupts */
}
static void
mpc8xx_console_irq_off(const rtems_irq_connect_data *irq)
{
CHN_MASK_SET(irq->name,0); /* Disable TX and RX interrupts */
}
static int
mpc8xx_console_irq_isOn(const rtems_irq_connect_data *irq)
{
return (0 != CHN_MASK_GET(irq->name)); /* Check TX and RX interrupts */
} }
static void static void
@@ -730,19 +707,18 @@ sccInitialize (int chan)
} }
if (m8xx_scc_mode[chan] != TERMIOS_POLLED) { if (m8xx_scc_mode[chan] != TERMIOS_POLLED) {
rtems_isr_entry old_handler;
rtems_status_code sc;
#if 0 rtems_irq_connect_data irq_conn_data = {
sc = rtems_interrupt_catch (sccInterruptHandler, m8xx_console_chan_desc[chan].ivec_src,
m8xx_console_chan_desc[chan].ivec_src sccInterruptHandler, /* rtems_irq_hdl */
| (m8xx.cicr & 0xE0), (rtems_irq_hdl_param)chan, /* (rtems_irq_hdl_param) */
&old_handler); mpc8xx_console_irq_on, /* (rtems_irq_enable) */
#endif mpc8xx_console_irq_off, /* (rtems_irq_disable) */
#warning "Redo interrupt installation" mpc8xx_console_irq_isOn /* (rtems_irq_is_enabled) */
printk( "Redo interrupt installation" ); };
CHN_MASK_SET(chan,3); /* Enable TX and RX interrupts */ if (!BSP_install_rtems_irq_handler (&irq_conn_data)) {
m8xx.cimr |= m8xx_console_chan_desc[chan].ireg_mask; /* Enable interrupts */ rtems_panic("console: cannot install IRQ handler");
}
} }
} }
@@ -899,13 +875,6 @@ rtems_device_driver console_initialize(rtems_device_major_number major,
int chan,entry,ttynum; int chan,entry,ttynum;
char tty_name[] = "/dev/tty00"; char tty_name[] = "/dev/tty00";
/*
* init base clock for BRGs
* (if not already set by debugger etc)
*/
if (m8xx_clock_rate == 0) {
m8xx_clock_rate = BSP_bus_frequency;
}
/* /*
* Set up TERMIOS * Set up TERMIOS
*/ */

View File

@@ -132,18 +132,9 @@ extern int rtems_scc_enet_driver_attach (struct rtems_bsdnet_ifconfig *config,
#undef RTEMS_BSP_HAS_IDE_DRIVER #undef RTEMS_BSP_HAS_IDE_DRIVER
/* /*
* our bus frequency * our (internal) bus frequency
*/ */
extern unsigned int BSP_bus_frequency; extern uint32_t BSP_bus_frequency;
/* functions */
rtems_isr_entry set_vector( /* returns old vector */
rtems_isr_entry handler, /* isr routine */
rtems_vector_number vector, /* vector number */
int type /* RTEMS or RAW intr */
);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -98,15 +98,15 @@ static int BSP_irq_handle_at_cpm(void)
{ {
int32_t cpvecnum; int32_t cpvecnum;
uint32_t msr; uint32_t msr;
rtems_interrupt_level level;
/* Get vector number: write IACK=1, then read vectir */ /* Get vector number: write IACK=1, then read vectir */
m8xx.civr = 1; m8xx.civr = 1;
cpvecnum = (m8xx.civr >> 11) + BSP_CPM_IRQ_LOWEST_OFFSET; cpvecnum = (m8xx.civr >> 11) + BSP_CPM_IRQ_LOWEST_OFFSET;
/* /*
* Check the vector number, mask lower priority interrupts, enable * Check the vector number,
* exceptions and dispatch the handler. * enable exceptions and dispatch the handler.
* NOTE: lower-prio interrupts are automatically masked in CPIC
*/ */
if (BSP_IS_CPM_IRQ(cpvecnum)) { if (BSP_IS_CPM_IRQ(cpvecnum)) {
/* Enable all interrupts */ /* Enable all interrupts */
@@ -115,15 +115,16 @@ static int BSP_irq_handle_at_cpm(void)
bsp_interrupt_handler_dispatch(cpvecnum); bsp_interrupt_handler_dispatch(cpvecnum);
/* Restore machine state */ /* Restore machine state */
ppc_external_exceptions_disable(msr); ppc_external_exceptions_disable(msr);
/*
* clear "in-service" bit
*/
m8xx.cisr = 1 << (cpvecnum - BSP_CPM_IRQ_LOWEST_OFFSET);
} }
else { else {
/* not valid vector */ /* not valid vector */
bsp_interrupt_handler_default(cpvecnum); bsp_interrupt_handler_default(cpvecnum);
} }
/*
* clear "in-service" bit
*/
m8xx.cisr = 1 << (cpvecnum - BSP_CPM_IRQ_LOWEST_OFFSET);
return 0; return 0;
} }
@@ -131,7 +132,6 @@ static int BSP_irq_handle_at_siu( unsigned excNum)
{ {
int32_t sivecnum; int32_t sivecnum;
uint32_t msr; uint32_t msr;
rtems_interrupt_level level;
bool is_cpm_irq; bool is_cpm_irq;
uint32_t simask_save; uint32_t simask_save;
/* /*

View File

@@ -77,6 +77,10 @@ $(PROJECT_INCLUDE)/bsp/irq-generic.h: ../../shared/include/irq-generic.h $(PROJE
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-generic.h $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-generic.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-generic.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-generic.h
$(PROJECT_INCLUDE)/bsp/spi.h: spi/spi.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/spi.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/spi.h
$(PROJECT_INCLUDE)/bsp/vectors.h: ../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/vectors.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) $(PROJECT_INCLUDE)/bsp/vectors.h: ../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/vectors.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vectors.h $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vectors.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vectors.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vectors.h

View File

@@ -21,13 +21,13 @@
*/ */
#include <rtems.h> #include <rtems.h>
#include <stdlib.h>
#include <libcpu/powerpc-utility.h> #include <libcpu/powerpc-utility.h>
#include <bsp.h> #include <bsp.h>
#include <bsp/bootcard.h> #include <bsp/bootcard.h>
/* #include <bsp/irq-generic.h> #include <bsp/irq-generic.h>
#include <bsp/ppc_exc_bspsupp.h> */ #include <bsp/ppc_exc_bspsupp.h>
#ifdef BSP_HAS_TQMMON #ifdef BSP_HAS_TQMMON
/* /*
@@ -36,11 +36,10 @@
#endif /* BSP_HAS_TQMMON */ #endif /* BSP_HAS_TQMMON */
/* Configuration parameters for console driver, ... */ /* Configuration parameters for console driver, ... */
unsigned int BSP_bus_frequency; uint32_t BSP_bus_frequency;
/* Configuration parameters for clock driver, ... */ /* Configuration parameters for clock driver, ... */
uint32_t bsp_clicks_per_usec; /* for PIT driver: OSCCLK */ uint32_t bsp_clicks_per_usec; /* for PIT driver: OSCCLK */
uint32_t bsp_clock_speed ; /* needed for PIT driver */
/* for timer: */ /* for timer: */
uint32_t bsp_timer_average_overhead; /* Average overhead of timer in ticks */ uint32_t bsp_timer_average_overhead; /* Average overhead of timer in ticks */
uint32_t bsp_timer_least_valid; /* Least valid number from timer */ uint32_t bsp_timer_least_valid; /* Least valid number from timer */
@@ -94,7 +93,7 @@ const char *bsp_tqm_get_cib_string( const char *cib_id)
/* /*
* search for pattern in info block (CIB) * search for pattern in info block (CIB)
*/ */
fnd_str = strstr(TQM_CONF_INFO_BLOCK_ADDR,srch_pattern); fnd_str = strstr((const char *)TQM_CONF_INFO_BLOCK_ADDR,srch_pattern);
if (fnd_str == NULL) { if (fnd_str == NULL) {
return NULL; return NULL;
@@ -111,7 +110,7 @@ rtems_status_code bsp_tqm_get_cib_uint32( const char *cib_id,
uint32_t *result) uint32_t *result)
{ {
const char *item_ptr; const char *item_ptr;
const char *end_ptr; char *end_ptr;
item_ptr = bsp_tqm_get_cib_string(cib_id); item_ptr = bsp_tqm_get_cib_string(cib_id);
if (item_ptr == NULL) { if (item_ptr == NULL) {
return RTEMS_INVALID_ID; return RTEMS_INVALID_ID;
@@ -174,7 +173,6 @@ void bsp_start( void)
bsp_clicks_per_usec = 0; /* force to zero to control bsp_clicks_per_usec = 0; /* force to zero to control
* PIT clock driver from EXTCLK * PIT clock driver from EXTCLK
*/ */
bsp_clock_speed = BSP_bus_frequency;
bsp_timer_least_valid = 3; bsp_timer_least_valid = 3;
bsp_timer_average_overhead = 3; bsp_timer_average_overhead = 3;

View File

@@ -24,11 +24,6 @@
#include <bsp.h> #include <bsp.h>
#include <mpc8xx.h> #include <mpc8xx.h>
#warning Call to boot_card has changed and needs checking.
#warning The call is "void boot_card(const char* cmdline);"
#warning You need to pass a NULL.
#warning Please check and remove these warnings.
.extern boot_card .extern boot_card
.section ".entry" .section ".entry"
@@ -147,7 +142,7 @@ start_code_in_ram:
/* clear arguments and do further init. in C (common for RAM/ROM startup) */ /* clear arguments and do further init. in C (common for RAM/ROM startup) */
/* Clear argc, argv and envp */ /* Clear cmdline */
xor r3, r3, r3 xor r3, r3, r3
bl SYM (boot_card) /* Call the first C routine */ bl SYM (boot_card) /* Call the first C routine */

View File

@@ -1,3 +1,8 @@
2009-10-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* include/irq-generic.h, src/irq-generic.c, src/irq-legacy.c: Update
for interrupt handler type change.
2009-10-09 Sebastian Huber <sebastian.huber@embedded-brains.de> 2009-10-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
* bootcard: Update for heap API changes. * bootcard: Update for heap API changes.

View File

@@ -226,7 +226,7 @@ static inline void bsp_interrupt_handler_dispatch(rtems_vector_number vector)
&bsp_interrupt_handler_table [bsp_interrupt_handler_index(vector)]; &bsp_interrupt_handler_table [bsp_interrupt_handler_index(vector)];
do { do {
(*e->handler)(vector, e->arg); (*e->handler)(e->arg);
e = e->next; e = e->next;
} while (e != NULL); } while (e != NULL);
} else { } else {

View File

@@ -39,8 +39,10 @@ static uint8_t bsp_interrupt_handler_unique_table
static rtems_id bsp_interrupt_mutex = RTEMS_ID_NONE; static rtems_id bsp_interrupt_mutex = RTEMS_ID_NONE;
static void bsp_interrupt_handler_empty(rtems_vector_number vector, void *arg) static void bsp_interrupt_handler_empty(void *arg)
{ {
rtems_vector_number vector = (rtems_vector_number) arg;
bsp_interrupt_handler_default(vector); bsp_interrupt_handler_default(vector);
} }
@@ -219,6 +221,7 @@ rtems_status_code bsp_interrupt_initialize(void)
/* Initialize handler table */ /* Initialize handler table */
for (i = 0; i < BSP_INTERRUPT_HANDLER_TABLE_SIZE; ++i) { for (i = 0; i < BSP_INTERRUPT_HANDLER_TABLE_SIZE; ++i) {
bsp_interrupt_handler_table [i].handler = bsp_interrupt_handler_empty; bsp_interrupt_handler_table [i].handler = bsp_interrupt_handler_empty;
bsp_interrupt_handler_table [i].arg = (void *) i;
} }
sc = bsp_interrupt_facility_initialize(); sc = bsp_interrupt_facility_initialize();

View File

@@ -19,62 +19,21 @@
* http://www.rtems.com/license/LICENSE. * http://www.rtems.com/license/LICENSE.
*/ */
#include <stdbool.h> #include <string.h>
#include <stdlib.h>
#define BSP_SHARED_HANDLER_SUPPORT #define BSP_SHARED_HANDLER_SUPPORT
#include <rtems.h>
#include <rtems/irq.h> #include <rtems/irq.h>
#include <bsp/irq-generic.h> #include <bsp/irq-generic.h>
typedef struct {
rtems_irq_hdl handler;
void *arg;
} bsp_interrupt_legacy_entry;
typedef struct {
rtems_irq_hdl handler;
void *handler_arg;
bsp_interrupt_legacy_entry *legacy_handler_arg;
} bsp_interrupt_legacy_iterate_entry;
static void bsp_interrupt_legacy_dispatch(rtems_vector_number vector, void *arg)
{
bsp_interrupt_legacy_entry *e = (bsp_interrupt_legacy_entry *) arg;
e->handler(e->arg);
}
static void bsp_interrupt_legacy_per_handler_routine(
void *arg,
const char *info,
rtems_option options,
rtems_interrupt_handler handler,
void *handler_arg
)
{
bsp_interrupt_legacy_iterate_entry *ie =
(bsp_interrupt_legacy_iterate_entry *) arg;
bsp_interrupt_legacy_entry *e = NULL;
if (handler == bsp_interrupt_legacy_dispatch) {
e = (bsp_interrupt_legacy_entry *) handler_arg;
if (e->handler == ie->handler && e->arg == ie->handler_arg) {
ie->legacy_handler_arg = e;
}
}
}
/** /**
* @deprecated Obsolete. * @deprecated Obsolete.
*/ */
int BSP_get_current_rtems_irq_handler(rtems_irq_connect_data *cd) int BSP_get_current_rtems_irq_handler(rtems_irq_connect_data *cd)
{ {
cd->hdl = NULL; memset(cd, 0, sizeof(*cd));
cd->handle = NULL;
cd->on = NULL;
cd->off = NULL;
cd->isOn = NULL;
return 1; return 1;
} }
@@ -85,24 +44,15 @@ int BSP_get_current_rtems_irq_handler(rtems_irq_connect_data *cd)
int BSP_install_rtems_irq_handler(const rtems_irq_connect_data *cd) int BSP_install_rtems_irq_handler(const rtems_irq_connect_data *cd)
{ {
rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_status_code sc = RTEMS_SUCCESSFUL;
bsp_interrupt_legacy_entry *e = malloc(sizeof(bsp_interrupt_legacy_entry));
if (e == NULL) {
return 0;
}
e->handler = cd->hdl;
e->arg = cd->handle;
sc = rtems_interrupt_handler_install( sc = rtems_interrupt_handler_install(
cd->name, cd->name,
"LEGACY INSTALLED", "LEGACY INSTALLED",
RTEMS_INTERRUPT_UNIQUE, RTEMS_INTERRUPT_UNIQUE,
bsp_interrupt_legacy_dispatch, cd->hdl,
e cd->handle
); );
if (sc != RTEMS_SUCCESSFUL) { if (sc != RTEMS_SUCCESSFUL) {
free(e);
return 0; return 0;
} }
@@ -119,29 +69,20 @@ int BSP_install_rtems_irq_handler(const rtems_irq_connect_data *cd)
int BSP_install_rtems_shared_irq_handler(const rtems_irq_connect_data *cd) int BSP_install_rtems_shared_irq_handler(const rtems_irq_connect_data *cd)
{ {
rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_status_code sc = RTEMS_SUCCESSFUL;
bsp_interrupt_legacy_entry *e = malloc(sizeof(bsp_interrupt_legacy_entry));
if (e == NULL) {
return 0;
}
e->handler = cd->hdl;
e->arg = cd->handle;
sc = rtems_interrupt_handler_install( sc = rtems_interrupt_handler_install(
cd->name, cd->name,
"LEGACY INSTALLED", "LEGACY INSTALLED",
RTEMS_INTERRUPT_SHARED, RTEMS_INTERRUPT_SHARED,
bsp_interrupt_legacy_dispatch, cd->hdl,
e cd->handle
); );
if (sc != RTEMS_SUCCESSFUL) { if (sc != RTEMS_SUCCESSFUL) {
free(e);
return 0; return 0;
} }
if (cd->on != NULL) { if (cd->on != NULL) {
cd->on(cd); (*cd->on)(cd);
} }
return 1; return 1;
@@ -153,31 +94,12 @@ int BSP_install_rtems_shared_irq_handler(const rtems_irq_connect_data *cd)
int BSP_remove_rtems_irq_handler(const rtems_irq_connect_data *cd) int BSP_remove_rtems_irq_handler(const rtems_irq_connect_data *cd)
{ {
rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_status_code sc = RTEMS_SUCCESSFUL;
bsp_interrupt_legacy_iterate_entry e = {
.handler = cd->hdl,
.handler_arg = cd->handle,
.legacy_handler_arg = NULL
};
sc = rtems_interrupt_handler_iterate(
cd->name, bsp_interrupt_legacy_per_handler_routine, &e);
if (sc != RTEMS_SUCCESSFUL) {
return 0;
}
if (e.legacy_handler_arg == NULL) {
return 0;
}
if (cd->off != NULL) { if (cd->off != NULL) {
cd->off(cd); (*cd->off)(cd);
} }
sc = rtems_interrupt_handler_remove( sc = rtems_interrupt_handler_remove(cd->name, cd->hdl, cd->handle);
cd->name, bsp_interrupt_legacy_dispatch, e.legacy_handler_arg);
free(e.legacy_handler_arg);
if (sc != RTEMS_SUCCESSFUL) { if (sc != RTEMS_SUCCESSFUL) {
return 0; return 0;
} }

View File

@@ -1,3 +1,8 @@
2009-10-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* mpc55xx/edma/edma.c, mpc55xx/esci/esci.c: Update for interrupt
handler type change.
2009-10-16 Jennifer Averett <jennifer.averett@OARcorp.com> 2009-10-16 Jennifer Averett <jennifer.averett@OARcorp.com>
* mpc6xx/mmu/bat.c: Resolved bug: It is not an overlap if the batindex * mpc6xx/mmu/bat.c: Resolved bug: It is not an overlap if the batindex

View File

@@ -47,7 +47,7 @@ static uint64_t mpc55xx_edma_channel_occupation = 0;
static rtems_chain_control mpc55xx_edma_channel_chain; static rtems_chain_control mpc55xx_edma_channel_chain;
static void mpc55xx_edma_interrupt_handler( rtems_vector_number vector, void *arg) static void mpc55xx_edma_interrupt_handler( void *arg)
{ {
mpc55xx_edma_channel_entry *e = (mpc55xx_edma_channel_entry *) arg; mpc55xx_edma_channel_entry *e = (mpc55xx_edma_channel_entry *) arg;
@@ -63,7 +63,7 @@ static void mpc55xx_edma_interrupt_handler( rtems_vector_number vector, void *ar
e->done( e, 0); e->done( e, 0);
} }
static void mpc55xx_edma_interrupt_error_handler( rtems_vector_number vector, void *arg) static void mpc55xx_edma_interrupt_error_handler( void *arg)
{ {
rtems_chain_control *chain = &mpc55xx_edma_channel_chain; rtems_chain_control *chain = &mpc55xx_edma_channel_chain;
rtems_chain_node *node = chain->first; rtems_chain_node *node = chain->first;

View File

@@ -410,7 +410,7 @@ static int mpc55xx_esci_termios_set_attributes( int minor, const struct termios
/** /**
* @brief Interrupt handler. * @brief Interrupt handler.
*/ */
static void mpc55xx_esci_termios_interrupt_handler( rtems_vector_number vector, void *arg) static void mpc55xx_esci_termios_interrupt_handler( void *arg)
{ {
mpc55xx_esci_driver_entry *e = (mpc55xx_esci_driver_entry *) arg; mpc55xx_esci_driver_entry *e = (mpc55xx_esci_driver_entry *) arg;
volatile union ESCI_SR_tag *status = &e->regs->SR; volatile union ESCI_SR_tag *status = &e->regs->SR;

View File

@@ -577,14 +577,7 @@ NS16550_STATIC void ns16550_enable_interrupts(
(*setReg)(pNS16550, NS16550_INTERRUPT_ENABLE, mask); (*setReg)(pNS16550, NS16550_INTERRUPT_ENABLE, mask);
} }
#ifdef BSP_FEATURE_IRQ_EXTENSION #if defined(BSP_FEATURE_IRQ_EXTENSION) || defined(BSP_FEATURE_IRQ_LEGACY)
NS16550_STATIC void ns16550_isr(rtems_vector_number vector, void *arg)
{
int minor = (int) arg;
ns16550_process( minor);
}
#elif defined BSP_FEATURE_IRQ_LEGACY
NS16550_STATIC rtems_isr ns16550_isr(void *arg) NS16550_STATIC rtems_isr ns16550_isr(void *arg)
{ {
int minor = (int) arg; int minor = (int) arg;

View File

@@ -1,3 +1,8 @@
2009-10-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* include/rtems/irq-extension.h: Removed vector argument from
rtems_interrupt_handler type.
2009-10-20 Till Straumann <strauman@slac.stanford.edu> 2009-10-20 Till Straumann <strauman@slac.stanford.edu>
* score/cpu/i386/cpu.c, score/cpu/i386/cpu.h: let the default * score/cpu/i386/cpu.c, score/cpu/i386/cpu.h: let the default

View File

@@ -68,7 +68,7 @@ extern "C" {
/** /**
* @brief Interrupt handler routine type. * @brief Interrupt handler routine type.
*/ */
typedef void (*rtems_interrupt_handler)(rtems_vector_number, void *); typedef void (*rtems_interrupt_handler)(void *);
/** /**
* @brief Installs the interrupt handler routine @a handler for the interrupt * @brief Installs the interrupt handler routine @a handler for the interrupt

View File

@@ -677,15 +677,38 @@ void fileio_menu (void)
int menu_tid; int menu_tid;
/*
* RTEMS File Menu Task
*/
rtems_task
fileio_task (rtems_task_argument ignored)
{
fileio_menu();
}
/* /*
* RTEMS Startup Task * RTEMS Startup Task
*/ */
rtems_task rtems_task
Init (rtems_task_argument ignored) Init (rtems_task_argument ignored)
{ {
rtems_name Task_name;
rtems_id Task_id;
rtems_status_code status;
puts( "\n\n*** FILE I/O SAMPLE AND TEST ***" ); puts( "\n\n*** FILE I/O SAMPLE AND TEST ***" );
fileio_menu(); Task_name = rtems_build_name('F','M','N','U');
status = rtems_task_create(
Task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2,
RTEMS_DEFAULT_MODES ,
RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES, &Task_id
);
status = rtems_task_start( Task_id, fileio_task, 1 );
status = rtems_task_delete( RTEMS_SELF );
} }
#if defined(USE_SHELL) #if defined(USE_SHELL)