blob: 08329da27806bfd569f5688cea55d5a174caef1c [file] [log] [blame]
Christopher Ferris82d75042015-01-26 10:57:07 -08001/****************************************************************************
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_CXL_H
20#define _UAPI_MISC_CXL_H
21#include <linux/types.h>
22#include <linux/ioctl.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24struct cxl_ioctl_start_work {
Tao Baod7db5942015-01-28 10:07:51 -080025 __u64 flags;
26 __u64 work_element_descriptor;
27 __u64 amr;
Christopher Ferris82d75042015-01-26 10:57:07 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080029 __s16 num_interrupts;
30 __s16 reserved1;
31 __s32 reserved2;
32 __u64 reserved3;
Christopher Ferris82d75042015-01-26 10:57:07 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080034 __u64 reserved4;
35 __u64 reserved5;
36 __u64 reserved6;
Christopher Ferris82d75042015-01-26 10:57:07 -080037};
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39#define CXL_START_WORK_AMR 0x0000000000000001ULL
40#define CXL_START_WORK_NUM_IRQS 0x0000000000000002ULL
Christopher Ferris05d08e92016-02-04 13:16:38 -080041#define CXL_START_WORK_ERR_FF 0x0000000000000004ULL
42#define CXL_START_WORK_ALL (CXL_START_WORK_AMR | CXL_START_WORK_NUM_IRQS | CXL_START_WORK_ERR_FF)
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#define CXL_MODE_DEDICATED 0x1
45#define CXL_MODE_DIRECTED 0x2
46#define CXL_AFUID_FLAG_SLAVE 0x1
47struct cxl_afu_id {
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 __u64 flags;
50 __u32 card_id;
51 __u32 afu_offset;
52 __u32 afu_mode;
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 __u32 reserved1;
55 __u64 reserved2;
56 __u64 reserved3;
57 __u64 reserved4;
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 __u64 reserved5;
60 __u64 reserved6;
61};
Christopher Ferris106b3a82016-08-24 12:15:38 -070062#define CXL_AI_NEED_HEADER 0x0000000000000001ULL
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64#define CXL_AI_ALL CXL_AI_NEED_HEADER
65#define CXL_AI_HEADER_SIZE 128
66#define CXL_AI_BUFFER_SIZE 4096
67#define CXL_AI_MAX_ENTRIES 256
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#define CXL_AI_MAX_CHUNK_SIZE (CXL_AI_BUFFER_SIZE * CXL_AI_MAX_ENTRIES)
70struct cxl_adapter_image {
71 __u64 flags;
72 __u64 data;
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 __u64 len_data;
75 __u64 len_image;
76 __u64 reserved1;
77 __u64 reserved2;
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 __u64 reserved3;
80 __u64 reserved4;
81};
Christopher Ferris82d75042015-01-26 10:57:07 -080082#define CXL_MAGIC 0xCA
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84#define CXL_IOCTL_START_WORK _IOW(CXL_MAGIC, 0x00, struct cxl_ioctl_start_work)
85#define CXL_IOCTL_GET_PROCESS_ELEMENT _IOR(CXL_MAGIC, 0x01, __u32)
Christopher Ferris05d08e92016-02-04 13:16:38 -080086#define CXL_IOCTL_GET_AFU_ID _IOR(CXL_MAGIC, 0x02, struct cxl_afu_id)
Christopher Ferris106b3a82016-08-24 12:15:38 -070087#define CXL_IOCTL_DOWNLOAD_IMAGE _IOW(CXL_MAGIC, 0x0A, struct cxl_adapter_image)
Christopher Ferris82d75042015-01-26 10:57:07 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070089#define CXL_IOCTL_VALIDATE_IMAGE _IOW(CXL_MAGIC, 0x0B, struct cxl_adapter_image)
90#define CXL_READ_MIN_SIZE 0x1000
Christopher Ferris05d08e92016-02-04 13:16:38 -080091enum cxl_event_type {
Tao Baod7db5942015-01-28 10:07:51 -080092 CXL_EVENT_RESERVED = 0,
Christopher Ferris106b3a82016-08-24 12:15:38 -070093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080094 CXL_EVENT_AFU_INTERRUPT = 1,
95 CXL_EVENT_DATA_STORAGE = 2,
Christopher Ferris05d08e92016-02-04 13:16:38 -080096 CXL_EVENT_AFU_ERROR = 3,
Christopher Ferris82d75042015-01-26 10:57:07 -080097};
Christopher Ferris106b3a82016-08-24 12:15:38 -070098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris82d75042015-01-26 10:57:07 -080099struct cxl_event_header {
Tao Baod7db5942015-01-28 10:07:51 -0800100 __u16 type;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800101 __u16 size;
Tao Baod7db5942015-01-28 10:07:51 -0800102 __u16 process_element;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800104 __u16 reserved1;
Christopher Ferris82d75042015-01-26 10:57:07 -0800105};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800106struct cxl_event_afu_interrupt {
Tao Baod7db5942015-01-28 10:07:51 -0800107 __u16 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800109 __u16 irq;
110 __u32 reserved1;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800111};
Christopher Ferris82d75042015-01-26 10:57:07 -0800112struct cxl_event_data_storage {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800114 __u16 flags;
115 __u16 reserved1;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800116 __u32 reserved2;
Tao Baod7db5942015-01-28 10:07:51 -0800117 __u64 addr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800119 __u64 dsisr;
120 __u64 reserved3;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800121};
Christopher Ferris82d75042015-01-26 10:57:07 -0800122struct cxl_event_afu_error {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800124 __u16 flags;
125 __u16 reserved1;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800126 __u32 reserved2;
Tao Baod7db5942015-01-28 10:07:51 -0800127 __u64 error;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris82d75042015-01-26 10:57:07 -0800129};
130struct cxl_event {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800131 struct cxl_event_header header;
Tao Baod7db5942015-01-28 10:07:51 -0800132 union {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800134 struct cxl_event_afu_interrupt irq;
135 struct cxl_event_data_storage fault;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800136 struct cxl_event_afu_error afu_error;
Tao Baod7db5942015-01-28 10:07:51 -0800137 };
Christopher Ferris106b3a82016-08-24 12:15:38 -0700138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris82d75042015-01-26 10:57:07 -0800139};
140#endif