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 / eventfd.om

50 lines · 967 bytes Raw Blame History
1note Safe host behavior only: no VFIO or GPU paths. Helpers precede creation to exercise lifecycle codegen.
2global buf uchar 8
3global arg uchar 8
4fn ck b bool to void
5if not b
6exit int 80
7end
8end
9fn shut fd int to void
10ck eq fclose fd 0
11end
12fn main to int
13fd = int eventfd uint 0
14ck ge fd 0
15ck eq waitio fd 1 0 0
16ck eq read fd buf 0 8 neg long 11
17put buf 0 uchar 7
18ck eq write fd buf 0 8 8
19ck eq waitio fd 1 0 1
20ck eq read fd buf 0 8 8
21ck eq get buf 0 uchar 7
22for i ulong 7
23ck eq get buf add i 1 uchar 0
24end
25ck eq waitio fd 1 0 0
26ck eq read fd buf 0 8 neg long 11
27if gt argcnt 1
28n = argread 1 arg 0 8
29ck eq n 1
30if eq get arg 0 uchar 49
31r = vfioirq fd uint 15213 buf 0 8
32ret int r
33end
34if eq get arg 0 uchar 50
35for i ulong 127
36more = eventfd uint 0
37ck ge more 0
38end
39ck eq eventfd uint 0 neg long 24
40end
41end
42shut fd
43ck eq read fd buf 0 8 neg long 9
44initial = int eventfd uint 7
45ck ge initial 0
46ck eq read initial buf 0 8 8
47ck eq get buf 0 uchar 7
48shut initial
49ret 0
50end