122851890Sopenharmony_ci/****************************************************************************
222851890Sopenharmony_ci ****************************************************************************
322851890Sopenharmony_ci ***
422851890Sopenharmony_ci ***   This header was automatically generated from a Linux kernel header
522851890Sopenharmony_ci ***   of the same name, to make information necessary for userspace to
622851890Sopenharmony_ci ***   call into the kernel available to libc.  It contains only constants,
722851890Sopenharmony_ci ***   structures, and macros generated from the original header, and thus,
822851890Sopenharmony_ci ***   contains no copyrightable information.
922851890Sopenharmony_ci ***
1022851890Sopenharmony_ci ***   To edit the content of this header, modify the corresponding
1122851890Sopenharmony_ci ***   source file (e.g. under external/kernel-headers/original/) then
1222851890Sopenharmony_ci ***   run bionic/libc/kernel/tools/update_all.py
1322851890Sopenharmony_ci ***
1422851890Sopenharmony_ci ***   Any manual change here will be lost the next time this script will
1522851890Sopenharmony_ci ***   be run. You've been warned!
1622851890Sopenharmony_ci ***
1722851890Sopenharmony_ci ****************************************************************************
1822851890Sopenharmony_ci ****************************************************************************/
1922851890Sopenharmony_ci#ifndef _UAPI_MISC_OCXL_H
2022851890Sopenharmony_ci#define _UAPI_MISC_OCXL_H
2122851890Sopenharmony_ci#include <linux/types.h>
2222851890Sopenharmony_ci#include <linux/ioctl.h>
2322851890Sopenharmony_cienum ocxl_event_type {
2422851890Sopenharmony_ci  OCXL_AFU_EVENT_XSL_FAULT_ERROR = 0,
2522851890Sopenharmony_ci};
2622851890Sopenharmony_ci#define OCXL_KERNEL_EVENT_FLAG_LAST 0x0001
2722851890Sopenharmony_cistruct ocxl_kernel_event_header {
2822851890Sopenharmony_ci  __u16 type;
2922851890Sopenharmony_ci  __u16 flags;
3022851890Sopenharmony_ci  __u32 reserved;
3122851890Sopenharmony_ci};
3222851890Sopenharmony_cistruct ocxl_kernel_event_xsl_fault_error {
3322851890Sopenharmony_ci  __u64 addr;
3422851890Sopenharmony_ci  __u64 dsisr;
3522851890Sopenharmony_ci  __u64 count;
3622851890Sopenharmony_ci  __u64 reserved;
3722851890Sopenharmony_ci};
3822851890Sopenharmony_cistruct ocxl_ioctl_attach {
3922851890Sopenharmony_ci  __u64 amr;
4022851890Sopenharmony_ci  __u64 reserved1;
4122851890Sopenharmony_ci  __u64 reserved2;
4222851890Sopenharmony_ci  __u64 reserved3;
4322851890Sopenharmony_ci};
4422851890Sopenharmony_cistruct ocxl_ioctl_metadata {
4522851890Sopenharmony_ci  __u16 version;
4622851890Sopenharmony_ci  __u8 afu_version_major;
4722851890Sopenharmony_ci  __u8 afu_version_minor;
4822851890Sopenharmony_ci  __u32 pasid;
4922851890Sopenharmony_ci  __u64 pp_mmio_size;
5022851890Sopenharmony_ci  __u64 global_mmio_size;
5122851890Sopenharmony_ci  __u64 reserved[13];
5222851890Sopenharmony_ci};
5322851890Sopenharmony_cistruct ocxl_ioctl_p9_wait {
5422851890Sopenharmony_ci  __u16 thread_id;
5522851890Sopenharmony_ci  __u16 reserved1;
5622851890Sopenharmony_ci  __u32 reserved2;
5722851890Sopenharmony_ci  __u64 reserved3[3];
5822851890Sopenharmony_ci};
5922851890Sopenharmony_ci#define OCXL_IOCTL_FEATURES_FLAGS0_P9_WAIT 0x01
6022851890Sopenharmony_cistruct ocxl_ioctl_features {
6122851890Sopenharmony_ci  __u64 flags[4];
6222851890Sopenharmony_ci};
6322851890Sopenharmony_cistruct ocxl_ioctl_irq_fd {
6422851890Sopenharmony_ci  __u64 irq_offset;
6522851890Sopenharmony_ci  __s32 eventfd;
6622851890Sopenharmony_ci  __u32 reserved;
6722851890Sopenharmony_ci};
6822851890Sopenharmony_ci#define OCXL_MAGIC 0xCA
6922851890Sopenharmony_ci#define OCXL_IOCTL_ATTACH _IOW(OCXL_MAGIC, 0x10, struct ocxl_ioctl_attach)
7022851890Sopenharmony_ci#define OCXL_IOCTL_IRQ_ALLOC _IOR(OCXL_MAGIC, 0x11, __u64)
7122851890Sopenharmony_ci#define OCXL_IOCTL_IRQ_FREE _IOW(OCXL_MAGIC, 0x12, __u64)
7222851890Sopenharmony_ci#define OCXL_IOCTL_IRQ_SET_FD _IOW(OCXL_MAGIC, 0x13, struct ocxl_ioctl_irq_fd)
7322851890Sopenharmony_ci#define OCXL_IOCTL_GET_METADATA _IOR(OCXL_MAGIC, 0x14, struct ocxl_ioctl_metadata)
7422851890Sopenharmony_ci#define OCXL_IOCTL_ENABLE_P9_WAIT _IOR(OCXL_MAGIC, 0x15, struct ocxl_ioctl_p9_wait)
7522851890Sopenharmony_ci#define OCXL_IOCTL_GET_FEATURES _IOR(OCXL_MAGIC, 0x16, struct ocxl_ioctl_features)
7622851890Sopenharmony_ci#endif
77