1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2 /* Copyright 2017 IBM Corp. */
3 #ifndef _UAPI_MISC_OCXL_H
4 #define _UAPI_MISC_OCXL_H
6 #include <linux/types.h>
7 #include <linux/ioctl.h>
10 OCXL_AFU_EVENT_XSL_FAULT_ERROR = 0,
13 #define OCXL_KERNEL_EVENT_FLAG_LAST 0x0001 /* This is the last event pending */
15 struct ocxl_kernel_event_header {
21 struct ocxl_kernel_event_xsl_fault_error {
28 struct ocxl_ioctl_attach {
35 struct ocxl_ioctl_metadata {
36 __u16 version; // struct version, always backwards compatible
39 __u8 afu_version_major;
40 __u8 afu_version_minor;
41 __u32 pasid; // PASID assigned to the current context
43 __u64 pp_mmio_size; // Per PASID MMIO size
44 __u64 global_mmio_size;
46 // End version 0 fields
48 __u64 reserved[13]; // Total of 16*u64
51 struct ocxl_ioctl_irq_fd {
58 #define OCXL_MAGIC 0xCA
60 #define OCXL_IOCTL_ATTACH _IOW(OCXL_MAGIC, 0x10, struct ocxl_ioctl_attach)
61 #define OCXL_IOCTL_IRQ_ALLOC _IOR(OCXL_MAGIC, 0x11, __u64)
62 #define OCXL_IOCTL_IRQ_FREE _IOW(OCXL_MAGIC, 0x12, __u64)
63 #define OCXL_IOCTL_IRQ_SET_FD _IOW(OCXL_MAGIC, 0x13, struct ocxl_ioctl_irq_fd)
64 #define OCXL_IOCTL_GET_METADATA _IOR(OCXL_MAGIC, 0x14, struct ocxl_ioctl_metadata)
66 #endif /* _UAPI_MISC_OCXL_H */