]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1-RevB_FreedomStudio/bsp/install/include/metal/compiler.h
Rename RISC-V_RV32_SiFive_HiFive1-FreedomStudio directory to RISC-V_RV32_SiFive_HiFiv...
[freertos] / FreeRTOS / Demo / RISC-V_RV32_SiFive_HiFive1-RevB_FreedomStudio / bsp / install / include / metal / compiler.h
1 /* Copyright 2018 SiFive, Inc */
2 /* SPDX-License-Identifier: Apache-2.0 */
3
4 #ifndef METAL__COMPILER_H
5 #define METAL__COMPILER_H
6
7 #define __METAL_DECLARE_VTABLE(type)                      \
8     extern const struct type type;                        
9
10 #define __METAL_DEFINE_VTABLE(type)                       \
11     const struct type type                                
12
13 #define __METAL_GET_FIELD(reg, mask)                        \
14     (((reg) & (mask)) / ((mask) & ~((mask) << 1)))
15
16 /* Set field with mask for a given value */
17 #define __METAL_SET_FIELD(reg, mask, val) \
18         (((reg) & ~(mask)) | (((val) * ((mask) & ~((mask) << 1))) & (mask)))
19
20 void _metal_trap(int ecode);
21
22 #endif