0001
0002
0003 #ifndef _UAPI_MISC_OCXL_H
0004 #define _UAPI_MISC_OCXL_H
0005
0006 #include <linux/types.h>
0007 #include <linux/ioctl.h>
0008
0009 enum ocxl_event_type {
0010 OCXL_AFU_EVENT_XSL_FAULT_ERROR = 0,
0011 };
0012
0013 #define OCXL_KERNEL_EVENT_FLAG_LAST 0x0001
0014
0015 struct ocxl_kernel_event_header {
0016 __u16 type;
0017 __u16 flags;
0018 __u32 reserved;
0019 };
0020
0021 struct ocxl_kernel_event_xsl_fault_error {
0022 __u64 addr;
0023 __u64 dsisr;
0024 __u64 count;
0025 __u64 reserved;
0026 };
0027
0028 struct ocxl_ioctl_attach {
0029 __u64 amr;
0030 __u64 reserved1;
0031 __u64 reserved2;
0032 __u64 reserved3;
0033 };
0034
0035 struct ocxl_ioctl_metadata {
0036 __u16 version;
0037
0038
0039 __u8 afu_version_major;
0040 __u8 afu_version_minor;
0041 __u32 pasid;
0042
0043 __u64 pp_mmio_size;
0044 __u64 global_mmio_size;
0045
0046
0047
0048 __u64 reserved[13];
0049 };
0050
0051 struct ocxl_ioctl_p9_wait {
0052 __u16 thread_id;
0053 __u16 reserved1;
0054 __u32 reserved2;
0055 __u64 reserved3[3];
0056 };
0057
0058 #define OCXL_IOCTL_FEATURES_FLAGS0_P9_WAIT 0x01
0059 struct ocxl_ioctl_features {
0060 __u64 flags[4];
0061 };
0062
0063 struct ocxl_ioctl_irq_fd {
0064 __u64 irq_offset;
0065 __s32 eventfd;
0066 __u32 reserved;
0067 };
0068
0069
0070 #define OCXL_MAGIC 0xCA
0071
0072 #define OCXL_IOCTL_ATTACH _IOW(OCXL_MAGIC, 0x10, struct ocxl_ioctl_attach)
0073 #define OCXL_IOCTL_IRQ_ALLOC _IOR(OCXL_MAGIC, 0x11, __u64)
0074 #define OCXL_IOCTL_IRQ_FREE _IOW(OCXL_MAGIC, 0x12, __u64)
0075 #define OCXL_IOCTL_IRQ_SET_FD _IOW(OCXL_MAGIC, 0x13, struct ocxl_ioctl_irq_fd)
0076 #define OCXL_IOCTL_GET_METADATA _IOR(OCXL_MAGIC, 0x14, struct ocxl_ioctl_metadata)
0077 #define OCXL_IOCTL_ENABLE_P9_WAIT _IOR(OCXL_MAGIC, 0x15, struct ocxl_ioctl_p9_wait)
0078 #define OCXL_IOCTL_GET_FEATURES _IOR(OCXL_MAGIC, 0x16, struct ocxl_ioctl_features)
0079
0080 #endif