CXL_AFU_HOST_THREAD_WAIT(3)

NAME
cxl_afu_host_thread_wait - wait for AFU notification

SYNOPSIS
#include <libcxl.h>

int afu_host_thread_wait(struct cxl_afu_h *afu, volatile __u64 *uword);

DESCRIPTION
The tunneled operation as_notify is supported on POWER9. See cxl_get_tunneled_ops_supported().

The thread calling afu_host_thread_wait() executes the instruction "wait" and goes to sleep. It will resume execution upon receiving an interrupt or an afu notification. It will then check the value of the shared memory word pointed to by uword. The thread will loop and sleep again while the value of uword is equal to zero. It will return from afu_host_thread_wait() when the value of uword becomes different from zero.

The thread calling afu_host_thread_wait() must have attached an afu context to a work structure with cxl_afu_attach_work() The work structure must have been wait-enabled with cxl_work_enable_wait().

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

ERRORS

EINVAL
    Invalid argument value

EPERM
    AFU context not attached by current thread, or wait not enabled

SEE ALSO
cxl(3), cxl_afu_attach_work(3), cxl_afu_host_thread_wait(3), cxl_get_tunneled_ops_supported(3), cxl_work_disable_wait(3), cxl_work_enable_wait(3), cxl_work_get_tid(3)