MMIO(9) Hyra Kernel Developer’s Manual MMIO(9)

NAME

mmio - hyra MMIO interface

SYNOPSIS

#include <sys/mmio.h>

static inline void mmio_write8(void *addr, uint8_t val);
static inline void mmio_write16(void *addr, uint16_t val);
static inline void mmio_write32(void *addr, uint32_t val);
#if __SIZEOF_SIZE_T__ == 8
static inline void mmio_write64(void *addr, uint64_t val);
#endif
__extension__

DESCRIPTION

In short, MMIO is a method of writing to registers of an I/O device via a mapped porition of memory. MMIO should NOT be done on your own when doing Hyra kernel programming. Instead, rely on Hyra’s MMIO interface and use mmio_read<n>() and mmio_write<n>() functions. Where ’n’ is 8 to 32 on 32-bit machines, and to 64 on 64-bit machines.

The addr argument can be either a physical address or virtual address; however, it is recommended to use virtual addresses for the sake of consistency.

AUTHORS

Ian Moffett <ian@osmora.org>

Hyra Jan 12 2024 Hyra