Skip to content

Commit

Permalink
[sw/lib] add CLINT msi get function
Browse files Browse the repository at this point in the history
  • Loading branch information
stnolting committed Dec 30, 2024
1 parent c3bee7e commit adce426
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions sw/lib/include/neorv32_clint.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ typedef volatile struct __attribute__((packed,aligned(4))) {
int neorv32_clint_available(void);
void neorv32_clint_msi_set(int hart);
void neorv32_clint_msi_clr(int hart);
uint32_t neorv32_clint_msi_get(int hart);
void neorv32_clint_time_set(uint64_t time);
uint64_t neorv32_clint_time_get(void);
void neorv32_clint_mtimecmp_set(int hart, uint64_t timecmp);
Expand Down
11 changes: 11 additions & 0 deletions sw/lib/source/neorv32_clint.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ void neorv32_clint_msi_clr(int hart) {
}


/**********************************************************************//**
* Get machine software interrupt register.
*
* @param[in] hart Hart index (0..4094).
**************************************************************************/
uint32_t neorv32_clint_msi_get(int hart) {

return NEORV32_CLINT->MSWI[hart & 0xfff];
}


/**********************************************************************//**
* Set current CLINT system time.
*
Expand Down

0 comments on commit adce426

Please sign in to comment.