interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / seed / host / tests / irqlayout.om

43 lines · 861 bytes Raw Blame History
1om2
2note Measured against GCC linux/vfio.h sizeof/offsetof oracle. This is wire layout, not an Omega struct.
3layout IrqInfo 16
4field argsz uint at 0 little
5field flags uint at 4 little
6field index uint at 8 little
7field count uint at 12 little
8end
9layout IrqSet 24
10field argsz uint at 0 little
11field flags uint at 4 little
12field index uint at 8 little
13field start uint at 12 little
14field count uint at 16 little
15field event int at 20 little
16end
17fn info b edit IrqInfo to void
18put b argsz uint 16
19put b flags uint 3
20put b index uint 2
21put b count uint 64
22end
23fn setup b edit IrqSet to void
24put b argsz uint 24
25put b flags uint 36
26put b index uint 2
27put b start uint 3
28put b count uint 1
29put b event int -1
30end
31fn main to int
32ib = new uchar 16 0
33sb = new uchar 24 0
34info ib
35setup sb
36if ne write 1 ib 0 16 16
37ret 1
38end
39if ne write 1 sb 0 24 24
40ret 2
41end
42ret 0
43end