1 // Copyright 2019 The ChromiumOS Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #![allow(warnings)]
6
7 /* automatically generated by rust-bindgen */
8
9 // manually added, needs to be included when this crate gets automated bindgen
10 use zerocopy::AsBytes;
11 use zerocopy::FromBytes;
12 use zerocopy::FromZeroes;
13
14 pub const MPC_SIGNATURE: &'static [u8; 5usize] = b"PCMP\x00";
15 pub const MP_PROCESSOR: ::std::os::raw::c_uint = 0;
16 pub const MP_BUS: ::std::os::raw::c_uint = 1;
17 pub const MP_IOAPIC: ::std::os::raw::c_uint = 2;
18 pub const MP_INTSRC: ::std::os::raw::c_uint = 3;
19 pub const MP_LINTSRC: ::std::os::raw::c_uint = 4;
20 pub const MP_TRANSLATION: ::std::os::raw::c_uint = 192;
21 pub const CPU_ENABLED: ::std::os::raw::c_uint = 1;
22 pub const CPU_BOOTPROCESSOR: ::std::os::raw::c_uint = 2;
23 pub const CPU_STEPPING_MASK: ::std::os::raw::c_uint = 15;
24 pub const CPU_MODEL_MASK: ::std::os::raw::c_uint = 240;
25 pub const CPU_FAMILY_MASK: ::std::os::raw::c_uint = 3840;
26 pub const BUSTYPE_EISA: &'static [u8; 5usize] = b"EISA\x00";
27 pub const BUSTYPE_ISA: &'static [u8; 4usize] = b"ISA\x00";
28 pub const BUSTYPE_INTERN: &'static [u8; 7usize] = b"INTERN\x00";
29 pub const BUSTYPE_MCA: &'static [u8; 4usize] = b"MCA\x00";
30 pub const BUSTYPE_VL: &'static [u8; 3usize] = b"VL\x00";
31 pub const BUSTYPE_PCI: &'static [u8; 4usize] = b"PCI\x00";
32 pub const BUSTYPE_PCMCIA: &'static [u8; 7usize] = b"PCMCIA\x00";
33 pub const BUSTYPE_CBUS: &'static [u8; 5usize] = b"CBUS\x00";
34 pub const BUSTYPE_CBUSII: &'static [u8; 7usize] = b"CBUSII\x00";
35 pub const BUSTYPE_FUTURE: &'static [u8; 7usize] = b"FUTURE\x00";
36 pub const BUSTYPE_MBI: &'static [u8; 4usize] = b"MBI\x00";
37 pub const BUSTYPE_MBII: &'static [u8; 5usize] = b"MBII\x00";
38 pub const BUSTYPE_MPI: &'static [u8; 4usize] = b"MPI\x00";
39 pub const BUSTYPE_MPSA: &'static [u8; 5usize] = b"MPSA\x00";
40 pub const BUSTYPE_NUBUS: &'static [u8; 6usize] = b"NUBUS\x00";
41 pub const BUSTYPE_TC: &'static [u8; 3usize] = b"TC\x00";
42 pub const BUSTYPE_VME: &'static [u8; 4usize] = b"VME\x00";
43 pub const BUSTYPE_XPRESS: &'static [u8; 7usize] = b"XPRESS\x00";
44 pub const MPC_APIC_USABLE: ::std::os::raw::c_uint = 1;
45 pub const MP_IRQDIR_DEFAULT: ::std::os::raw::c_uint = 0;
46 pub const MP_IRQDIR_HIGH: ::std::os::raw::c_uint = 1;
47 pub const MP_IRQDIR_LOW: ::std::os::raw::c_uint = 3;
48 pub const MP_LEVEL_TRIGGER: ::std::os::raw::c_uint = 0xc;
49 pub const MP_APIC_ALL: ::std::os::raw::c_uint = 255;
50 pub const MPC_OEM_SIGNATURE: &'static [u8; 5usize] = b"_OEM\x00";
51 #[repr(C)]
52 #[derive(Debug, Default, Copy, FromZeroes, FromBytes, AsBytes)]
53 pub struct mpf_intel {
54 pub signature: [::std::os::raw::c_uchar; 4usize],
55 pub physptr: ::std::os::raw::c_uint,
56 pub length: ::std::os::raw::c_uchar,
57 pub specification: ::std::os::raw::c_uchar,
58 pub checksum: ::std::os::raw::c_uchar,
59 pub feature1: ::std::os::raw::c_uchar,
60 pub feature2: ::std::os::raw::c_uchar,
61 pub feature3: ::std::os::raw::c_uchar,
62 pub feature4: ::std::os::raw::c_uchar,
63 pub feature5: ::std::os::raw::c_uchar,
64 }
65 #[test]
bindgen_test_layout_mpf_intel()66 fn bindgen_test_layout_mpf_intel() {
67 assert_eq!(
68 ::std::mem::size_of::<mpf_intel>(),
69 16usize,
70 concat!("Size of: ", stringify!(mpf_intel))
71 );
72 assert_eq!(
73 ::std::mem::align_of::<mpf_intel>(),
74 4usize,
75 concat!("Alignment of ", stringify!(mpf_intel))
76 );
77 assert_eq!(
78 // SAFETY: trivially safe
79 unsafe { &(*(0 as *const mpf_intel)).signature as *const _ as usize },
80 0usize,
81 concat!(
82 "Alignment of field: ",
83 stringify!(mpf_intel),
84 "::",
85 stringify!(signature)
86 )
87 );
88 assert_eq!(
89 // SAFETY: trivially safe
90 unsafe { &(*(0 as *const mpf_intel)).physptr as *const _ as usize },
91 4usize,
92 concat!(
93 "Alignment of field: ",
94 stringify!(mpf_intel),
95 "::",
96 stringify!(physptr)
97 )
98 );
99 assert_eq!(
100 // SAFETY: trivially safe
101 unsafe { &(*(0 as *const mpf_intel)).length as *const _ as usize },
102 8usize,
103 concat!(
104 "Alignment of field: ",
105 stringify!(mpf_intel),
106 "::",
107 stringify!(length)
108 )
109 );
110 assert_eq!(
111 // SAFETY: trivially safe
112 unsafe { &(*(0 as *const mpf_intel)).specification as *const _ as usize },
113 9usize,
114 concat!(
115 "Alignment of field: ",
116 stringify!(mpf_intel),
117 "::",
118 stringify!(specification)
119 )
120 );
121 assert_eq!(
122 // SAFETY: trivially safe
123 unsafe { &(*(0 as *const mpf_intel)).checksum as *const _ as usize },
124 10usize,
125 concat!(
126 "Alignment of field: ",
127 stringify!(mpf_intel),
128 "::",
129 stringify!(checksum)
130 )
131 );
132 assert_eq!(
133 // SAFETY: trivially safe
134 unsafe { &(*(0 as *const mpf_intel)).feature1 as *const _ as usize },
135 11usize,
136 concat!(
137 "Alignment of field: ",
138 stringify!(mpf_intel),
139 "::",
140 stringify!(feature1)
141 )
142 );
143 assert_eq!(
144 // SAFETY: trivially safe
145 unsafe { &(*(0 as *const mpf_intel)).feature2 as *const _ as usize },
146 12usize,
147 concat!(
148 "Alignment of field: ",
149 stringify!(mpf_intel),
150 "::",
151 stringify!(feature2)
152 )
153 );
154 assert_eq!(
155 // SAFETY: trivially safe
156 unsafe { &(*(0 as *const mpf_intel)).feature3 as *const _ as usize },
157 13usize,
158 concat!(
159 "Alignment of field: ",
160 stringify!(mpf_intel),
161 "::",
162 stringify!(feature3)
163 )
164 );
165 assert_eq!(
166 // SAFETY: trivially safe
167 unsafe { &(*(0 as *const mpf_intel)).feature4 as *const _ as usize },
168 14usize,
169 concat!(
170 "Alignment of field: ",
171 stringify!(mpf_intel),
172 "::",
173 stringify!(feature4)
174 )
175 );
176 assert_eq!(
177 // SAFETY: trivially safe
178 unsafe { &(*(0 as *const mpf_intel)).feature5 as *const _ as usize },
179 15usize,
180 concat!(
181 "Alignment of field: ",
182 stringify!(mpf_intel),
183 "::",
184 stringify!(feature5)
185 )
186 );
187 }
188 impl Clone for mpf_intel {
clone(&self) -> Self189 fn clone(&self) -> Self {
190 *self
191 }
192 }
193 #[repr(C)]
194 #[derive(Debug, Default, Copy, FromZeroes, FromBytes, AsBytes)]
195 pub struct mpc_table {
196 pub signature: [::std::os::raw::c_uchar; 4usize],
197 pub length: ::std::os::raw::c_ushort,
198 pub spec: ::std::os::raw::c_char,
199 pub checksum: ::std::os::raw::c_char,
200 pub oem: [::std::os::raw::c_uchar; 8usize],
201 pub productid: [::std::os::raw::c_uchar; 12usize],
202 pub oemptr: ::std::os::raw::c_uint,
203 pub oemsize: ::std::os::raw::c_ushort,
204 pub oemcount: ::std::os::raw::c_ushort,
205 pub lapic: ::std::os::raw::c_uint,
206 pub reserved: ::std::os::raw::c_uint,
207 }
208 #[test]
bindgen_test_layout_mpc_table()209 fn bindgen_test_layout_mpc_table() {
210 assert_eq!(
211 ::std::mem::size_of::<mpc_table>(),
212 44usize,
213 concat!("Size of: ", stringify!(mpc_table))
214 );
215 assert_eq!(
216 ::std::mem::align_of::<mpc_table>(),
217 4usize,
218 concat!("Alignment of ", stringify!(mpc_table))
219 );
220 assert_eq!(
221 // SAFETY: trivially safe
222 unsafe { &(*(0 as *const mpc_table)).signature as *const _ as usize },
223 0usize,
224 concat!(
225 "Alignment of field: ",
226 stringify!(mpc_table),
227 "::",
228 stringify!(signature)
229 )
230 );
231 assert_eq!(
232 // SAFETY: trivially safe
233 unsafe { &(*(0 as *const mpc_table)).length as *const _ as usize },
234 4usize,
235 concat!(
236 "Alignment of field: ",
237 stringify!(mpc_table),
238 "::",
239 stringify!(length)
240 )
241 );
242 assert_eq!(
243 // SAFETY: trivially safe
244 unsafe { &(*(0 as *const mpc_table)).spec as *const _ as usize },
245 6usize,
246 concat!(
247 "Alignment of field: ",
248 stringify!(mpc_table),
249 "::",
250 stringify!(spec)
251 )
252 );
253 assert_eq!(
254 // SAFETY: trivially safe
255 unsafe { &(*(0 as *const mpc_table)).checksum as *const _ as usize },
256 7usize,
257 concat!(
258 "Alignment of field: ",
259 stringify!(mpc_table),
260 "::",
261 stringify!(checksum)
262 )
263 );
264 assert_eq!(
265 // SAFETY: trivially safe
266 unsafe { &(*(0 as *const mpc_table)).oem as *const _ as usize },
267 8usize,
268 concat!(
269 "Alignment of field: ",
270 stringify!(mpc_table),
271 "::",
272 stringify!(oem)
273 )
274 );
275 assert_eq!(
276 // SAFETY: trivially safe
277 unsafe { &(*(0 as *const mpc_table)).productid as *const _ as usize },
278 16usize,
279 concat!(
280 "Alignment of field: ",
281 stringify!(mpc_table),
282 "::",
283 stringify!(productid)
284 )
285 );
286 assert_eq!(
287 // SAFETY: trivially safe
288 unsafe { &(*(0 as *const mpc_table)).oemptr as *const _ as usize },
289 28usize,
290 concat!(
291 "Alignment of field: ",
292 stringify!(mpc_table),
293 "::",
294 stringify!(oemptr)
295 )
296 );
297 assert_eq!(
298 // SAFETY: trivially safe
299 unsafe { &(*(0 as *const mpc_table)).oemsize as *const _ as usize },
300 32usize,
301 concat!(
302 "Alignment of field: ",
303 stringify!(mpc_table),
304 "::",
305 stringify!(oemsize)
306 )
307 );
308 assert_eq!(
309 // SAFETY: trivially safe
310 unsafe { &(*(0 as *const mpc_table)).oemcount as *const _ as usize },
311 34usize,
312 concat!(
313 "Alignment of field: ",
314 stringify!(mpc_table),
315 "::",
316 stringify!(oemcount)
317 )
318 );
319 assert_eq!(
320 // SAFETY: trivially safe
321 unsafe { &(*(0 as *const mpc_table)).lapic as *const _ as usize },
322 36usize,
323 concat!(
324 "Alignment of field: ",
325 stringify!(mpc_table),
326 "::",
327 stringify!(lapic)
328 )
329 );
330 assert_eq!(
331 // SAFETY: trivially safe
332 unsafe { &(*(0 as *const mpc_table)).reserved as *const _ as usize },
333 40usize,
334 concat!(
335 "Alignment of field: ",
336 stringify!(mpc_table),
337 "::",
338 stringify!(reserved)
339 )
340 );
341 }
342 impl Clone for mpc_table {
clone(&self) -> Self343 fn clone(&self) -> Self {
344 *self
345 }
346 }
347 #[repr(C)]
348 #[derive(Debug, Default, Copy, FromZeroes, FromBytes, AsBytes)]
349 pub struct mpc_cpu {
350 pub type_: ::std::os::raw::c_uchar,
351 pub apicid: ::std::os::raw::c_uchar,
352 pub apicver: ::std::os::raw::c_uchar,
353 pub cpuflag: ::std::os::raw::c_uchar,
354 pub cpufeature: ::std::os::raw::c_uint,
355 pub featureflag: ::std::os::raw::c_uint,
356 pub reserved: [::std::os::raw::c_uint; 2usize],
357 }
358 #[test]
bindgen_test_layout_mpc_cpu()359 fn bindgen_test_layout_mpc_cpu() {
360 assert_eq!(
361 ::std::mem::size_of::<mpc_cpu>(),
362 20usize,
363 concat!("Size of: ", stringify!(mpc_cpu))
364 );
365 assert_eq!(
366 ::std::mem::align_of::<mpc_cpu>(),
367 4usize,
368 concat!("Alignment of ", stringify!(mpc_cpu))
369 );
370 assert_eq!(
371 // SAFETY: trivially safe
372 unsafe { &(*(0 as *const mpc_cpu)).type_ as *const _ as usize },
373 0usize,
374 concat!(
375 "Alignment of field: ",
376 stringify!(mpc_cpu),
377 "::",
378 stringify!(type_)
379 )
380 );
381 assert_eq!(
382 // SAFETY: trivially safe
383 unsafe { &(*(0 as *const mpc_cpu)).apicid as *const _ as usize },
384 1usize,
385 concat!(
386 "Alignment of field: ",
387 stringify!(mpc_cpu),
388 "::",
389 stringify!(apicid)
390 )
391 );
392 assert_eq!(
393 // SAFETY: trivially safe
394 unsafe { &(*(0 as *const mpc_cpu)).apicver as *const _ as usize },
395 2usize,
396 concat!(
397 "Alignment of field: ",
398 stringify!(mpc_cpu),
399 "::",
400 stringify!(apicver)
401 )
402 );
403 assert_eq!(
404 // SAFETY: trivially safe
405 unsafe { &(*(0 as *const mpc_cpu)).cpuflag as *const _ as usize },
406 3usize,
407 concat!(
408 "Alignment of field: ",
409 stringify!(mpc_cpu),
410 "::",
411 stringify!(cpuflag)
412 )
413 );
414 assert_eq!(
415 // SAFETY: trivially safe
416 unsafe { &(*(0 as *const mpc_cpu)).cpufeature as *const _ as usize },
417 4usize,
418 concat!(
419 "Alignment of field: ",
420 stringify!(mpc_cpu),
421 "::",
422 stringify!(cpufeature)
423 )
424 );
425 assert_eq!(
426 // SAFETY: trivially safe
427 unsafe { &(*(0 as *const mpc_cpu)).featureflag as *const _ as usize },
428 8usize,
429 concat!(
430 "Alignment of field: ",
431 stringify!(mpc_cpu),
432 "::",
433 stringify!(featureflag)
434 )
435 );
436 assert_eq!(
437 // SAFETY: trivially safe
438 unsafe { &(*(0 as *const mpc_cpu)).reserved as *const _ as usize },
439 12usize,
440 concat!(
441 "Alignment of field: ",
442 stringify!(mpc_cpu),
443 "::",
444 stringify!(reserved)
445 )
446 );
447 }
448 impl Clone for mpc_cpu {
clone(&self) -> Self449 fn clone(&self) -> Self {
450 *self
451 }
452 }
453 #[repr(C)]
454 #[derive(Debug, Default, Copy, FromZeroes, FromBytes, AsBytes)]
455 pub struct mpc_bus {
456 pub type_: ::std::os::raw::c_uchar,
457 pub busid: ::std::os::raw::c_uchar,
458 pub bustype: [::std::os::raw::c_uchar; 6usize],
459 }
460 #[test]
bindgen_test_layout_mpc_bus()461 fn bindgen_test_layout_mpc_bus() {
462 assert_eq!(
463 ::std::mem::size_of::<mpc_bus>(),
464 8usize,
465 concat!("Size of: ", stringify!(mpc_bus))
466 );
467 assert_eq!(
468 ::std::mem::align_of::<mpc_bus>(),
469 1usize,
470 concat!("Alignment of ", stringify!(mpc_bus))
471 );
472 assert_eq!(
473 // SAFETY: trivially safe
474 unsafe { &(*(0 as *const mpc_bus)).type_ as *const _ as usize },
475 0usize,
476 concat!(
477 "Alignment of field: ",
478 stringify!(mpc_bus),
479 "::",
480 stringify!(type_)
481 )
482 );
483 assert_eq!(
484 // SAFETY: trivially safe
485 unsafe { &(*(0 as *const mpc_bus)).busid as *const _ as usize },
486 1usize,
487 concat!(
488 "Alignment of field: ",
489 stringify!(mpc_bus),
490 "::",
491 stringify!(busid)
492 )
493 );
494 assert_eq!(
495 // SAFETY: trivially safe
496 unsafe { &(*(0 as *const mpc_bus)).bustype as *const _ as usize },
497 2usize,
498 concat!(
499 "Alignment of field: ",
500 stringify!(mpc_bus),
501 "::",
502 stringify!(bustype)
503 )
504 );
505 }
506 impl Clone for mpc_bus {
clone(&self) -> Self507 fn clone(&self) -> Self {
508 *self
509 }
510 }
511 #[repr(C)]
512 #[derive(Debug, Default, Copy, FromZeroes, FromBytes, AsBytes)]
513 pub struct mpc_ioapic {
514 pub type_: ::std::os::raw::c_uchar,
515 pub apicid: ::std::os::raw::c_uchar,
516 pub apicver: ::std::os::raw::c_uchar,
517 pub flags: ::std::os::raw::c_uchar,
518 pub apicaddr: ::std::os::raw::c_uint,
519 }
520 #[test]
bindgen_test_layout_mpc_ioapic()521 fn bindgen_test_layout_mpc_ioapic() {
522 assert_eq!(
523 ::std::mem::size_of::<mpc_ioapic>(),
524 8usize,
525 concat!("Size of: ", stringify!(mpc_ioapic))
526 );
527 assert_eq!(
528 ::std::mem::align_of::<mpc_ioapic>(),
529 4usize,
530 concat!("Alignment of ", stringify!(mpc_ioapic))
531 );
532 assert_eq!(
533 // SAFETY: trivially safe
534 unsafe { &(*(0 as *const mpc_ioapic)).type_ as *const _ as usize },
535 0usize,
536 concat!(
537 "Alignment of field: ",
538 stringify!(mpc_ioapic),
539 "::",
540 stringify!(type_)
541 )
542 );
543 assert_eq!(
544 // SAFETY: trivially safe
545 unsafe { &(*(0 as *const mpc_ioapic)).apicid as *const _ as usize },
546 1usize,
547 concat!(
548 "Alignment of field: ",
549 stringify!(mpc_ioapic),
550 "::",
551 stringify!(apicid)
552 )
553 );
554 assert_eq!(
555 // SAFETY: trivially safe
556 unsafe { &(*(0 as *const mpc_ioapic)).apicver as *const _ as usize },
557 2usize,
558 concat!(
559 "Alignment of field: ",
560 stringify!(mpc_ioapic),
561 "::",
562 stringify!(apicver)
563 )
564 );
565 assert_eq!(
566 // SAFETY: trivially safe
567 unsafe { &(*(0 as *const mpc_ioapic)).flags as *const _ as usize },
568 3usize,
569 concat!(
570 "Alignment of field: ",
571 stringify!(mpc_ioapic),
572 "::",
573 stringify!(flags)
574 )
575 );
576 assert_eq!(
577 // SAFETY: trivially safe
578 unsafe { &(*(0 as *const mpc_ioapic)).apicaddr as *const _ as usize },
579 4usize,
580 concat!(
581 "Alignment of field: ",
582 stringify!(mpc_ioapic),
583 "::",
584 stringify!(apicaddr)
585 )
586 );
587 }
588 impl Clone for mpc_ioapic {
clone(&self) -> Self589 fn clone(&self) -> Self {
590 *self
591 }
592 }
593 #[repr(C)]
594 #[derive(Debug, Default, Copy, FromZeroes, FromBytes, AsBytes)]
595 pub struct mpc_intsrc {
596 pub type_: ::std::os::raw::c_uchar,
597 pub irqtype: ::std::os::raw::c_uchar,
598 pub irqflag: ::std::os::raw::c_ushort,
599 pub srcbus: ::std::os::raw::c_uchar,
600 pub srcbusirq: ::std::os::raw::c_uchar,
601 pub dstapic: ::std::os::raw::c_uchar,
602 pub dstirq: ::std::os::raw::c_uchar,
603 }
604 #[test]
bindgen_test_layout_mpc_intsrc()605 fn bindgen_test_layout_mpc_intsrc() {
606 assert_eq!(
607 ::std::mem::size_of::<mpc_intsrc>(),
608 8usize,
609 concat!("Size of: ", stringify!(mpc_intsrc))
610 );
611 assert_eq!(
612 ::std::mem::align_of::<mpc_intsrc>(),
613 2usize,
614 concat!("Alignment of ", stringify!(mpc_intsrc))
615 );
616 assert_eq!(
617 // SAFETY: trivially safe
618 unsafe { &(*(0 as *const mpc_intsrc)).type_ as *const _ as usize },
619 0usize,
620 concat!(
621 "Alignment of field: ",
622 stringify!(mpc_intsrc),
623 "::",
624 stringify!(type_)
625 )
626 );
627 assert_eq!(
628 // SAFETY: trivially safe
629 unsafe { &(*(0 as *const mpc_intsrc)).irqtype as *const _ as usize },
630 1usize,
631 concat!(
632 "Alignment of field: ",
633 stringify!(mpc_intsrc),
634 "::",
635 stringify!(irqtype)
636 )
637 );
638 assert_eq!(
639 // SAFETY: trivially safe
640 unsafe { &(*(0 as *const mpc_intsrc)).irqflag as *const _ as usize },
641 2usize,
642 concat!(
643 "Alignment of field: ",
644 stringify!(mpc_intsrc),
645 "::",
646 stringify!(irqflag)
647 )
648 );
649 assert_eq!(
650 // SAFETY: trivially safe
651 unsafe { &(*(0 as *const mpc_intsrc)).srcbus as *const _ as usize },
652 4usize,
653 concat!(
654 "Alignment of field: ",
655 stringify!(mpc_intsrc),
656 "::",
657 stringify!(srcbus)
658 )
659 );
660 assert_eq!(
661 // SAFETY: trivially safe
662 unsafe { &(*(0 as *const mpc_intsrc)).srcbusirq as *const _ as usize },
663 5usize,
664 concat!(
665 "Alignment of field: ",
666 stringify!(mpc_intsrc),
667 "::",
668 stringify!(srcbusirq)
669 )
670 );
671 assert_eq!(
672 // SAFETY: trivially safe
673 unsafe { &(*(0 as *const mpc_intsrc)).dstapic as *const _ as usize },
674 6usize,
675 concat!(
676 "Alignment of field: ",
677 stringify!(mpc_intsrc),
678 "::",
679 stringify!(dstapic)
680 )
681 );
682 assert_eq!(
683 // SAFETY: trivially safe
684 unsafe { &(*(0 as *const mpc_intsrc)).dstirq as *const _ as usize },
685 7usize,
686 concat!(
687 "Alignment of field: ",
688 stringify!(mpc_intsrc),
689 "::",
690 stringify!(dstirq)
691 )
692 );
693 }
694 impl Clone for mpc_intsrc {
clone(&self) -> Self695 fn clone(&self) -> Self {
696 *self
697 }
698 }
699 pub const mp_irq_source_types_mp_INT: mp_irq_source_types = 0;
700 pub const mp_irq_source_types_mp_NMI: mp_irq_source_types = 1;
701 pub const mp_irq_source_types_mp_SMI: mp_irq_source_types = 2;
702 pub const mp_irq_source_types_mp_ExtINT: mp_irq_source_types = 3;
703 pub type mp_irq_source_types = ::std::os::raw::c_uint;
704 #[repr(C)]
705 #[derive(Debug, Default, Copy, FromZeroes, FromBytes, AsBytes)]
706 pub struct mpc_lintsrc {
707 pub type_: ::std::os::raw::c_uchar,
708 pub irqtype: ::std::os::raw::c_uchar,
709 pub irqflag: ::std::os::raw::c_ushort,
710 pub srcbusid: ::std::os::raw::c_uchar,
711 pub srcbusirq: ::std::os::raw::c_uchar,
712 pub destapic: ::std::os::raw::c_uchar,
713 pub destapiclint: ::std::os::raw::c_uchar,
714 }
715 #[test]
bindgen_test_layout_mpc_lintsrc()716 fn bindgen_test_layout_mpc_lintsrc() {
717 assert_eq!(
718 ::std::mem::size_of::<mpc_lintsrc>(),
719 8usize,
720 concat!("Size of: ", stringify!(mpc_lintsrc))
721 );
722 assert_eq!(
723 ::std::mem::align_of::<mpc_lintsrc>(),
724 2usize,
725 concat!("Alignment of ", stringify!(mpc_lintsrc))
726 );
727 assert_eq!(
728 // SAFETY: trivially safe
729 unsafe { &(*(0 as *const mpc_lintsrc)).type_ as *const _ as usize },
730 0usize,
731 concat!(
732 "Alignment of field: ",
733 stringify!(mpc_lintsrc),
734 "::",
735 stringify!(type_)
736 )
737 );
738 assert_eq!(
739 // SAFETY: trivially safe
740 unsafe { &(*(0 as *const mpc_lintsrc)).irqtype as *const _ as usize },
741 1usize,
742 concat!(
743 "Alignment of field: ",
744 stringify!(mpc_lintsrc),
745 "::",
746 stringify!(irqtype)
747 )
748 );
749 assert_eq!(
750 // SAFETY: trivially safe
751 unsafe { &(*(0 as *const mpc_lintsrc)).irqflag as *const _ as usize },
752 2usize,
753 concat!(
754 "Alignment of field: ",
755 stringify!(mpc_lintsrc),
756 "::",
757 stringify!(irqflag)
758 )
759 );
760 assert_eq!(
761 // SAFETY: trivially safe
762 unsafe { &(*(0 as *const mpc_lintsrc)).srcbusid as *const _ as usize },
763 4usize,
764 concat!(
765 "Alignment of field: ",
766 stringify!(mpc_lintsrc),
767 "::",
768 stringify!(srcbusid)
769 )
770 );
771 assert_eq!(
772 // SAFETY: trivially safe
773 unsafe { &(*(0 as *const mpc_lintsrc)).srcbusirq as *const _ as usize },
774 5usize,
775 concat!(
776 "Alignment of field: ",
777 stringify!(mpc_lintsrc),
778 "::",
779 stringify!(srcbusirq)
780 )
781 );
782 assert_eq!(
783 // SAFETY: trivially safe
784 unsafe { &(*(0 as *const mpc_lintsrc)).destapic as *const _ as usize },
785 6usize,
786 concat!(
787 "Alignment of field: ",
788 stringify!(mpc_lintsrc),
789 "::",
790 stringify!(destapic)
791 )
792 );
793 assert_eq!(
794 // SAFETY: trivially safe
795 unsafe { &(*(0 as *const mpc_lintsrc)).destapiclint as *const _ as usize },
796 7usize,
797 concat!(
798 "Alignment of field: ",
799 stringify!(mpc_lintsrc),
800 "::",
801 stringify!(destapiclint)
802 )
803 );
804 }
805 impl Clone for mpc_lintsrc {
clone(&self) -> Self806 fn clone(&self) -> Self {
807 *self
808 }
809 }
810 #[repr(C)]
811 #[derive(Debug, Default, Copy)]
812 pub struct mpc_oemtable {
813 pub signature: [::std::os::raw::c_char; 4usize],
814 pub length: ::std::os::raw::c_ushort,
815 pub rev: ::std::os::raw::c_char,
816 pub checksum: ::std::os::raw::c_char,
817 pub mpc: [::std::os::raw::c_char; 8usize],
818 }
819 #[test]
bindgen_test_layout_mpc_oemtable()820 fn bindgen_test_layout_mpc_oemtable() {
821 assert_eq!(
822 ::std::mem::size_of::<mpc_oemtable>(),
823 16usize,
824 concat!("Size of: ", stringify!(mpc_oemtable))
825 );
826 assert_eq!(
827 ::std::mem::align_of::<mpc_oemtable>(),
828 2usize,
829 concat!("Alignment of ", stringify!(mpc_oemtable))
830 );
831 assert_eq!(
832 // SAFETY: trivially safe
833 unsafe { &(*(0 as *const mpc_oemtable)).signature as *const _ as usize },
834 0usize,
835 concat!(
836 "Alignment of field: ",
837 stringify!(mpc_oemtable),
838 "::",
839 stringify!(signature)
840 )
841 );
842 assert_eq!(
843 // SAFETY: trivially safe
844 unsafe { &(*(0 as *const mpc_oemtable)).length as *const _ as usize },
845 4usize,
846 concat!(
847 "Alignment of field: ",
848 stringify!(mpc_oemtable),
849 "::",
850 stringify!(length)
851 )
852 );
853 assert_eq!(
854 // SAFETY: trivially safe
855 unsafe { &(*(0 as *const mpc_oemtable)).rev as *const _ as usize },
856 6usize,
857 concat!(
858 "Alignment of field: ",
859 stringify!(mpc_oemtable),
860 "::",
861 stringify!(rev)
862 )
863 );
864 assert_eq!(
865 // SAFETY: trivially safe
866 unsafe { &(*(0 as *const mpc_oemtable)).checksum as *const _ as usize },
867 7usize,
868 concat!(
869 "Alignment of field: ",
870 stringify!(mpc_oemtable),
871 "::",
872 stringify!(checksum)
873 )
874 );
875 assert_eq!(
876 // SAFETY: trivially safe
877 unsafe { &(*(0 as *const mpc_oemtable)).mpc as *const _ as usize },
878 8usize,
879 concat!(
880 "Alignment of field: ",
881 stringify!(mpc_oemtable),
882 "::",
883 stringify!(mpc)
884 )
885 );
886 }
887 impl Clone for mpc_oemtable {
clone(&self) -> Self888 fn clone(&self) -> Self {
889 *self
890 }
891 }
892 pub const mp_bustype_MP_BUS_ISA: mp_bustype = 1;
893 pub const mp_bustype_MP_BUS_EISA: mp_bustype = 2;
894 pub const mp_bustype_MP_BUS_PCI: mp_bustype = 3;
895 pub type mp_bustype = ::std::os::raw::c_uint;
896