mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
![Frederic Barrat](/assets/img/avatar_default.png)
Add user APIs through ioctl to allocate, free, and be notified of an AFU interrupt. For opencapi, an AFU can trigger an interrupt on the host by sending a specific command targeting a 64-bit object handle. On POWER9, this is implemented by mapping a special page in the address space of a process and a write to that page will trigger an interrupt. Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
49 lines
1.1 KiB
C
49 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
|
|
/* Copyright 2017 IBM Corp. */
|
|
#ifndef _UAPI_MISC_OCXL_H
|
|
#define _UAPI_MISC_OCXL_H
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/ioctl.h>
|
|
|
|
enum ocxl_event_type {
|
|
OCXL_AFU_EVENT_XSL_FAULT_ERROR = 0,
|
|
};
|
|
|
|
#define OCXL_KERNEL_EVENT_FLAG_LAST 0x0001 /* This is the last event pending */
|
|
|
|
struct ocxl_kernel_event_header {
|
|
__u16 type;
|
|
__u16 flags;
|
|
__u32 reserved;
|
|
};
|
|
|
|
struct ocxl_kernel_event_xsl_fault_error {
|
|
__u64 addr;
|
|
__u64 dsisr;
|
|
__u64 count;
|
|
__u64 reserved;
|
|
};
|
|
|
|
struct ocxl_ioctl_attach {
|
|
__u64 amr;
|
|
__u64 reserved1;
|
|
__u64 reserved2;
|
|
__u64 reserved3;
|
|
};
|
|
|
|
struct ocxl_ioctl_irq_fd {
|
|
__u64 irq_offset;
|
|
__s32 eventfd;
|
|
__u32 reserved;
|
|
};
|
|
|
|
/* ioctl numbers */
|
|
#define OCXL_MAGIC 0xCA
|
|
/* AFU devices */
|
|
#define OCXL_IOCTL_ATTACH _IOW(OCXL_MAGIC, 0x10, struct ocxl_ioctl_attach)
|
|
#define OCXL_IOCTL_IRQ_ALLOC _IOR(OCXL_MAGIC, 0x11, __u64)
|
|
#define OCXL_IOCTL_IRQ_FREE _IOW(OCXL_MAGIC, 0x12, __u64)
|
|
#define OCXL_IOCTL_IRQ_SET_FD _IOW(OCXL_MAGIC, 0x13, struct ocxl_ioctl_irq_fd)
|
|
|
|
#endif /* _UAPI_MISC_OCXL_H */
|