libparanut
A Hardware Abstraction Layer for ParaNut Architectures.
Functions
pn_exception.c File Reference

Contains (somewhat) architecture independent implementations of the Exception Module functions. More...

#include "common.h"
#include <stdio.h>
Include dependency graph for pn_exception.c:

Functions

void pn_exception_init (void)
 Initializes libparanut internal exception handling. Interrupts (not exceptions in general!) are disabled after. Should be called before using pn_exception_set_handler().
 
int pn_exception_set_handler (void(*handler)(unsigned int cause, unsigned int program_counter, unsigned int mtval), unsigned int exception_code)
 Set your own exception handler. More...
 
void pn_ecall (void)
 Raises an environment call exception. More...
 
void pn_interrupt_enable (void)
 Enables interrupts only. More...
 
void pn_interrupt_disable (void)
 Disables interrupts only. More...
 
void pn_progress_mepc (void)
 Sets program counter of the register which keeps the exception return adress to next instruction. More...
 

Detailed Description

Contains (somewhat) architecture independent implementations of the Exception Module functions.

The exception module is not exactly architecture independent since it implements a RISC-V exception table.

Todo:
Layer this better in later versions of libparanut.