software/libbase/isr.c: Move ISR handling in more logical order (RISC-V PLIC first).

This commit is contained in:
Florent Kermarrec 2024-06-14 11:49:26 +02:00
parent 38e060c354
commit 45753a3cc2
1 changed files with 16 additions and 15 deletions

View File

@ -18,24 +18,10 @@ void isr(void);
#ifdef CONFIG_CPU_HAS_INTERRUPT
/*************************************/
/* ISR Handling for BlackParrot CPU. */
/*************************************/
#if defined(__blackparrot__) /*TODO: Update this function for BP.*/
void isr(void)
{
static int onetime = 0;
if (onetime == 0) {
printf("ISR blackparrot\n");
printf("TRAP!!\n");
onetime++;
}
}
/***********************************************************/
/* ISR and PLIC Initialization for RISC-V PLIC-based CPUs. */
/***********************************************************/
#elif defined(__riscv_plic__)
#if defined(__riscv_plic__)
/* PLIC initialization. */
void plic_init(void)
@ -119,6 +105,21 @@ void isr(void)
}
}
/*************************************/
/* ISR Handling for BlackParrot CPU. */
/*************************************/
#elif defined(__blackparrot__) /*TODO: Update this function for BP.*/
void isr(void)
{
static int onetime = 0;
if (onetime == 0) {
printf("ISR blackparrot\n");
printf("TRAP!!\n");
onetime++;
}
}
/***********************************/
/* ISR Handling for Microwatt CPU. */
/***********************************/