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 / gpu / driver / tests / irqcmd_trace.om

75 lines · 1257 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note HOST MODEL verifier input; opcode9 deliberately corrupts peer-owned live storage after capture.
3global ciin uchar 512
4global ciout uchar 64
5fn ciword o ulong v ulong to void
6for i ulong 8
7put ciout add o i uchar and shr v mul i 8 255
8end
9end
10fn ciop op uchar to long
11if eq op 0
12if ne get iqcstate 0 0
13ret -4
14end
15put iqcmode 0 1
16put iqcstate 0 1
17ret 0
18end
19if or eq op 1 eq op 2
20ret iqcommand ulong op add get iqcseq 0 1 16 32 4
21end
22if eq op 3
23ret iqcommand 1 get iqcseq 0 16 32 4
24end
25if eq op 4
26ret iqctake
27end
28if eq op 5
29ret iqcack iqcget 1
30end
31if eq op 6
32ret iqcack add iqcget 1 1
33end
34if eq op 7
35ret iqcrevoke
36end
37if eq op 8
38put iqcmode 0 0
39ret 0
40end
41if eq op 9
42put iqcmd add mul rem get iqccons 0 8 40 8 99
43ret 0
44end
45if eq op 10
46ret iqcommand 3 add get iqcseq 0 1 16 32 4
47end
48ret iqcommand 1 0 16 32 4
49end
50fn main to int
51n = read 0 ciin 0 512
52if lt n 0
53ret 2
54end
55for k ulong ulong n
56r = ciop get ciin k
57ciword 0 ulong add r 128
58ciword 8 get iqcprod 0
59ciword 16 get iqccons 0
60ciword 24 get iqcstate 0
61ciword 32 get iqchold 0
62ciword 40 get iqcseq 0
63ciword 48 iqcget 0
64ciword 56 iqcget 1
65r = write 1 ciout 0 64
66if ne r 64
67ret 3
68end
69r = write 1 iqcitem 0 40
70if ne r 40
71ret 4
72end
73end
74ret 0
75end