magma/
magma.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
/* automatically generated by rust-bindgen 0.66.1 */

// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout};

pub const MAGMA_API_VERSION: u32 = 3;
pub const MAGMA_VENDOR_ID_MALI: u32 = 5045;
pub const MAGMA_VENDOR_ID_INTEL: u32 = 32902;
pub type magma_query_t = u64;
pub type magma_status_t = i32;
pub type magma_cache_operation_t = u32;
pub type magma_cache_policy_t = u32;
pub type magma_format_t = u32;
pub type magma_format_modifier_t = u64;
pub type magma_colorspace_t = u32;
pub type magma_coherency_domain_t = u32;
pub type magma_buffer_range_op_t = u32;
pub type magma_bool_t = u8;
pub type magma_device_t = u64;
pub type magma_buffer_t = u64;
pub type magma_semaphore_t = u64;
pub type magma_perf_count_pool_t = u64;
pub type magma_connection_t = u64;
pub type magma_sysmem_connection_t = u64;
pub type magma_handle_t = u32;
pub type magma_buffer_id_t = u64;
pub type magma_semaphore_id_t = u64;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct magma_poll_item {
    pub __bindgen_anon_1: magma_poll_item__bindgen_ty_1,
    pub type_: u32,
    pub condition: u32,
    pub result: u32,
    pub unused: u32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union magma_poll_item__bindgen_ty_1 {
    pub semaphore: magma_semaphore_t,
    pub handle: magma_handle_t,
}
impl Default for magma_poll_item__bindgen_ty_1 {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
impl Default for magma_poll_item {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type magma_poll_item_t = magma_poll_item;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_exec_resource {
    pub buffer_id: magma_buffer_id_t,
    pub offset: u64,
    pub length: u64,
}
pub type magma_exec_resource_t = magma_exec_resource;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_exec_command_buffer {
    pub resource_index: u32,
    pub unused: u32,
    pub start_offset: u64,
}
pub type magma_exec_command_buffer_t = magma_exec_command_buffer;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct magma_command_descriptor {
    pub resource_count: u32,
    pub command_buffer_count: u32,
    pub wait_semaphore_count: u32,
    pub signal_semaphore_count: u32,
    pub resources: *mut magma_exec_resource,
    pub command_buffers: *mut magma_exec_command_buffer,
    pub semaphore_ids: *mut u64,
    pub flags: u64,
}
impl Default for magma_command_descriptor {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type magma_command_descriptor_t = magma_command_descriptor;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct magma_inline_command_buffer {
    pub data: *mut ::std::os::raw::c_void,
    pub size: u64,
    pub semaphore_ids: *mut u64,
    pub semaphore_count: u32,
    pub __bindgen_padding_0: [u8; 4usize],
}
impl Default for magma_inline_command_buffer {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type magma_inline_command_buffer_t = magma_inline_command_buffer;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_total_time_query_result {
    pub gpu_time_ns: u64,
    pub monotonic_time_ns: u64,
}
pub type magma_total_time_query_result_t = magma_total_time_query_result;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_buffer_offset {
    pub buffer_id: u64,
    pub offset: u64,
    pub length: u64,
}
pub type magma_buffer_offset_t = magma_buffer_offset;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_buffer_info {
    pub committed_byte_count: u64,
    pub size: u64,
}
pub type magma_buffer_info_t = magma_buffer_info;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_image_create_info {
    pub drm_format: u64,
    pub drm_format_modifiers: [u64; 16usize],
    pub width: u32,
    pub height: u32,
    pub flags: u64,
}
pub type magma_image_create_info_t = magma_image_create_info;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_image_info {
    pub plane_strides: [u64; 4usize],
    pub plane_offsets: [u32; 4usize],
    pub drm_format_modifier: u64,
    pub coherency_domain: u32,
    pub unused: u32,
}
pub type magma_image_info_t = magma_image_info;
extern "C" {
    #[doc = "\n \\brief Imports and takes ownership of a channel to a device. Takes ownership of |device_channel|\n        on both success and failure.\n \\param device_channel A channel connecting to a gpu class device.\n \\param device_out Returned device.\n"]
    pub fn magma_device_import(
        device_channel: magma_handle_t,
        device_out: *mut magma_device_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Releases a handle to a device\n \\param device An open device.\n"]
    pub fn magma_device_release(device: magma_device_t);
}
extern "C" {
    #[doc = "\n \\brief Performs a query synchronously. On MAGMA_STATUS_OK, a given query |id| will return either\n        a buffer in |result_buffer_out|, or a value in |result_out|. A NULL pointer may be\n        provided for whichever result parameter is not needed.\n \\param device An open device.\n \\param id A vendor-specific ID.\n \\param result_buffer_out Handle to the returned buffer.\n \\param result_out Pointer to a uint64 result.\n"]
    pub fn magma_device_query(
        device: magma_device_t,
        id: u64,
        result_buffer_out: *mut magma_handle_t,
        result_out: *mut u64,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Opens a connection to a device.\n \\param device An open device\n \\param connection_out Returned connection.\n"]
    pub fn magma_device_create_connection(
        device: magma_device_t,
        connection_out: *mut magma_connection_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Releases the given connection.\n \\param connection An open connection.\n"]
    pub fn magma_connection_release(connection: magma_connection_t);
}
extern "C" {
    #[doc = "\n \\brief If a system driver error occurs, the connection will be closed, and this interface will\n        eventually return the error. This interface does not flush messages that may be pending\n        (see magma_connection_flush).\n \\param connection An open connection.\n"]
    pub fn magma_connection_get_error(connection: magma_connection_t) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Creates a context on the given connection.\n \\param connection An open connection.\n \\param context_id_out The returned context id.\n"]
    pub fn magma_connection_create_context(
        connection: magma_connection_t,
        context_id_out: *mut u32,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Releases the context associated with the given id.\n \\param connection An open connection.\n \\param context_id A valid context id.\n"]
    pub fn magma_connection_release_context(connection: magma_connection_t, context_id: u32);
}
extern "C" {
    #[doc = "\n \\brief Creates a memory buffer of at least the given size.\n \\param connection An open connection.\n \\param size Requested buffer size.\n \\param size_out The returned buffer's actual size.\n \\param buffer_out The returned buffer.\n \\param id_out The buffer id of the buffer.\n"]
    pub fn magma_connection_create_buffer(
        connection: magma_connection_t,
        size: u64,
        size_out: *mut u64,
        buffer_out: *mut magma_buffer_t,
        id_out: *mut magma_buffer_id_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Releases the given memory buffer.\n \\param connection An open connection.\n \\param buffer A valid buffer.\n"]
    pub fn magma_connection_release_buffer(connection: magma_connection_t, buffer: magma_buffer_t);
}
extern "C" {
    #[doc = "\n \\brief Imports and takes ownership of the buffer referred to by the given handle. Takes\n        ownership of |buffer_handle| on both success and failure.\n \\param connection An open connection.\n \\param buffer_handle A valid handle.\n \\param size_out The size of the buffer in bytes.\n \\param buffer_out The returned buffer.\n \\param id_out The buffer id of the buffer.\n"]
    pub fn magma_connection_import_buffer(
        connection: magma_connection_t,
        buffer_handle: magma_handle_t,
        size_out: *mut u64,
        buffer_out: *mut magma_buffer_t,
        id_out: *mut magma_buffer_id_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Creates a semaphore.\n \\param connection An open connection.\n \\param semaphore_out The returned semaphore.\n \\param id_out The id of the semaphore.\n"]
    pub fn magma_connection_create_semaphore(
        connection: magma_connection_t,
        semaphore_out: *mut magma_semaphore_t,
        id_out: *mut magma_semaphore_id_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Releases the given semaphore.\n \\param connection An open connection.\n \\param semaphore A valid semaphore.\n"]
    pub fn magma_connection_release_semaphore(
        connection: magma_connection_t,
        semaphore: magma_semaphore_t,
    );
}
extern "C" {
    #[doc = "\n \\brief Imports and takes ownership of the semaphore referred to by the given handle. Takes\n        ownership of |semaphore_handle| on both success and failure.\n \\param connection An open connection.\n \\param semaphore_handle A valid semaphore handle.\n \\param flags Pass MAGMA_IMPORT_SEMAPHORE_ONESHOT to prevent auto-reset after wait.\n \\param semaphore_out The returned semaphore.\n \\param id_out The id of the semaphore.\n"]
    pub fn magma_connection_import_semaphore2(
        connection: magma_connection_t,
        semaphore_handle: magma_handle_t,
        flags: u64,
        semaphore_out: *mut magma_semaphore_t,
        id_out: *mut magma_semaphore_id_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Perform an operation on a range of a buffer\n \\param connection An open connection.\n \\param buffer A valid buffer.\n \\param options Options for the operation.\n \\param start_offset Byte offset into the buffer.\n \\param length Length (in bytes) of the region to operate on.\n"]
    pub fn magma_connection_perform_buffer_op(
        connection: magma_connection_t,
        buffer: magma_buffer_t,
        options: u32,
        start_offset: u64,
        length: u64,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Maps a buffer range onto the hardware in the connection's address space at the given\n        address. Depending on the MSD this may automatically commit and populate that range.\n \\param connection An open connection.\n \\param hw_va Destination virtual address for the mapping.\n \\param buffer A valid buffer.\n \\param offset Offset into the buffer.\n \\param length Length in bytes of the range to map.\n \\param map_flags A valid MAGMA_MAP_FLAGS value.\n"]
    pub fn magma_connection_map_buffer(
        connection: magma_connection_t,
        hw_va: u64,
        buffer: magma_buffer_t,
        offset: u64,
        length: u64,
        map_flags: u64,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Releases the mapping at the given hardware address.\n \\param connection An open connection.\n \\param hw_va A hardware virtual address associated with an existing mapping of the given buffer.\n \\param buffer A valid buffer.\n"]
    pub fn magma_connection_unmap_buffer(
        connection: magma_connection_t,
        hw_va: u64,
        buffer: magma_buffer_t,
    );
}
extern "C" {
    #[doc = "\n \\brief Submits command buffers for execution on the hardware.\n \\param connection An open connection.\n \\param context_id A valid context id.\n \\param descriptor A pointer to the command descriptor.\n"]
    pub fn magma_connection_execute_command(
        connection: magma_connection_t,
        context_id: u32,
        descriptor: *mut magma_command_descriptor_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Submits a series of commands for execution on the hardware without using a command\n        buffer.\n \\param connection An open connection.\n \\param context_id A valid context ID.\n \\param command_count The number of commands in the provided buffer.\n \\param command_buffers An array of command_count magma_inline_command_buffer structs.\n"]
    pub fn magma_connection_execute_immediate_commands(
        connection: magma_connection_t,
        context_id: u32,
        command_count: u64,
        command_buffers: *mut magma_inline_command_buffer_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Incurs a round-trip to the system driver, used to ensure all previous messages have been\n        observed, but not necessarily completed.  If a system driver error occurs, the connection\n        will be closed, and this interface will return the error.\n \\param connection An open connection.\n"]
    pub fn magma_connection_flush(connection: magma_connection_t) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Returns a handle that can be waited on to determine when the connection has data in the\n        notification channel. This channel has the same lifetime as the connection and must not\n        be closed by the client.\n \\param connection An open connection.\n"]
    pub fn magma_connection_get_notification_channel_handle(
        connection: magma_connection_t,
    ) -> magma_handle_t;
}
extern "C" {
    #[doc = "\n \\brief Reads a notification from the channel into the given buffer.  Message sizes may vary\n        depending on the MSD.  If the buffer provided is too small for the message,\n        MAGMA_STATUS_INVALID_ARGS will be returned and the size of message will be returned in\n        the buffer_size_out parameter.\n \\param connection An open connection.\n \\param buffer Buffer into which to read notification data.\n \\param buffer_size Size of the given buffer.\n \\param buffer_size_out Returned size of the notification data written to the buffer, or 0 if\n        there are no messages pending.\n \\param more_data_out True if there is more notification data waiting.\n"]
    pub fn magma_connection_read_notification_channel(
        connection: magma_connection_t,
        buffer: *mut ::std::os::raw::c_void,
        buffer_size: u64,
        buffer_size_out: *mut u64,
        more_data_out: *mut magma_bool_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Cleans, and optionally invalidates, the cache for the region of memory specified by the\n        given buffer, offset, and size, and write the contents to ram.\n \\param buffer A valid buffer.\n \\param offset An offset into the buffer. Must be less than or equal to the buffer's size.\n \\param size Size of region to be cleaned. Offset + size must be less than or equal to the\n        buffer's size.\n \\param operation One of MAGMA_CACHE_OPERATION_CLEAN or MAGMA_CACHE_OPERATION_CLEAN_INVALIDATE.\n"]
    pub fn magma_buffer_clean_cache(
        buffer: magma_buffer_t,
        offset: u64,
        size: u64,
        operation: magma_cache_operation_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Configures the cache for the given buffer.\n \\param buffer A valid buffer.\n \\param policy One of MAGMA_CACHE_POLICY_[CACHED|WRITE_COMBINING|UNCACHED].\n"]
    pub fn magma_buffer_set_cache_policy(
        buffer: magma_buffer_t,
        policy: magma_cache_policy_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Queries the cache policy for a buffer.\n \\param buffer A valid buffer.\n \\param cache_policy_out The returned cache policy.\n"]
    pub fn magma_buffer_get_cache_policy(
        buffer: magma_buffer_t,
        cache_policy_out: *mut magma_cache_policy_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Sets a name for the buffer for use in debugging tools.\n \\param buffer A valid buffer.\n \\param name The 0-terminated name of the buffer. May be truncated.\n"]
    pub fn magma_buffer_set_name(
        buffer: magma_buffer_t,
        name: *const ::std::os::raw::c_char,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Get information on a magma buffer\n \\param buffer A valid buffer.\n \\param info_out Pointer to struct that receives the buffer info.\n"]
    pub fn magma_buffer_get_info(
        buffer: magma_buffer_t,
        info_out: *mut magma_buffer_info_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Gets a platform handle for the given buffer. This can be used to perform a CPU mapping of\n        the buffer using the standard syscall.  The handle may be released without invalidating\n        such CPU mappings.\n \\param buffer A valid buffer.\n \\param handle_out Pointer to the returned handle.\n"]
    pub fn magma_buffer_get_handle(
        buffer: magma_buffer_t,
        handle_out: *mut magma_handle_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Exports the given buffer, returning a handle that may be imported into a connection.\n \\param buffer A valid buffer.\n \\param buffer_handle_out The returned handle.\n"]
    pub fn magma_buffer_export(
        buffer: magma_buffer_t,
        buffer_handle_out: *mut magma_handle_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Signals the given semaphore.\n \\param semaphore A valid semaphore.\n"]
    pub fn magma_semaphore_signal(semaphore: magma_semaphore_t);
}
extern "C" {
    #[doc = "\n \\brief Resets the given semaphore.\n \\param semaphore A valid semaphore.\n"]
    pub fn magma_semaphore_reset(semaphore: magma_semaphore_t);
}
extern "C" {
    #[doc = "\n \\brief Exports the given semaphore, returning a handle that may be imported into a connection\n \\param semaphore A valid semaphore.\n \\param semaphore_handle_out The returned handle.\n"]
    pub fn magma_semaphore_export(
        semaphore: magma_semaphore_t,
        semaphore_handle_out: *mut magma_handle_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Waits for at least one of the given items to meet a condition. Does not reset any\n        semaphores. When MAGMA_STATUS_OK is returned, results are returned in the items array.\n        MAGMA_STATUS_TIMED_OUT is returned if no conditions are met before the given timeout\n        expires. If the notification channel handle is included in the item list, and the magma\n        connection is closed, then MAGMA_STATUS_CONNECTION_LOST is returned.\n \\param items Array of poll items. Type should be either MAGMA_POLL_TYPE_SEMAPHORE or\n        MAGMA_POLL_TYPE_HANDLE. Condition may be set to MAGMA_POLL_CONDITION_SIGNALED OR\n        MAGMA_POLL_CONDITION_READABLE. If condition is 0 the item is ignored. Item results are\n        set to the condition that was satisfied, otherwise 0. If the same item is given twice the\n        behavior is undefined.\n \\param count Number of poll items in the array.\n \\param timeout_ns Time in ns to wait before returning MAGMA_STATUS_TIMED_OUT.\n"]
    pub fn magma_poll(items: *mut magma_poll_item_t, count: u32, timeout_ns: u64)
        -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Initializes tracing. This should be called on Fuchsia; on other platforms it's not needed\n        and will just close the given handle.\n \\param channel An open connection to a tracing provider.\n"]
    pub fn magma_initialize_tracing(channel: magma_handle_t) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Initializes logging, used for debug and some exceptional error reporting. This should be\n        called on Fuchsia; on other platforms it's not needed and will just close the given\n        handle.\n \\param channel An open connection to the syslog service.\n"]
    pub fn magma_initialize_logging(channel: magma_handle_t) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Tries to enable access to performance counters. Returns MAGMA_STATUS_OK if counters were\n        successfully enabled or MAGMA_STATUS_ACCESS_DENIED if channel is for the wrong device and\n        counters were not successfully enabled previously.\n \\param connection An open connection to a device.\n \\param channel A handle to a channel to a gpu-performance-counter device.\n"]
    pub fn magma_connection_enable_performance_counter_access(
        connection: magma_connection_t,
        channel: magma_handle_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Enables a set of performance counters (the precise definition depends on the driver).\n        Disables enabled performance counters that are not in the new set. Performance counters\n        will also be automatically disabled on connection close. Performance counter access must\n        have been enabled using magma_connection_enable_performance_counter_access before calling\n        this method.\n \\param connection An open connection to a device.\n \\param counters An implementation-defined list of counters.\n \\param counters_count The number of entries in |counters|.\n"]
    pub fn magma_connection_enable_performance_counters(
        connection: magma_connection_t,
        counters: *mut u64,
        counters_count: u64,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Create a pool of buffers that performance counters can be dumped into. Performance\n        counter access must have been enabled using\n        magma_connection_enable_performance_counter_access before calling this method.\n \\param connection An open connection to a device.\n \\param pool_id_out A new pool id. Must not currently be in use.\n \\param notification_handle_out A handle that should be waited on.\n"]
    pub fn magma_connection_create_performance_counter_buffer_pool(
        connection: magma_connection_t,
        pool_id_out: *mut magma_perf_count_pool_t,
        notification_handle_out: *mut magma_handle_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Releases a pool of performance counter buffers. Performance counter access must have been\n        enabled using magma_connection_enable_performance_counter_access before calling this\n        method.\n \\param connection An open connection to a device.\n \\param pool_id An existing pool id.\n"]
    pub fn magma_connection_release_performance_counter_buffer_pool(
        connection: magma_connection_t,
        pool_id: magma_perf_count_pool_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Adds a an array of buffers + offset to the pool. |offsets[n].buffer_id| is the koid of a\n        buffer that was previously imported using ImportBuffer(). The same buffer may be added to\n        multiple pools. The pool will hold on to a reference to the buffer even after\n        ReleaseBuffer is called.  When dumped into this entry, counters will be written starting\n        at |offsets[n].offset| bytes into the buffer, and up to |offsets[n].offset| +\n        |offsets[n].size|. |offsets[n].size| must be large enough to fit all enabled counters.\n        Performance counter access must have been enabled using\n        magma_connection_enable_performance_counter_access before calling this method.\n \\param connection An open connection to a device.\n \\param pool_id An existing pool.\n \\param offsets An array of offsets to add.\n \\param offsets_count The number of elements in offsets.\n"]
    pub fn magma_connection_add_performance_counter_buffer_offsets_to_pool(
        connection: magma_connection_t,
        pool_id: magma_perf_count_pool_t,
        offsets: *const magma_buffer_offset_t,
        offsets_count: u64,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Removes every offset of a buffer from the pool. Performance counter access must have been\n        enabled using magma_connection_enable_performance_counter_access before calling this\n        method.\n \\param connection An open connection to a device.\n \\param pool_id An existing pool.\n \\param buffer A magma_buffer\n"]
    pub fn magma_connection_remove_performance_counter_buffer_from_pool(
        connection: magma_connection_t,
        pool_id: magma_perf_count_pool_t,
        buffer: magma_buffer_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Triggers dumping of the performance counters into a buffer pool. May fail silently if\n        there are no buffers in the pool. |trigger_id| is an arbitrary ID assigned by the client\n        that can be returned in OnPerformanceCounterReadCompleted. Performance counter access\n        must have been enabled using magma_connection_enable_performance_counter_access before\n        calling this method.\n \\param connection An open connection to a device.\n \\param pool_id An existing pool\n \\param trigger_id An arbitrary ID assigned by the client that will be returned in\n        OnPerformanceCounterReadCompleted.\n"]
    pub fn magma_connection_dump_performance_counters(
        connection: magma_connection_t,
        pool_id: magma_perf_count_pool_t,
        trigger_id: u32,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Sets the values of all listed performance counters to 0. May not be supported by some\n        hardware. Performance counter access must have been enabled using\n        magma_connection_enable_performance_counter_access before calling this method.\n \\param connection An open connection to a device.\n \\param counters An implementation-defined list of counters.\n \\param counters_count The number of entries in |counters|.\n"]
    pub fn magma_connection_clear_performance_counters(
        connection: magma_connection_t,
        counters: *mut u64,
        counters_count: u64,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Reads one performance counter completion event, if available.\n \\param connection An open connection to a device.\n \\param pool_id An existing pool.\n \\param trigger_id_out The trigger ID for this event.\n \\param buffer_id_out The buffer ID for this event.\n \\param buffer_offset_out The buffer offset for this event.\n \\param time_out The monotonic time this event happened.\n \\param result_flags_out A set of flags giving more information about this event.\n"]
    pub fn magma_connection_read_performance_counter_completion(
        connection: magma_connection_t,
        pool_id: magma_perf_count_pool_t,
        trigger_id_out: *mut u32,
        buffer_id_out: *mut u64,
        buffer_offset_out: *mut u32,
        time_out: *mut u64,
        result_flags_out: *mut u32,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Creates an image buffer backed by a buffer collection given a DRM format and optional\n        modifier, as specified in the create info.\n \\param connection An open connection.\n \\param create_info Input parameters describing the image.\n \\param size_out The size of the image buffer in bytes\n \\param image_out The image buffer.\n \\param buffer_id_out The ID of the image buffer.\n"]
    pub fn magma_virt_connection_create_image(
        connection: magma_connection_t,
        create_info: *mut magma_image_create_info_t,
        size_out: *mut u64,
        image_out: *mut magma_buffer_t,
        buffer_id_out: *mut magma_buffer_id_t,
    ) -> magma_status_t;
}
extern "C" {
    #[doc = "\n \\brief Returns parameters for an image created with virtmagma_create_image.\n \\param connection An open connection.\n \\param image The image buffer.\n \\param image_info_out Output parameters describing the image.\n"]
    pub fn magma_virt_connection_get_image_info(
        connection: magma_connection_t,
        image: magma_buffer_t,
        image_info_out: *mut magma_image_info_t,
    ) -> magma_status_t;
}
pub type __u32 = ::std::os::raw::c_uint;
pub type __u64 = ::std::os::raw::c_ulonglong;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtmagma_ioctl_args_handshake {
    pub handshake_inout: __u32,
    pub version_out: __u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtmagma_ioctl_args_magma_command {
    pub request_address: __u64,
    pub request_size: __u64,
    pub response_address: __u64,
    pub response_size: __u64,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtmagma_command_descriptor {
    pub descriptor_size: __u64,
    pub descriptor: __u64,
    pub resource_size: __u64,
    pub resources: __u64,
    pub command_buffer_size: __u64,
    pub command_buffers: __u64,
    pub semaphore_size: __u64,
    pub semaphores: __u64,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtmagma_create_image_wrapper {
    pub create_info: __u64,
    pub create_info_size: __u64,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtmagma_get_image_info_wrapper {
    pub image_info_out: __u64,
    pub image_info_size: __u64,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtmagma_buffer_set_name_wrapper {
    pub name_address: __u64,
    pub name_size: __u64,
}
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_config {
    pub dummy: u64,
}
pub type virtio_magma_config_t = virtio_magma_config;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_DEVICE_IMPORT: virtio_magma_ctrl_type = 4142;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_DEVICE_RELEASE: virtio_magma_ctrl_type = 4143;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_DEVICE_QUERY: virtio_magma_ctrl_type = 4177;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_DEVICE_CREATE_CONNECTION: virtio_magma_ctrl_type =
    4146;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_RELEASE: virtio_magma_ctrl_type = 4100;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_GET_ERROR: virtio_magma_ctrl_type =
    4101;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_CREATE_CONTEXT:
    virtio_magma_ctrl_type = 4102;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_RELEASE_CONTEXT:
    virtio_magma_ctrl_type = 4103;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_CREATE_BUFFER: virtio_magma_ctrl_type =
    4181;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_RELEASE_BUFFER:
    virtio_magma_ctrl_type = 4105;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_IMPORT_BUFFER: virtio_magma_ctrl_type =
    4180;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_CREATE_SEMAPHORE:
    virtio_magma_ctrl_type = 4185;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_RELEASE_SEMAPHORE:
    virtio_magma_ctrl_type = 4131;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_IMPORT_SEMAPHORE2:
    virtio_magma_ctrl_type = 4187;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_PERFORM_BUFFER_OP:
    virtio_magma_ctrl_type = 4161;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_MAP_BUFFER: virtio_magma_ctrl_type =
    4178;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_UNMAP_BUFFER: virtio_magma_ctrl_type =
    4179;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_EXECUTE_COMMAND:
    virtio_magma_ctrl_type = 4176;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_EXECUTE_IMMEDIATE_COMMANDS:
    virtio_magma_ctrl_type = 4129;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_FLUSH: virtio_magma_ctrl_type = 4175;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_GET_NOTIFICATION_CHANNEL_HANDLE:
    virtio_magma_ctrl_type = 4138;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_READ_NOTIFICATION_CHANNEL:
    virtio_magma_ctrl_type = 4166;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_CLEAN_CACHE: virtio_magma_ctrl_type = 4110;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_SET_CACHE_POLICY: virtio_magma_ctrl_type =
    4111;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_GET_CACHE_POLICY: virtio_magma_ctrl_type =
    4112;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_SET_NAME: virtio_magma_ctrl_type = 4160;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_GET_INFO: virtio_magma_ctrl_type = 4162;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_GET_HANDLE: virtio_magma_ctrl_type = 4171;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_EXPORT: virtio_magma_ctrl_type = 4183;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_SEMAPHORE_SIGNAL: virtio_magma_ctrl_type = 4133;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_SEMAPHORE_RESET: virtio_magma_ctrl_type = 4134;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_SEMAPHORE_EXPORT: virtio_magma_ctrl_type = 4184;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_POLL: virtio_magma_ctrl_type = 4148;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_INITIALIZE_TRACING: virtio_magma_ctrl_type = 4141;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_INITIALIZE_LOGGING: virtio_magma_ctrl_type = 4147;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_ENABLE_PERFORMANCE_COUNTER_ACCESS:
    virtio_magma_ctrl_type = 4149;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_ENABLE_PERFORMANCE_COUNTERS:
    virtio_magma_ctrl_type = 4152;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_CREATE_PERFORMANCE_COUNTER_BUFFER_POOL : virtio_magma_ctrl_type = 4153 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_RELEASE_PERFORMANCE_COUNTER_BUFFER_POOL : virtio_magma_ctrl_type = 4154 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_ADD_PERFORMANCE_COUNTER_BUFFER_OFFSETS_TO_POOL : virtio_magma_ctrl_type = 4155 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_REMOVE_PERFORMANCE_COUNTER_BUFFER_FROM_POOL : virtio_magma_ctrl_type = 4156 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_DUMP_PERFORMANCE_COUNTERS:
    virtio_magma_ctrl_type = 4157;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_CLEAR_PERFORMANCE_COUNTERS:
    virtio_magma_ctrl_type = 4158;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_READ_PERFORMANCE_COUNTER_COMPLETION:
    virtio_magma_ctrl_type = 4159;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_VIRT_CONNECTION_CREATE_IMAGE:
    virtio_magma_ctrl_type = 4182;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_VIRT_CONNECTION_GET_IMAGE_INFO:
    virtio_magma_ctrl_type = 4168;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_INTERNAL_RELEASE_HANDLE: virtio_magma_ctrl_type =
    4172;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_INTERNAL_MAP: virtio_magma_ctrl_type = 4173;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_INTERNAL_UNMAP: virtio_magma_ctrl_type = 4174;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_DEVICE_IMPORT: virtio_magma_ctrl_type = 8238;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_DEVICE_RELEASE: virtio_magma_ctrl_type = 8239;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_DEVICE_QUERY: virtio_magma_ctrl_type = 8273;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_DEVICE_CREATE_CONNECTION:
    virtio_magma_ctrl_type = 8242;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_RELEASE: virtio_magma_ctrl_type =
    8196;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_GET_ERROR: virtio_magma_ctrl_type =
    8197;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_CREATE_CONTEXT:
    virtio_magma_ctrl_type = 8198;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_RELEASE_CONTEXT:
    virtio_magma_ctrl_type = 8199;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_CREATE_BUFFER:
    virtio_magma_ctrl_type = 8277;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_RELEASE_BUFFER:
    virtio_magma_ctrl_type = 8201;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_IMPORT_BUFFER:
    virtio_magma_ctrl_type = 8276;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_CREATE_SEMAPHORE:
    virtio_magma_ctrl_type = 8281;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_RELEASE_SEMAPHORE:
    virtio_magma_ctrl_type = 8227;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_IMPORT_SEMAPHORE2:
    virtio_magma_ctrl_type = 8283;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_PERFORM_BUFFER_OP:
    virtio_magma_ctrl_type = 8257;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_MAP_BUFFER: virtio_magma_ctrl_type =
    8274;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_UNMAP_BUFFER: virtio_magma_ctrl_type =
    8275;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_EXECUTE_COMMAND:
    virtio_magma_ctrl_type = 8272;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_EXECUTE_IMMEDIATE_COMMANDS:
    virtio_magma_ctrl_type = 8225;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_FLUSH: virtio_magma_ctrl_type = 8271;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_GET_NOTIFICATION_CHANNEL_HANDLE:
    virtio_magma_ctrl_type = 8234;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_READ_NOTIFICATION_CHANNEL:
    virtio_magma_ctrl_type = 8262;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_CLEAN_CACHE: virtio_magma_ctrl_type =
    8206;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_SET_CACHE_POLICY: virtio_magma_ctrl_type =
    8207;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_GET_CACHE_POLICY: virtio_magma_ctrl_type =
    8208;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_SET_NAME: virtio_magma_ctrl_type = 8256;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_GET_INFO: virtio_magma_ctrl_type = 8258;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_GET_HANDLE: virtio_magma_ctrl_type = 8267;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_EXPORT: virtio_magma_ctrl_type = 8279;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_SEMAPHORE_SIGNAL: virtio_magma_ctrl_type = 8229;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_SEMAPHORE_RESET: virtio_magma_ctrl_type = 8230;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_SEMAPHORE_EXPORT: virtio_magma_ctrl_type = 8280;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_POLL: virtio_magma_ctrl_type = 8244;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_INITIALIZE_TRACING: virtio_magma_ctrl_type =
    8237;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_INITIALIZE_LOGGING: virtio_magma_ctrl_type =
    8243;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_ENABLE_PERFORMANCE_COUNTER_ACCESS:
    virtio_magma_ctrl_type = 8245;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_ENABLE_PERFORMANCE_COUNTERS:
    virtio_magma_ctrl_type = 8248;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_CREATE_PERFORMANCE_COUNTER_BUFFER_POOL : virtio_magma_ctrl_type = 8249 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_RELEASE_PERFORMANCE_COUNTER_BUFFER_POOL : virtio_magma_ctrl_type = 8250 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_ADD_PERFORMANCE_COUNTER_BUFFER_OFFSETS_TO_POOL : virtio_magma_ctrl_type = 8251 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_REMOVE_PERFORMANCE_COUNTER_BUFFER_FROM_POOL : virtio_magma_ctrl_type = 8252 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_DUMP_PERFORMANCE_COUNTERS:
    virtio_magma_ctrl_type = 8253;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_CLEAR_PERFORMANCE_COUNTERS:
    virtio_magma_ctrl_type = 8254;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_READ_PERFORMANCE_COUNTER_COMPLETION : virtio_magma_ctrl_type = 8255 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_VIRT_CONNECTION_CREATE_IMAGE:
    virtio_magma_ctrl_type = 8278;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_VIRT_CONNECTION_GET_IMAGE_INFO:
    virtio_magma_ctrl_type = 8264;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_INTERNAL_RELEASE_HANDLE: virtio_magma_ctrl_type =
    8268;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_INTERNAL_MAP: virtio_magma_ctrl_type = 8269;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_INTERNAL_UNMAP: virtio_magma_ctrl_type = 8270;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_ERR_UNIMPLEMENTED: virtio_magma_ctrl_type =
    12289;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_ERR_INTERNAL: virtio_magma_ctrl_type = 12290;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_ERR_HOST_DISCONNECTED: virtio_magma_ctrl_type =
    12291;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_ERR_OUT_OF_MEMORY: virtio_magma_ctrl_type =
    12292;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_ERR_INVALID_COMMAND: virtio_magma_ctrl_type =
    12293;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_ERR_INVALID_ARGUMENT: virtio_magma_ctrl_type =
    12294;
pub type virtio_magma_ctrl_type = ::std::os::raw::c_ushort;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_ctrl_hdr {
    pub type_: u32,
    pub flags: u32,
}
pub type virtio_magma_ctrl_hdr_t = virtio_magma_ctrl_hdr;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_import_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub device_channel: u32,
}
pub type virtio_magma_device_import_ctrl_t = virtio_magma_device_import_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_import_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub device_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_device_import_resp_t = virtio_magma_device_import_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_release_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub device: u64,
}
pub type virtio_magma_device_release_ctrl_t = virtio_magma_device_release_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_release_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_device_release_resp_t = virtio_magma_device_release_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_query_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub device: u64,
    pub id: u64,
}
pub type virtio_magma_device_query_ctrl_t = virtio_magma_device_query_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_query_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_buffer_out: u64,
    pub result_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_device_query_resp_t = virtio_magma_device_query_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_create_connection_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub device: u64,
}
pub type virtio_magma_device_create_connection_ctrl_t = virtio_magma_device_create_connection_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_create_connection_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_device_create_connection_resp_t = virtio_magma_device_create_connection_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
}
pub type virtio_magma_connection_release_ctrl_t = virtio_magma_connection_release_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_connection_release_resp_t = virtio_magma_connection_release_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_get_error_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
}
pub type virtio_magma_connection_get_error_ctrl_t = virtio_magma_connection_get_error_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_get_error_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_get_error_resp_t = virtio_magma_connection_get_error_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_context_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
}
pub type virtio_magma_connection_create_context_ctrl_t =
    virtio_magma_connection_create_context_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_context_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub context_id_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_connection_create_context_resp_t =
    virtio_magma_connection_create_context_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_context_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub context_id: u32,
}
pub type virtio_magma_connection_release_context_ctrl_t =
    virtio_magma_connection_release_context_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_context_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_connection_release_context_resp_t =
    virtio_magma_connection_release_context_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_buffer_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub size: u64,
}
pub type virtio_magma_connection_create_buffer_ctrl_t = virtio_magma_connection_create_buffer_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_buffer_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub size_out: u64,
    pub buffer_out: u64,
    pub id_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_connection_create_buffer_resp_t = virtio_magma_connection_create_buffer_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_buffer_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub buffer: u64,
}
pub type virtio_magma_connection_release_buffer_ctrl_t =
    virtio_magma_connection_release_buffer_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_buffer_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_connection_release_buffer_resp_t =
    virtio_magma_connection_release_buffer_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_import_buffer_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub buffer_handle: u32,
}
pub type virtio_magma_connection_import_buffer_ctrl_t = virtio_magma_connection_import_buffer_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_import_buffer_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub size_out: u64,
    pub buffer_out: u64,
    pub id_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_connection_import_buffer_resp_t = virtio_magma_connection_import_buffer_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_semaphore_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
}
pub type virtio_magma_connection_create_semaphore_ctrl_t =
    virtio_magma_connection_create_semaphore_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_semaphore_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub semaphore_out: u64,
    pub id_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_connection_create_semaphore_resp_t =
    virtio_magma_connection_create_semaphore_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_semaphore_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub semaphore: u64,
}
pub type virtio_magma_connection_release_semaphore_ctrl_t =
    virtio_magma_connection_release_semaphore_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_semaphore_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_connection_release_semaphore_resp_t =
    virtio_magma_connection_release_semaphore_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_import_semaphore2_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub semaphore_handle: u32,
    pub flags: u64,
}
pub type virtio_magma_connection_import_semaphore2_ctrl_t =
    virtio_magma_connection_import_semaphore2_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_import_semaphore2_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub semaphore_out: u64,
    pub id_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_connection_import_semaphore2_resp_t =
    virtio_magma_connection_import_semaphore2_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_perform_buffer_op_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub buffer: u64,
    pub options: u32,
    pub start_offset: u64,
    pub length: u64,
}
pub type virtio_magma_connection_perform_buffer_op_ctrl_t =
    virtio_magma_connection_perform_buffer_op_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_perform_buffer_op_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_perform_buffer_op_resp_t =
    virtio_magma_connection_perform_buffer_op_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_map_buffer_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub hw_va: u64,
    pub buffer: u64,
    pub offset: u64,
    pub length: u64,
    pub map_flags: u64,
}
pub type virtio_magma_connection_map_buffer_ctrl_t = virtio_magma_connection_map_buffer_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_map_buffer_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_map_buffer_resp_t = virtio_magma_connection_map_buffer_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_unmap_buffer_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub hw_va: u64,
    pub buffer: u64,
}
pub type virtio_magma_connection_unmap_buffer_ctrl_t = virtio_magma_connection_unmap_buffer_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_unmap_buffer_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_connection_unmap_buffer_resp_t = virtio_magma_connection_unmap_buffer_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_execute_command_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub context_id: u32,
    pub descriptor: u64,
}
pub type virtio_magma_connection_execute_command_ctrl_t =
    virtio_magma_connection_execute_command_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_execute_command_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_execute_command_resp_t =
    virtio_magma_connection_execute_command_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_execute_immediate_commands_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub context_id: u32,
    pub command_count: u64,
    pub command_buffers: u64,
}
pub type virtio_magma_connection_execute_immediate_commands_ctrl_t =
    virtio_magma_connection_execute_immediate_commands_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_execute_immediate_commands_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_execute_immediate_commands_resp_t =
    virtio_magma_connection_execute_immediate_commands_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_flush_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
}
pub type virtio_magma_connection_flush_ctrl_t = virtio_magma_connection_flush_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_flush_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_flush_resp_t = virtio_magma_connection_flush_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_get_notification_channel_handle_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
}
pub type virtio_magma_connection_get_notification_channel_handle_ctrl_t =
    virtio_magma_connection_get_notification_channel_handle_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_get_notification_channel_handle_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u32,
}
pub type virtio_magma_connection_get_notification_channel_handle_resp_t =
    virtio_magma_connection_get_notification_channel_handle_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_read_notification_channel_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub buffer: u64,
    pub buffer_size: u64,
}
pub type virtio_magma_connection_read_notification_channel_ctrl_t =
    virtio_magma_connection_read_notification_channel_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_read_notification_channel_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub buffer_size_out: u64,
    pub more_data_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_connection_read_notification_channel_resp_t =
    virtio_magma_connection_read_notification_channel_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_clean_cache_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub buffer: u64,
    pub offset: u64,
    pub size: u64,
    pub operation: u64,
}
pub type virtio_magma_buffer_clean_cache_ctrl_t = virtio_magma_buffer_clean_cache_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_clean_cache_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_buffer_clean_cache_resp_t = virtio_magma_buffer_clean_cache_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_set_cache_policy_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub buffer: u64,
    pub policy: u64,
}
pub type virtio_magma_buffer_set_cache_policy_ctrl_t = virtio_magma_buffer_set_cache_policy_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_set_cache_policy_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_buffer_set_cache_policy_resp_t = virtio_magma_buffer_set_cache_policy_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_get_cache_policy_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub buffer: u64,
}
pub type virtio_magma_buffer_get_cache_policy_ctrl_t = virtio_magma_buffer_get_cache_policy_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_get_cache_policy_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub cache_policy_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_buffer_get_cache_policy_resp_t = virtio_magma_buffer_get_cache_policy_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_set_name_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub buffer: u64,
    pub name: u64,
}
pub type virtio_magma_buffer_set_name_ctrl_t = virtio_magma_buffer_set_name_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_set_name_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_buffer_set_name_resp_t = virtio_magma_buffer_set_name_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_get_info_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub buffer: u64,
    pub info_out: u64,
}
pub type virtio_magma_buffer_get_info_ctrl_t = virtio_magma_buffer_get_info_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_get_info_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_buffer_get_info_resp_t = virtio_magma_buffer_get_info_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_get_handle_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub buffer: u64,
}
pub type virtio_magma_buffer_get_handle_ctrl_t = virtio_magma_buffer_get_handle_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_get_handle_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub handle_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_buffer_get_handle_resp_t = virtio_magma_buffer_get_handle_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_export_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub buffer: u64,
}
pub type virtio_magma_buffer_export_ctrl_t = virtio_magma_buffer_export_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_export_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub buffer_handle_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_buffer_export_resp_t = virtio_magma_buffer_export_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_semaphore_signal_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub semaphore: u64,
}
pub type virtio_magma_semaphore_signal_ctrl_t = virtio_magma_semaphore_signal_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_semaphore_signal_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_semaphore_signal_resp_t = virtio_magma_semaphore_signal_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_semaphore_reset_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub semaphore: u64,
}
pub type virtio_magma_semaphore_reset_ctrl_t = virtio_magma_semaphore_reset_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_semaphore_reset_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_semaphore_reset_resp_t = virtio_magma_semaphore_reset_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_semaphore_export_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub semaphore: u64,
}
pub type virtio_magma_semaphore_export_ctrl_t = virtio_magma_semaphore_export_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_semaphore_export_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub semaphore_handle_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_semaphore_export_resp_t = virtio_magma_semaphore_export_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_poll_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub items: u64,
    pub count: u32,
    pub timeout_ns: u64,
}
pub type virtio_magma_poll_ctrl_t = virtio_magma_poll_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_poll_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_poll_resp_t = virtio_magma_poll_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_initialize_tracing_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub channel: u32,
}
pub type virtio_magma_initialize_tracing_ctrl_t = virtio_magma_initialize_tracing_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_initialize_tracing_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_initialize_tracing_resp_t = virtio_magma_initialize_tracing_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_initialize_logging_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub channel: u32,
}
pub type virtio_magma_initialize_logging_ctrl_t = virtio_magma_initialize_logging_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_initialize_logging_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_initialize_logging_resp_t = virtio_magma_initialize_logging_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_enable_performance_counter_access_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub channel: u32,
}
pub type virtio_magma_connection_enable_performance_counter_access_ctrl_t =
    virtio_magma_connection_enable_performance_counter_access_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_enable_performance_counter_access_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_enable_performance_counter_access_resp_t =
    virtio_magma_connection_enable_performance_counter_access_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_enable_performance_counters_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub counters: u64,
    pub counters_count: u64,
}
pub type virtio_magma_connection_enable_performance_counters_ctrl_t =
    virtio_magma_connection_enable_performance_counters_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_enable_performance_counters_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_enable_performance_counters_resp_t =
    virtio_magma_connection_enable_performance_counters_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_performance_counter_buffer_pool_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
}
pub type virtio_magma_connection_create_performance_counter_buffer_pool_ctrl_t =
    virtio_magma_connection_create_performance_counter_buffer_pool_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_performance_counter_buffer_pool_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub pool_id_out: u64,
    pub notification_handle_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_connection_create_performance_counter_buffer_pool_resp_t =
    virtio_magma_connection_create_performance_counter_buffer_pool_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_performance_counter_buffer_pool_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub pool_id: u64,
}
pub type virtio_magma_connection_release_performance_counter_buffer_pool_ctrl_t =
    virtio_magma_connection_release_performance_counter_buffer_pool_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_performance_counter_buffer_pool_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_release_performance_counter_buffer_pool_resp_t =
    virtio_magma_connection_release_performance_counter_buffer_pool_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_add_performance_counter_buffer_offsets_to_pool_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub pool_id: u64,
    pub offsets: u64,
    pub offsets_count: u64,
}
pub type virtio_magma_connection_add_performance_counter_buffer_offsets_to_pool_ctrl_t =
    virtio_magma_connection_add_performance_counter_buffer_offsets_to_pool_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_add_performance_counter_buffer_offsets_to_pool_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_add_performance_counter_buffer_offsets_to_pool_resp_t =
    virtio_magma_connection_add_performance_counter_buffer_offsets_to_pool_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_remove_performance_counter_buffer_from_pool_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub pool_id: u64,
    pub buffer: u64,
}
pub type virtio_magma_connection_remove_performance_counter_buffer_from_pool_ctrl_t =
    virtio_magma_connection_remove_performance_counter_buffer_from_pool_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_remove_performance_counter_buffer_from_pool_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_remove_performance_counter_buffer_from_pool_resp_t =
    virtio_magma_connection_remove_performance_counter_buffer_from_pool_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_dump_performance_counters_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub pool_id: u64,
    pub trigger_id: u32,
}
pub type virtio_magma_connection_dump_performance_counters_ctrl_t =
    virtio_magma_connection_dump_performance_counters_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_dump_performance_counters_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_dump_performance_counters_resp_t =
    virtio_magma_connection_dump_performance_counters_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_clear_performance_counters_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub counters: u64,
    pub counters_count: u64,
}
pub type virtio_magma_connection_clear_performance_counters_ctrl_t =
    virtio_magma_connection_clear_performance_counters_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_clear_performance_counters_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_connection_clear_performance_counters_resp_t =
    virtio_magma_connection_clear_performance_counters_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_read_performance_counter_completion_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub pool_id: u64,
}
pub type virtio_magma_connection_read_performance_counter_completion_ctrl_t =
    virtio_magma_connection_read_performance_counter_completion_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_read_performance_counter_completion_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub trigger_id_out: u64,
    pub buffer_id_out: u64,
    pub buffer_offset_out: u64,
    pub time_out: u64,
    pub result_flags_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_connection_read_performance_counter_completion_resp_t =
    virtio_magma_connection_read_performance_counter_completion_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_virt_connection_create_image_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub create_info: u64,
}
pub type virtio_magma_virt_connection_create_image_ctrl_t =
    virtio_magma_virt_connection_create_image_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_virt_connection_create_image_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub size_out: u64,
    pub image_out: u64,
    pub buffer_id_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_virt_connection_create_image_resp_t =
    virtio_magma_virt_connection_create_image_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_virt_connection_get_image_info_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub connection: u64,
    pub image: u64,
    pub image_info_out: u64,
}
pub type virtio_magma_virt_connection_get_image_info_ctrl_t =
    virtio_magma_virt_connection_get_image_info_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_virt_connection_get_image_info_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_virt_connection_get_image_info_resp_t =
    virtio_magma_virt_connection_get_image_info_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_internal_release_handle_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub handle: u32,
}
pub type virtio_magma_internal_release_handle_ctrl_t = virtio_magma_internal_release_handle_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_internal_release_handle_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_internal_release_handle_resp_t = virtio_magma_internal_release_handle_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_internal_map_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub buffer: u32,
    pub length: u64,
}
pub type virtio_magma_internal_map_ctrl_t = virtio_magma_internal_map_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_internal_map_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub address_out: u64,
    pub result_return: u64,
}
pub type virtio_magma_internal_map_resp_t = virtio_magma_internal_map_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_internal_unmap_ctrl {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub buffer: u32,
    pub address: u64,
}
pub type virtio_magma_internal_unmap_ctrl_t = virtio_magma_internal_unmap_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_internal_unmap_resp {
    pub hdr: virtio_magma_ctrl_hdr_t,
    pub result_return: u64,
}
pub type virtio_magma_internal_unmap_resp_t = virtio_magma_internal_unmap_resp;
pub const MAGMA_STATUS_OK: magma_status_t = 0;
pub const MAGMA_STATUS_INTERNAL_ERROR: magma_status_t = -1;
pub const MAGMA_STATUS_INVALID_ARGS: magma_status_t = -2;
pub const MAGMA_STATUS_MEMORY_ERROR: magma_status_t = -4;
pub const MAGMA_STATUS_TIMED_OUT: magma_status_t = -7;
pub const MAGMA_IMAGE_CREATE_FLAGS_PRESENTABLE: u32 = 1;
pub const MAGMA_IMAGE_CREATE_FLAGS_VULKAN_USAGE: u32 = 2;
pub const MAGMA_MAX_IMAGE_PLANES: u32 = 4;
pub const MAGMA_COHERENCY_DOMAIN_CPU: magma_coherency_domain_t = 0;
pub const MAGMA_COHERENCY_DOMAIN_RAM: magma_coherency_domain_t = 1;
pub const MAGMA_COHERENCY_DOMAIN_INACCESSIBLE: magma_coherency_domain_t = 2;
pub const MAGMA_POLL_TYPE_SEMAPHORE: u32 = 1;
pub const MAGMA_POLL_TYPE_HANDLE: u32 = 2;
pub const MAGMA_POLL_CONDITION_SIGNALED: u32 = 3;
pub const MAGMA_CACHE_POLICY_CACHED: magma_cache_policy_t = 0;
pub const MAGMA_CACHE_POLICY_WRITE_COMBINING: magma_cache_policy_t = 1;
pub const MAGMA_CACHE_POLICY_UNCACHED: magma_cache_policy_t = 2;
pub const MAGMA_QUERY_VENDOR_ID: magma_query_t = 0;
pub const MAGMA_IMPORT_SEMAPHORE_ONE_SHOT: u64 = 1;