Scroll to navigation

CXL_MMIO_MAP(3) CXL Programmer's Manual CXL_MMIO_MAP(3)

NAME

cxl_mmio_map - map the per-process Problem State Area of an AFU to memory

SYNOPSIS

#include <libcxl.h>

int cxl_mmio_map(struct cxl_afu_h *afu, __u32 flag);

DESCRIPTION

cxl_mmio_map() maps the per-process Problem State Area of afu to the current process memory, and declares AFU endianness according to flag. The size and contents of this area are specific each AFU. The size can be discovered with cxl_get_mmio_size().

In AFU directed mode, master contexts are allowed to map all of the MMIO space and slave contexts are allowed to only map the per process MMIO space associated with the context. In dedicated process mode the entire MMIO space can always be mapped.

The possible values of flag are:

AFU data is big-endian
AFU data is little-endian
AFU uses the same endianness as host.

Subsequent cxl_mmio_read32(), cxl_mmio_read64(), cxl_mmio_write32() and cxl_mmio_write64() will honor flag and swap bytes on behalf of the application when required. Only 32 and 64-bit accesses are supported by POWER8 and POWER9.

RETURN VALUE

On success, 0 is returned. On error, -1 is returned and errno is set appropriately.

ERRORS

Invalid argument value, or AFU does not support MMIO space.
AFU context is not attached.
AFU not opened, or missing flags.
Insufficient memory.

FILES

/dev/cxl/afu<i>.<j>d
AFU device in dedicated process mode.
/dev/cxl/afu<i>.<j>m
AFU device in AFU directed mode, master context.
/dev/cxl/afu<i>.<j>s
AFU device in AFU directed mode, slave context.

SEE ALSO

cxl(3), cxl_afu_attach(3), cxl_afu_attach_full(3), cxl_afu_attach_work(3), cxl_get_mmio_size(3), cxl_mmio_ptr(3), cxl_mmio_read32(3), cxl_mmio_read64(3), cxl_mmio_unmap(3), cxl_mmio_write32(3), cxl_mmio_write64(3), mmap(3)

2017-05-24 LIBCXL 1.5