mmio: add functions for 1 and 2 byte I/O accesses
Change-Id: I7a325ddd8db3424207cf2e561c6d6e894f549989 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/382073 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
This commit is contained in:
parent
201c0188ac
commit
15e978340d
@ -52,6 +52,34 @@ extern "C" {
|
||||
#define SPDK_MMIO_64BIT 0
|
||||
#endif
|
||||
|
||||
static inline uint8_t
|
||||
spdk_mmio_read_1(const volatile uint8_t *addr)
|
||||
{
|
||||
spdk_compiler_barrier();
|
||||
return *addr;
|
||||
}
|
||||
|
||||
static inline void
|
||||
spdk_mmio_write_1(volatile uint8_t *addr, uint8_t val)
|
||||
{
|
||||
spdk_compiler_barrier();
|
||||
*addr = val;
|
||||
}
|
||||
|
||||
static inline uint16_t
|
||||
spdk_mmio_read_2(const volatile uint16_t *addr)
|
||||
{
|
||||
spdk_compiler_barrier();
|
||||
return *addr;
|
||||
}
|
||||
|
||||
static inline void
|
||||
spdk_mmio_write_2(volatile uint16_t *addr, uint16_t val)
|
||||
{
|
||||
spdk_compiler_barrier();
|
||||
*addr = val;
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
spdk_mmio_read_4(const volatile uint32_t *addr)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user