new exceptions.c also brings set_ipl() instead of asm_set_ipl()
This commit is contained in:
@@ -24,6 +24,9 @@
|
||||
#include <stdint.h>
|
||||
#include "bas_printf.h"
|
||||
#include "bas_string.h"
|
||||
#include "startcf.h"
|
||||
#include "interrupts.h"
|
||||
#include "MCF5475.h"
|
||||
|
||||
#if MACHINE_FIREBEE
|
||||
#include "firebee.h"
|
||||
@@ -39,7 +42,9 @@
|
||||
#define debug_printf(format, arg...) do { ; } while (0)
|
||||
#endif /* DEBUG_EXC */
|
||||
|
||||
inline uint32_t set_vbr(uint32_t value)
|
||||
typedef void (*exception_handler)(void);
|
||||
|
||||
static inline uint32_t set_vbr(uint32_t value)
|
||||
{
|
||||
extern uint32_t rt_vbr;
|
||||
uint32_t ret = rt_vbr;
|
||||
@@ -55,50 +60,62 @@ inline uint32_t set_vbr(uint32_t value)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __attribute__((interrupt)) std_exception_handler()
|
||||
static void __attribute__((interrupt)) std_exception_handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void __attribute__((interrupt)) reset_exception_handler()
|
||||
static void __attribute__((interrupt)) reset_exception_handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void __attribute__((interrupt)) access_exception_handler()
|
||||
static void __attribute__((interrupt)) access_exception_handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void __attribute__((interrupt)) irq1_exception_handler()
|
||||
static void __attribute__((interrupt)) irq1_exception_handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void __attribute__((interrupt)) irq2_exception_handler()
|
||||
static void __attribute__((interrupt)) irq2_exception_handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void __attribute__((interrupt)) irq3_exception_handler()
|
||||
static void __attribute__((interrupt)) irq3_exception_handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void __attribute__((interrupt)) irq4_exception_handler()
|
||||
static void __attribute__((interrupt)) irq4_exception_handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void __attribute__((interrupt)) irq5_exception_handler()
|
||||
static void __attribute__((interrupt)) irq5_exception_handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void __attribute__((interrupt)) irq6_exception_handler()
|
||||
static void __attribute__((interrupt)) irq6_exception_handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void __attribute__((interrupt)) irq7_exception_handler()
|
||||
static void __attribute__((interrupt)) irq7_exception_handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void __attribute__((interrupt)) psc3_interrupt_handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void __attribute__((interrupt)) gpt0_interrupt_handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
extern void __attribute__((interrupt)) xhdi_sd_install(void);
|
||||
|
||||
void vec_init(void)
|
||||
{
|
||||
extern uint32_t _RAMBAR0[]; /* defined in linker script */
|
||||
uint32_t *VBR = &_RAMBAR0[0];
|
||||
exception_handler *VBR = (exception_handler *) &_RAMBAR0[0];
|
||||
extern uint32_t _SUP_SP[]; /* supervisor stack pointer from linker script */
|
||||
exception_handler *SUP_SP = (exception_handler *) &_SUP_SP[0];
|
||||
|
||||
extern uint32_t rt_mod;
|
||||
extern uint32_t rt_ssp;
|
||||
extern uint32_t rt_usp;
|
||||
@@ -120,7 +137,7 @@ void vec_init(void)
|
||||
VBR[i] = std_exception_handler;
|
||||
}
|
||||
|
||||
VBR[0] = __SUP_SP;
|
||||
VBR[0] = SUP_SP;
|
||||
|
||||
VBR[1] = reset_exception_handler;
|
||||
VBR[2] = access_exception_handler;
|
||||
@@ -133,20 +150,20 @@ void vec_init(void)
|
||||
}
|
||||
#endif /* MACHINE_FIREBEE */
|
||||
|
||||
VBR[0X80] = xhdi_install; /* trap #0 exception handler for BaS driver vectors */
|
||||
VBR[0X80] = xhdi_sd_install; /* trap #0 exception handler for BaS driver vectors */
|
||||
|
||||
|
||||
#if MACHINE_FIREBEE
|
||||
/*
|
||||
* ACP interrupts 1-7 (generated by the FPGA on the FireBee)
|
||||
*/
|
||||
VBR[0X104] = (uint32_t) irq1_exception_handler;
|
||||
VBR[0x108] = (uint32_t) irq2_exception_handler;
|
||||
VBR[0x10c] = (uint32_t) irq3_exception_handler;
|
||||
VBR[0x110] = (uint32_t) irq4_exception_handler;
|
||||
VBR[0x114] = (uint32_t) irq5_exception_handler;
|
||||
VBR[0x118] = (uint32_t) irq6_exception_handler;
|
||||
VBR[0x11c] = (uint32_t) irq7_exception_handler;
|
||||
VBR[0X104] = irq1_exception_handler;
|
||||
VBR[0x108] = irq2_exception_handler;
|
||||
VBR[0x10c] = irq3_exception_handler;
|
||||
VBR[0x110] = irq4_exception_handler;
|
||||
VBR[0x114] = irq5_exception_handler;
|
||||
VBR[0x118] = irq6_exception_handler;
|
||||
VBR[0x11c] = irq7_exception_handler;
|
||||
|
||||
/*
|
||||
* install PSC vectors (used for PIC communication on the FireBee
|
||||
|
||||
Reference in New Issue
Block a user