1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI_MISC_OCXL_H
20 #define _UAPI_MISC_OCXL_H
21 #include <linux/types.h>
22 #include <linux/ioctl.h>
23 enum ocxl_event_type {
24   OCXL_AFU_EVENT_XSL_FAULT_ERROR = 0,
25 };
26 #define OCXL_KERNEL_EVENT_FLAG_LAST 0x0001
27 struct ocxl_kernel_event_header {
28   __u16 type;
29   __u16 flags;
30   __u32 reserved;
31 };
32 struct ocxl_kernel_event_xsl_fault_error {
33   __u64 addr;
34   __u64 dsisr;
35   __u64 count;
36   __u64 reserved;
37 };
38 struct ocxl_ioctl_attach {
39   __u64 amr;
40   __u64 reserved1;
41   __u64 reserved2;
42   __u64 reserved3;
43 };
44 struct ocxl_ioctl_metadata {
45   __u16 version;
46   __u8 afu_version_major;
47   __u8 afu_version_minor;
48   __u32 pasid;
49   __u64 pp_mmio_size;
50   __u64 global_mmio_size;
51   __u64 reserved[13];
52 };
53 struct ocxl_ioctl_p9_wait {
54   __u16 thread_id;
55   __u16 reserved1;
56   __u32 reserved2;
57   __u64 reserved3[3];
58 };
59 #define OCXL_IOCTL_FEATURES_FLAGS0_P9_WAIT 0x01
60 struct ocxl_ioctl_features {
61   __u64 flags[4];
62 };
63 struct ocxl_ioctl_irq_fd {
64   __u64 irq_offset;
65   __s32 eventfd;
66   __u32 reserved;
67 };
68 #define OCXL_MAGIC 0xCA
69 #define OCXL_IOCTL_ATTACH _IOW(OCXL_MAGIC, 0x10, struct ocxl_ioctl_attach)
70 #define OCXL_IOCTL_IRQ_ALLOC _IOR(OCXL_MAGIC, 0x11, __u64)
71 #define OCXL_IOCTL_IRQ_FREE _IOW(OCXL_MAGIC, 0x12, __u64)
72 #define OCXL_IOCTL_IRQ_SET_FD _IOW(OCXL_MAGIC, 0x13, struct ocxl_ioctl_irq_fd)
73 #define OCXL_IOCTL_GET_METADATA _IOR(OCXL_MAGIC, 0x14, struct ocxl_ioctl_metadata)
74 #define OCXL_IOCTL_ENABLE_P9_WAIT _IOR(OCXL_MAGIC, 0x15, struct ocxl_ioctl_p9_wait)
75 #define OCXL_IOCTL_GET_FEATURES _IOR(OCXL_MAGIC, 0x16, struct ocxl_ioctl_features)
76 #endif
77