Skip to content
Snippets Groups Projects
Unverified Commit 58c6f0e7 authored by recallmenot's avatar recallmenot Committed by GitHub
Browse files

add zicsr support to __enable_irq and __disable_irq

parent 571c6985
No related branches found
No related tags found
No related merge requests found
......@@ -4474,7 +4474,11 @@ RV_STATIC_INLINE void __enable_irq()
{
uint32_t result;
__asm volatile("csrr %0," "mstatus": "=r"(result));
__asm volatile(
#if __GNUC__ > 10
".option arch, +zicsr\n"
#endif
"csrr %0," "mstatus": "=r"(result));
result |= 0x88;
__asm volatile ("csrw mstatus, %0" : : "r" (result) );
}
......@@ -4490,7 +4494,11 @@ RV_STATIC_INLINE void __disable_irq()
{
uint32_t result;
__asm volatile("csrr %0," "mstatus": "=r"(result));
__asm volatile(
#if __GNUC__ > 10
".option arch, +zicsr\n"
#endif
"csrr %0," "mstatus": "=r"(result));
result &= ~0x88;
__asm volatile ("csrw mstatus, %0" : : "r" (result) );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment