]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_FreedomStudio/freedom-metal/metal/io.h
Update RISCC-V-RV32-SiFive_HiFive1_FreedomStudio project to latest tools and metal...
[freertos] / FreeRTOS / Demo / RISC-V_RV32_SiFive_HiFive1_FreedomStudio / freedom-metal / metal / io.h
1 /* Copyright 2018 SiFive, Inc */
2 /* SPDX-License-Identifier: Apache-2.0 */
3
4 #ifndef METAL__IO_H
5 #define METAL__IO_H
6
7 /* This macro enforces that the compiler will not elide the given access. */
8 #define __METAL_ACCESS_ONCE(x) (*(__typeof__(*x) volatile *)(x))
9
10 /* Allows users to specify arbitrary fences. */
11 #define __METAL_IO_FENCE(pred, succ) __asm__ volatile ("fence " #pred "," #succ ::: "memory");
12
13 /* Types that explicitly describe an address as being used for memory-mapped
14  * IO.  These should only be accessed via __METAL_ACCESS_ONCE. */
15 typedef unsigned char  __metal_io_u8;
16 typedef unsigned short __metal_io_u16;
17 typedef unsigned int   __metal_io_u32;
18 #if __riscv_xlen >= 64
19 typedef unsigned long  __metal_io_u64;
20 #endif
21
22 #endif