218 lines
3.3 KiB
C
218 lines
3.3 KiB
C
//*****************************************************************************
|
|
// Sentinel 65X Kernel
|
|
//
|
|
// src/interrupts.c
|
|
//*****************************************************************************
|
|
|
|
#include <stddef.h>
|
|
|
|
#include "config.h"
|
|
|
|
static void (*user_nmi_handler)(void) = NULL;
|
|
|
|
static void (*user_brk_handler)(void) = NULL;
|
|
|
|
static void (*user_cop_handler)(void) = NULL;
|
|
|
|
static void (*user_irq_handler)(void) = NULL;
|
|
|
|
static void (*user_vera_irq_handler)(void) = NULL;
|
|
|
|
static void (*user_t7_handler)(void) = NULL;
|
|
|
|
static void (*user_t6_handler)(void) = NULL;
|
|
|
|
static void (*user_t5_handler)(void) = NULL;
|
|
|
|
static void (*user_t4_handler)(void) = NULL;
|
|
|
|
static void (*user_t3_handler)(void) = NULL;
|
|
|
|
static void (*user_t2_handler)(void) = NULL;
|
|
|
|
static void (*user_t1_handler)(void) = NULL;
|
|
|
|
static void (*user_t0_handler)(void) = NULL;
|
|
|
|
far void
|
|
set_user_nmi_handler(void (*f)(void))
|
|
{
|
|
user_nmi_handler = f;
|
|
}
|
|
|
|
far void
|
|
set_user_brk_handler(void (*f)(void))
|
|
{
|
|
user_brk_handler = f;
|
|
}
|
|
|
|
far void
|
|
set_user_cop_handler(void (*f)(void))
|
|
{
|
|
user_cop_handler = f;
|
|
}
|
|
|
|
far void
|
|
set_user_irq_handler(void (*f)(void))
|
|
{
|
|
user_irq_handler = f;
|
|
}
|
|
|
|
far void
|
|
set_user_vera_irq_handler(void (*f)(void))
|
|
{
|
|
user_vera_irq_handler = f;
|
|
}
|
|
|
|
far void
|
|
set_user_t7_handler(void (*f)(void))
|
|
{
|
|
user_t7_handler = f;
|
|
}
|
|
|
|
far void
|
|
set_user_t6_handler(void (*f)(void))
|
|
{
|
|
user_t6_handler = f;
|
|
}
|
|
|
|
far void
|
|
set_user_t5_handler(void (*f)(void))
|
|
{
|
|
user_t5_handler = f;
|
|
}
|
|
|
|
far void
|
|
set_user_t4_handler(void (*f)(void))
|
|
{
|
|
user_t4_handler = f;
|
|
}
|
|
|
|
far void
|
|
set_user_t3_handler(void (*f)(void))
|
|
{
|
|
user_t3_handler = f;
|
|
}
|
|
|
|
far void
|
|
set_user_t2_handler(void (*f)(void))
|
|
{
|
|
user_t2_handler = f;
|
|
}
|
|
|
|
far void
|
|
set_user_t1_handler(void (*f)(void))
|
|
{
|
|
user_t1_handler = f;
|
|
}
|
|
|
|
far void
|
|
set_user_t0_handler(void (*f)(void))
|
|
{
|
|
user_t0_handler = f;
|
|
}
|
|
|
|
interrupt_handler(0x00FFBA) void
|
|
nmi_handler(void)
|
|
{
|
|
if (user_nmi_handler != NULL) {
|
|
user_nmi_handler();
|
|
}
|
|
}
|
|
|
|
interrupt_handler(0x00FFB6) void
|
|
brk_handler(void)
|
|
{
|
|
if (user_brk_handler != NULL) {
|
|
user_brk_handler();
|
|
}
|
|
}
|
|
|
|
interrupt_handler(0x00FFB4) void
|
|
cop_handler(void)
|
|
{
|
|
if (user_cop_handler != NULL) {
|
|
user_cop_handler();
|
|
}
|
|
}
|
|
|
|
interrupt_handler(0x00FF9E) void
|
|
irq_handler(void)
|
|
{
|
|
if (user_irq_handler != NULL) {
|
|
user_irq_handler();
|
|
}
|
|
}
|
|
|
|
interrupt_handler(0x00FF98) void
|
|
int_vera_irq_handler(void)
|
|
{
|
|
if (user_vera_irq_handler != NULL) {
|
|
user_vera_irq_handler();
|
|
}
|
|
}
|
|
|
|
interrupt_handler(0x00FF8E) void
|
|
int_t7_handler(void)
|
|
{
|
|
if (user_t7_handler != NULL) {
|
|
user_t7_handler();
|
|
}
|
|
}
|
|
|
|
interrupt_handler(0x00FF8C) void
|
|
int_t6_handler(void)
|
|
{
|
|
if (user_t6_handler != NULL) {
|
|
user_t6_handler();
|
|
}
|
|
}
|
|
|
|
interrupt_handler(0x00FF8A) void
|
|
int_t5_handler(void)
|
|
{
|
|
if (user_t5_handler != NULL) {
|
|
user_t5_handler();
|
|
}
|
|
}
|
|
|
|
interrupt_handler(0x00FF88) void
|
|
int_t4_handler(void)
|
|
{
|
|
if (user_t4_handler != NULL) {
|
|
user_t4_handler();
|
|
}
|
|
}
|
|
|
|
interrupt_handler(0x00FF86) void
|
|
int_t3_handler(void)
|
|
{
|
|
if (user_t3_handler != NULL) {
|
|
user_t3_handler();
|
|
}
|
|
}
|
|
|
|
interrupt_handler(0x00FF84) void
|
|
int_t2_handler(void)
|
|
{
|
|
if (user_t2_handler != NULL) {
|
|
user_t2_handler();
|
|
}
|
|
}
|
|
|
|
interrupt_handler(0x00FF82) void
|
|
int_t1_handler(void)
|
|
{
|
|
if (user_t1_handler != NULL) {
|
|
user_t1_handler();
|
|
}
|
|
}
|
|
|
|
interrupt_handler(0x00FF80) void
|
|
int_t0_handler(void)
|
|
{
|
|
if (user_t0_handler != NULL) {
|
|
user_t0_handler();
|
|
}
|
|
}
|