Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/risc-v/include/fe310/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

#define MSTATUS_MIE (0x1 << 3) /* Machine Interrupt Enable */
#define MSTATUS_MPIE (0x1 << 7) /* Machine Previous Interrupt Enable */
#define MSTATUS_MPPM (0x3 << 11) /* Machine Previous Privilege (m-mode) */

/* In mie (machine interrupt enable) register */

Expand Down
6 changes: 5 additions & 1 deletion arch/risc-v/src/fe310/fe310_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ void up_enable_irq(int irq)

uint32_t up_get_newintctx(void)
{
return (MSTATUS_MPIE | MSTATUS_MIE);
/* Set machine previous privilege mode to machine mode.
* Also set machine previous interrupt enable
*/

return (MSTATUS_MPPM | MSTATUS_MPIE);
}

/****************************************************************************
Expand Down
4 changes: 0 additions & 4 deletions arch/risc-v/src/fe310/fe310_irq_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ void *fe310_dispatch_irq(uint32_t vector, uint32_t *regs)
regs = (uint32_t *)g_current_regs;
g_current_regs = NULL;

/* Set machine previous privilege mode to machine mode */

*(regs + REG_INT_CTX_NDX) |= 0x3 << 11;

return regs;
}