• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 __MIC_COMMON_H_
20 #define __MIC_COMMON_H_
21 #include <linux/virtio_ring.h>
22 #define __mic_align(a,x) (((a) + (x) - 1) & ~((x) - 1))
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 struct mic_device_desc {
25   __s8 type;
26   __u8 num_vq;
27   __u8 feature_len;
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29   __u8 config_len;
30   __u8 status;
31   __le64 config[0];
32 } __attribute__((aligned(8)));
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 struct mic_device_ctrl {
35   __le64 vdev;
36   __u8 config_change;
37   __u8 vdev_reset;
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39   __u8 guest_ack;
40   __u8 host_ack;
41   __u8 used_address_updated;
42   __s8 c2h_vdev_db;
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44   __s8 h2c_vdev_db;
45 } __attribute__((aligned(8)));
46 struct mic_bootparam {
47   __le32 magic;
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49   __s8 c2h_shutdown_db;
50   __s8 h2c_shutdown_db;
51   __s8 h2c_config_db;
52   __u8 shutdown_status;
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54   __u8 shutdown_card;
55 } __attribute__((aligned(8)));
56 struct mic_device_page {
57   struct mic_bootparam bootparam;
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59   struct mic_device_desc desc[0];
60 };
61 struct mic_vqconfig {
62   __le64 address;
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64   __le64 used_address;
65   __le16 num;
66 } __attribute__((aligned(8)));
67 #define MIC_VIRTIO_RING_ALIGN 4096
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 #define MIC_MAX_VRINGS 4
70 #define MIC_VRING_ENTRIES 128
71 #define MIC_MAX_VRING_ENTRIES 128
72 #define MIC_MAX_DESC_BLK_SIZE 256
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 struct _mic_vring_info {
75   __u16 avail_idx;
76   __le32 magic;
77 };
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 struct mic_vring {
80   struct vring vr;
81   struct _mic_vring_info * info;
82   void * va;
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84   int len;
85 };
86 #define mic_aligned_desc_size(d) __mic_align(mic_desc_size(d), 8)
87 #ifndef INTEL_MIC_CARD
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 #endif
90 #define MIC_DP_SIZE 4096
91 #define MIC_MAGIC 0xc0ffee00
92 enum mic_states {
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94   MIC_OFFLINE = 0,
95   MIC_ONLINE,
96   MIC_SHUTTING_DOWN,
97   MIC_RESET_FAILED,
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99   MIC_SUSPENDING,
100   MIC_SUSPENDED,
101   MIC_LAST
102 };
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 enum mic_status {
105   MIC_NOP = 0,
106   MIC_CRASHED,
107   MIC_HALTED,
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109   MIC_POWER_OFF,
110   MIC_RESTART,
111   MIC_STATUS_LAST
112 };
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114 #endif
115