- bullseye 1.7-2+b1
|CXL_MMIO_READ64(3)||CXL Programmer's Manual||CXL_MMIO_READ64(3)|
cxl_mmio_read64 - read a 64-bit word from the mapped AFU Problem State Area
int cxl_mmio_read64(struct cxl_afu_h *afu, uint64_t offset, uint64_t *data);
cxl_mmio_read64() reads the 64-bit word at offset from the address of the mapped Problem State Area of afu, and copies its value to the word pointed to by data. The copy will include byte swapping if the AFU endianness declared by cxl_mmio_map() differs from the host endianness.
offset is a byte address, aligned on a double word (8-byte) boundary. It must be lower than the MMIO size returned by cxl_get_mmio_size(). The address of the mapped MMIO space is returned by cxl_mmio_ptr().
If the MMIO access fails due to an IO error, a SIGBUS may be sent to the application, which would ordinarily result in the process being terminated. libcxl provides an optional SIGBUS handler, which can be installed with cxl_mmio_install_sigbus_handler(). Installing this signal handler prior to using the MMIO accessor functions will cause them to return -1 and set errno to EIO in the event of an IO error. Additionally, if this handler has NOT been installed, the cxl_mmio_read* functions will raise a SIGBUS in the event that they detect an IO error due to a read of all F's for consistency.
On success, 0 is returned. On error, -1 is returned and errno is set appropriately.
cxl(3), cxl_get_mmio_size(3), cxl_mmio_install_sigbus_handler(3), cxl_mmio_map(3), cxl_mmio_ptr(3), cxl_mmio_read32(3), cxl_mmio_unmap(3), cxl_mmio_write32(3), cxl_mmio_write64(3)