diff options
author | Alastair D'Silva <alastair@d-silva.org> | 2019-03-27 06:31:35 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-05-02 18:55:02 +0200 |
commit | 060146614643ddc5978c73ffac0329762b4651c9 (patch) | |
tree | fadce4dba8407fb471b947eb85223f3f000fb4de /include | |
parent | ocxl: afu_irq only deals with IRQ IDs, not offsets (diff) | |
download | linux-060146614643ddc5978c73ffac0329762b4651c9.tar.xz linux-060146614643ddc5978c73ffac0329762b4651c9.zip |
ocxl: move event_fd handling to frontend
Event_fd is only used in the driver frontend, so it does not
need to exist in the backend code. Relocate it to the frontend
and provide an opaque mechanism for consumers instead.
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'include')
-rw-r--r-- | include/misc/ocxl.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/misc/ocxl.h b/include/misc/ocxl.h index e4704632eac5..dea93885a839 100644 --- a/include/misc/ocxl.h +++ b/include/misc/ocxl.h @@ -155,6 +155,52 @@ int ocxl_context_attach(struct ocxl_context *ctx, u64 amr, */ int ocxl_context_detach(struct ocxl_context *ctx); +// AFU IRQs + +/** + * Allocate an IRQ associated with an AFU context + * @ctx: the AFU context + * @irq_id: out, the IRQ ID + * + * Returns 0 on success, negative on failure + */ +extern int ocxl_afu_irq_alloc(struct ocxl_context *ctx, int *irq_id); + +/** + * Frees an IRQ associated with an AFU context + * @ctx: the AFU context + * @irq_id: the IRQ ID + * + * Returns 0 on success, negative on failure + */ +extern int ocxl_afu_irq_free(struct ocxl_context *ctx, int irq_id); + +/** + * Gets the address of the trigger page for an IRQ + * This can then be provided to an AFU which will write to that + * page to trigger the IRQ. + * @ctx: The AFU context that the IRQ is associated with + * @irq_id: The IRQ ID + * + * returns the trigger page address, or 0 if the IRQ is not valid + */ +extern u64 ocxl_afu_irq_get_addr(struct ocxl_context *ctx, int irq_id); + +/** + * Provide a callback to be called when an IRQ is triggered + * @ctx: The AFU context that the IRQ is associated with + * @irq_id: The IRQ ID + * @handler: the callback to be called when the IRQ is triggered + * @free_private: the callback to be called when the IRQ is freed (may be NULL) + * @private: Private data to be passed to the callbacks + * + * Returns 0 on success, negative on failure + */ +int ocxl_irq_set_handler(struct ocxl_context *ctx, int irq_id, + irqreturn_t (*handler)(void *private), + void (*free_private)(void *private), + void *private); + // AFU Metadata /** |