libmetal
Functions | Variables
io.c File Reference
#include <metal/cache.h>
#include <metal/io.h>
#include <nuttx/arch.h>

Functions

static uint64_t metal_io_read_ (struct metal_io_region *io, unsigned long offset, memory_order order, int width)
 
static void metal_io_write_ (struct metal_io_region *io, unsigned long offset, uint64_t value, memory_order order, int width)
 
static int metal_io_block_read_ (struct metal_io_region *io, unsigned long offset, void *restrict dst, memory_order order, int len)
 
static int metal_io_block_write_ (struct metal_io_region *io, unsigned long offset, const void *restrict src, memory_order order, int len)
 
static void metal_io_block_set_ (struct metal_io_region *io, unsigned long offset, unsigned char value, memory_order order, int len)
 
static void metal_io_close_ (struct metal_io_region *io)
 
static metal_phys_addr_t metal_io_offset_to_phys_ (struct metal_io_region *io, unsigned long offset)
 
static unsigned long metal_io_phys_to_offset_ (struct metal_io_region *io, metal_phys_addr_t phys)
 
struct metal_io_opsmetal_io_get_ops (void)
 Get the default global io ops. More...
 
struct metal_io_regionmetal_io_get_region (void)
 Get the default global io region. More...
 

Variables

static metal_phys_addr_t metal_io_phys_start_
 
static struct metal_io_region metal_io_region_
 

Function Documentation

◆ metal_io_block_read_()

static int metal_io_block_read_ ( struct metal_io_region io,
unsigned long  offset,
void *restrict  dst,
memory_order  order,
int  len 
)
static

◆ metal_io_block_set_()

static void metal_io_block_set_ ( struct metal_io_region io,
unsigned long  offset,
unsigned char  value,
memory_order  order,
int  len 
)
static

◆ metal_io_block_write_()

static int metal_io_block_write_ ( struct metal_io_region io,
unsigned long  offset,
const void *restrict  src,
memory_order  order,
int  len 
)
static

◆ metal_io_close_()

static void metal_io_close_ ( struct metal_io_region io)
static

◆ metal_io_get_ops()

struct metal_io_ops* metal_io_get_ops ( void  )

Get the default global io ops.

Returns
an io ops.

◆ metal_io_get_region()

struct metal_io_region* metal_io_get_region ( void  )

Get the default global io region.

Returns
an io region.

◆ metal_io_offset_to_phys_()

static metal_phys_addr_t metal_io_offset_to_phys_ ( struct metal_io_region io,
unsigned long  offset 
)
static

◆ metal_io_phys_to_offset_()

static unsigned long metal_io_phys_to_offset_ ( struct metal_io_region io,
metal_phys_addr_t  phys 
)
static

◆ metal_io_read_()

static uint64_t metal_io_read_ ( struct metal_io_region io,
unsigned long  offset,
memory_order  order,
int  width 
)
static

◆ metal_io_write_()

static void metal_io_write_ ( struct metal_io_region io,
unsigned long  offset,
uint64_t  value,
memory_order  order,
int  width 
)
static

Variable Documentation

◆ metal_io_phys_start_

metal_phys_addr_t metal_io_phys_start_
static

◆ metal_io_region_

struct metal_io_region metal_io_region_
static
Initial value:
= {
.virt = NULL,
.physmap = &metal_io_phys_start_,
.size = (size_t)-1,
.page_shift = sizeof(metal_phys_addr_t) * CHAR_BIT,
.page_mask = (metal_phys_addr_t)-1,
.mem_flags = 0,
.ops = {
.read = metal_io_read_,
.write = metal_io_write_,
.block_read = metal_io_block_read_,
.block_write = metal_io_block_write_,
.block_set = metal_io_block_set_,
.close = metal_io_close_,
.offset_to_phys = metal_io_offset_to_phys_,
.phys_to_offset = metal_io_phys_to_offset_,
},
}
unsigned long metal_phys_addr_t
Definition: sys.h:30
static int metal_io_block_read_(struct metal_io_region *io, unsigned long offset, void *restrict dst, memory_order order, int len)
Definition: io.c:31
static unsigned long metal_io_phys_to_offset_(struct metal_io_region *io, metal_phys_addr_t phys)
Definition: io.c:81
static void metal_io_write_(struct metal_io_region *io, unsigned long offset, uint64_t value, memory_order order, int width)
Definition: io.c:22
static metal_phys_addr_t metal_io_phys_start_
Definition: io.c:87
static uint64_t metal_io_read_(struct metal_io_region *io, unsigned long offset, memory_order order, int width)
Definition: io.c:11
static int metal_io_block_write_(struct metal_io_region *io, unsigned long offset, const void *restrict src, memory_order order, int len)
Definition: io.c:45
static metal_phys_addr_t metal_io_offset_to_phys_(struct metal_io_region *io, unsigned long offset)
Definition: io.c:75
static void metal_io_close_(struct metal_io_region *io)
Definition: io.c:71
static void metal_io_block_set_(struct metal_io_region *io, unsigned long offset, unsigned char value, memory_order order, int len)
Definition: io.c:59