.\" Copyright 2015-2017 IBM Corp. .\" .TH CXL_AFU_ATTACH 3 2017-05-24 "LIBCXL 1.5" "CXL Programmer's Manual" .SH NAME cxl_afu_attach \- attach the calling process's memory to an open AFU .SH SYNOPSIS .B #include .PP .B "int cxl_afu_attach(struct cxl_afu_h" .BI * afu ", __u64 " wed ); .SH DESCRIPTION .BR cxl_afu_attach () attaches a context of .I afu to the current process, specifies .I wed as the initial work element descriptor, and starts the AFU context. .PP 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. .PP The work element descriptor .I 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. .PP The minimum number of userspace interrupts required by the AFU will be allocated. This value is returned by .BR cxl_get_irqs_min (). .SH RETURN VALUE On success, 0 is returned. On error, \-1 is returned and .I errno is set appropriately. .SH ERRORS .TP .B EINVAL Invalid argument value, or AFU not opened. .TP .B ENOMEM Not enough memory. .TP .B ENOSPC Not enough interrupts available. .SH SEE ALSO .BR cxl (3), .BR cxl_afu_attach_full (3), .BR cxl_afu_attach_work (3), .BR cxl_afu_fd_to_h (3), .BR cxl_afu_free (3), .BR cxl_afu_open_dev (3), .BR cxl_afu_opened (3), .BR cxl_get_irqs_max (3), .BR cxl_get_irqs_min (3), .BR cxl_get_prefault_mode (3), .BR cxl_mmio_map (3), .BR cxl_set_mode (3), .BR cxl_set_prefault_mode (3)