OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [sw/] [drivers/] [or1200/] [exceptions.c] - Diff between revs 488 and 489

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 488 Rev 489
Line 37... Line 37...
  "A Custom",                                // 1d
  "A Custom",                                // 1d
  "A Custom",                                // 1e
  "A Custom",                                // 1e
  "A Custom",                                // 1f
  "A Custom",                                // 1f
};
};
 
 
extern void int_main();
extern void int_main(void);
extern void cpu_timer_tick();
extern void cpu_timer_tick(void);
 
 
void (*except_handlers[]) (void ) = {0,    // 0
void (*except_handlers[]) (void ) = {0,    // 0
                                    0,    // 1
                                    0,    // 1
                                    0,    // 2
                                    0,    // 2
                                    0,    // 3
                                    0,    // 3
Line 63... Line 63...
                                    0,    // 12
                                    0,    // 12
                                    0};    // 13
                                    0};    // 13
 
 
 
 
void
void
add_handler(unsigned long vector, void (*handler) (void *))
add_handler(unsigned long vector, void (*handler) (void))
{
{
  except_handlers[vector] = handler;
  except_handlers[vector] = handler;
}
}
 
 
void default_exception_handler_c(unsigned exception_address,unsigned epc)
void
 
default_exception_handler_c(unsigned exception_address,unsigned epc)
{
{
  int exception_no = (exception_address >> 8) & 0x1f;
  int exception_no = (exception_address >> 8) & 0x1f;
  if (except_handlers[exception_no])
  if (except_handlers[exception_no])
    {
    {
      return (*except_handlers[exception_no])();
            (*except_handlers[exception_no])();
 
            return;
    }
    }
 
 
  // Init uart here, incase it hasn't been
  // init uart here, incase it hasn't been
  uart_init(DEFAULT_UART);
  uart_init(DEFAULT_UART);
 
 
  printf("EPC = 0x%.8x\n", exception_address);
  printf("EPC = 0x%.8x\n", exception_address);
 
 
  // Output initial messaging using low-level functions incase
  // Output initial messaging using low-level functions incase

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.