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 / omc / sites / found-xhreq-4.om

94 lines · 2390 bytes Raw Blame History
1note sites: found by a one-token change of a tracked program (41 to 120 lines); reaches the omc error site in xhreq (code 9)
2note Parameter binding checks use invalid descriptors, never a GPU device.
3global header uchar 48
4global params uchar 32
5note The parameter pool is image-backed, not a per-call stack allocation.
6global large uchar 1048577
7global status uchar 4
8text msg "PASS native device parameter binding\n"
9fn ck yes bool to void
10if not yes
11exit int 80
12end
13end
14fn fault k int to int
15if eq k 0
16r = devcall neg 15 1 uint 3223340587 header 0 31 params 0 0
17ret int r
18end
19if eq k 1
20r = devcall neg int 1 uint 3223340587 header 17 32 params 0 0
21ret int r
22end
23if eq k 2
24r = devcall neg int 1 uint 3223340587 header 0 32 params 31 2
25ret int r
26end
27if eq k 3
28put header 16 1
29r = devcall neg int 1 uint 3223340587 header 0 32 params 0 1
30ret int r
31end
32if eq k 4
33r = devcall neg int 1 uint 3223340587 header 0 32 large 0 1048577
34ret int r
35end
36if eq k 6
37r = devcall neg int 1 uint 3223340587 header 0 32 large 2 1048576
38ret int r
39end
40r = devcall neg int 1 uint 3223340587 header 0 32 params 18446744073709551615 1
41ret int r
42end
43fn main to int
44for i ulong 48
45put header i 171
46end
47for i ulong 8
48put header add i 24 0
49end
50for n ulong 33
51ck eq devcall neg int 1 uint 3223340587 header 8 32 params 0 n neg long 9
52for i ulong 48
53if and ge i 24 lt i 32
54ck eq get header i 0
55else
56if eq i 32
57ck eq get header i uchar n
58else
59if and gt i 32 lt i 36
60ck eq get header i 0
61else
62ck eq get header i 171
63end
64end
65end
66end
67end
68ck eq add devcall neg int 1 uint 3223340586 header 8 32 params 4 12 10 1
69for i ulong 48
70put header i 0
71end
72ck eq devcall neg int 1 uint 3223340587 header 0 32 large 1 16383 neg long 9
73note Harmless memfd ioctls must reach Linux and return ENOTTY, not trap.
74fd = memfd msg 0 len msg 0
75ck ge fd 0
76ck eq devcall int fd uint 3223340587 header 0 32 large 0 16384 neg long 25
77ck eq devcall int fd uint 3223340587 header 0 32 large 0 32 neg long 25
78ck eq devcall int fd uint 3223340587 header 0 32 large 0 55888 neg long 25
79ck eq devcall int fd uint 3223340587 header 0 32 large 1 1048576 neg long 25
80ck eq devcall int fd uint 3223340586 header 0 32 large 0 1048576 neg long 25
81ck eq fclose int fd 0
82for k int 7
83p = fork
84ck ge p 0
85if eq p 0
86exit fault k
87end
88ck eq waitpid int p status 0 4 0 p
89ck eq get status 0 0
90ck eq get status 1 103
91end
92ck eq write 1 msg 0 len msg long len msg
93ret 0
94end