summaryrefslogtreecommitdiffstats
path: root/include/misc
diff options
context:
space:
mode:
authorAlastair D'Silva <alastair@d-silva.org>2019-03-27 01:31:35 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2019-05-02 12:55:02 -0400
commit060146614643ddc5978c73ffac0329762b4651c9 (patch)
treefadce4dba8407fb471b947eb85223f3f000fb4de /include/misc
parent2ec3b7ed2ab8e07fdb5f800ff420e94dec75435f (diff)
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/misc')
-rw-r--r--include/misc/ocxl.h46
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,
155 */ 155 */
156int ocxl_context_detach(struct ocxl_context *ctx); 156int ocxl_context_detach(struct ocxl_context *ctx);
157 157
158// AFU IRQs
159
160/**
161 * Allocate an IRQ associated with an AFU context
162 * @ctx: the AFU context
163 * @irq_id: out, the IRQ ID
164 *
165 * Returns 0 on success, negative on failure
166 */
167extern int ocxl_afu_irq_alloc(struct ocxl_context *ctx, int *irq_id);
168
169/**
170 * Frees an IRQ associated with an AFU context
171 * @ctx: the AFU context
172 * @irq_id: the IRQ ID
173 *
174 * Returns 0 on success, negative on failure
175 */
176extern int ocxl_afu_irq_free(struct ocxl_context *ctx, int irq_id);
177
178/**
179 * Gets the address of the trigger page for an IRQ
180 * This can then be provided to an AFU which will write to that
181 * page to trigger the IRQ.
182 * @ctx: The AFU context that the IRQ is associated with
183 * @irq_id: The IRQ ID
184 *
185 * returns the trigger page address, or 0 if the IRQ is not valid
186 */
187extern u64 ocxl_afu_irq_get_addr(struct ocxl_context *ctx, int irq_id);
188
189/**
190 * Provide a callback to be called when an IRQ is triggered
191 * @ctx: The AFU context that the IRQ is associated with
192 * @irq_id: The IRQ ID
193 * @handler: the callback to be called when the IRQ is triggered
194 * @free_private: the callback to be called when the IRQ is freed (may be NULL)
195 * @private: Private data to be passed to the callbacks
196 *
197 * Returns 0 on success, negative on failure
198 */
199int ocxl_irq_set_handler(struct ocxl_context *ctx, int irq_id,
200 irqreturn_t (*handler)(void *private),
201 void (*free_private)(void *private),
202 void *private);
203
158// AFU Metadata 204// AFU Metadata
159 205
160/** 206/**