]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hal_irq.c
Microsemi RISC-V project:
[freertos] / FreeRTOS / Demo / RISC-V_IGLOO2_Creative_SoftConsole / Microsemi_Code / hal / hal_irq.c
1 /***************************************************************************//**\r
2  * (c) Copyright 2007-2018 Microsemi SoC Products Group. All rights reserved.\r
3  * \r
4  * Legacy interrupt control functions for the Microsemi driver library hardware\r
5  * abstraction layer.\r
6  *\r
7  * SVN $Revision: 9661 $\r
8  * SVN $Date: 2018-01-15 16:13:33 +0530 (Mon, 15 Jan 2018) $\r
9  */\r
10 #include "hal.h"\r
11 #include "riscv_hal.h"\r
12 \r
13 /*------------------------------------------------------------------------------\r
14  * \r
15  */\r
16 void HAL_enable_interrupts(void) {\r
17     __enable_irq();\r
18 }\r
19 \r
20 /*------------------------------------------------------------------------------\r
21  * \r
22  */\r
23 psr_t HAL_disable_interrupts(void) {\r
24     psr_t psr;\r
25     psr = read_csr(mstatus);\r
26     __disable_irq();\r
27     return(psr);\r
28 }\r
29 \r
30 /*------------------------------------------------------------------------------\r
31  * \r
32  */\r
33 void HAL_restore_interrupts(psr_t saved_psr) {\r
34     write_csr(mstatus, saved_psr);\r
35 }\r
36 \r