gint/include/core/setup.h
Lephe 9cf2f9fe97
core tmu: improve reliability of interrupt handlers
This change includes three reliability improvements in handlers:

1. TMU handlers now actively check for the UNF flag to go low rather
   than expecting it to do so right away.
2. CPUOPM.INTMU is now set so that IMASK it updated at every interrupt
   (which is absolutely required for nested interrupts!).
3. gint_inth_callback() no longer performs transfers between user bank
   and kernel bank while in user bank, because this is when interrupts
   are enabled and thus likely to corrupt the kernel bank; rather, it
   now does it while in kernel bank with interrupts disabled.
2020-06-20 09:32:48 +02:00

36 lines
1 KiB
C

//---
// core:setup - Installing and unloading the library
//---
#ifndef GINT_CORE_SETUP
#define GINT_CORE_SETUP
#include <gint/defs/types.h>
/* Prototypes for the library management functions are in <gint/gint.h> */
/* gint_setvbr()
Changes the VBR address and calls the configuration function while
interrupts are disabled. The configuration function must disable all
interrupts that the new handlers cannot handle, either by clearing the
priority registers or by setting the interrupt masks.
@vbr New VBR address
@configure Configuration function
Returns the previous VBR address. */
uint32_t gint_setvbr(uint32_t vbr, void (*configure)(void));
void gint_setcpuopm(uint32_t CPUOPM);
uint32_t gint_getcpuopm(void);
/* gint_exch(): Exception handler */
void gint_exch(void);
/* gint_tlbh(): TLB miss handler */
void gint_tlbh(void);
/* gint_inth_7705(): SH7705 exception handler */
void gint_inth_7705(void);
/* gint_inth_7305(): SH7305 exception handler */
void gint_inth_7305(void);
#endif /* GINT_CORE_SETUP */