Scroll to navigation

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

NAME

cxl_afu_attach_full - attach the calling process's memory to an open AFU

SYNOPSIS

#include <libcxl.h>

int cxl_afu_attach_full(struct cxl_afu_h *afu, __u64 wed, __u16 num_interrupts, __u64 amr);

DESCRIPTION

cxl_afu_attach_full() attaches a context of afu to the current process, specifies wed as the initial work element descriptor, requests num_interrupts, sets the authority mask register amr, and starts the AFU context.

On success, all memory mapped into this process is accessible to the AFU context using the same effective addresses. No additional calls are required to map/unmap memory. The AFU memory context will be updated as userspace allocates and frees memory.

The work element descriptor wed is a 64-bit argument defined by the AFU. Typically this is an effective address pointing to an AFU specific structure describing what work to perform.

The number of requested userspace interrupts num_interrupts must be in the range defined by cxl_get_irqs_min() and cxl_get_irqs_max().

The authority mask register amr is the same as the powerpc AMR.

RETURN VALUE

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

ERRORS

Invalid argument value, or AFU not opened.
Not enough memory.
Not enough interrupts available.

SEE ALSO

cxl(3), cxl_afu_attach(3), cxl_afu_attach_work(3), cxl_afu_fd_to_h(3), cxl_afu_free(3), cxl_afu_open_dev(3), cxl_afu_opened(3), cxl_get_irqs_max(3), cxl_get_irqs_min(3), cxl_get_prefault_mode(3), cxl_mmio_map(3), cxl_set_irqs_max(3), cxl_set_mode(3), cxl_set_prefault_mode(3)

2017-05-24 LIBCXL 1.5