Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /* Copyright 2017 IBM Corp. */
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  /* This is the last event pending */
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; /* struct version, always backwards compatible */
0037 
0038     /* Version 0 fields */
0039     __u8  afu_version_major;
0040     __u8  afu_version_minor;
0041     __u32 pasid;        /* PASID assigned to the current context */
0042 
0043     __u64 pp_mmio_size; /* Per PASID MMIO size */
0044     __u64 global_mmio_size;
0045 
0046     /* End version 0 fields */
0047 
0048     __u64 reserved[13]; /* Total of 16*u64 */
0049 };
0050 
0051 struct ocxl_ioctl_p9_wait {
0052     __u16 thread_id; /* The thread ID required to wake this thread */
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 /* ioctl numbers */
0070 #define OCXL_MAGIC 0xCA
0071 /* AFU devices */
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 /* _UAPI_MISC_OCXL_H */