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 / gsp / irqcmd.om

58 lines · 1156 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Next host milestone: immutable model command consumption with once-only exact-sequence ACK.
3note iqcommand acceptance/iqcack consumption NEVER claims MMU/TLB completion or a physical RPC ID.
4global iqchold ulong 1
5global iqcitem uchar 40
6fn iqcget word ulong to ulong
7if gt word 4
8ret 0
9end
10v = ulong 0
11for i ulong 8
12v = or v shl ulong get iqcitem add mul word 8 i mul i 8
13end
14ret v
15end
16fn iqctake to long
17if ne get iqcmode 0 1
18ret -95
19end
20if or ne get iqcstate 0 1 ne get iqchold 0 0
21ret -4
22end
23if eq get iqccons 0 get iqcprod 0
24ret 0
25end
26o = mul rem get iqccons 0 8 40
27for i ulong 40
28put iqcitem i get iqcmd add o i
29end
30put iqchold 0 1
31ret 1
32end
33fn iqcack seq ulong to long
34if ne get iqcmode 0 1
35ret -95
36end
37if or ne get iqcstate 0 1 ne get iqchold 0 1
38ret -4
39end
40if or eq seq 0 ne seq iqcget 1
41ret -4
42end
43put iqchold 0 0
44put iqccons 0 add get iqccons 0 1
45ret 0
46end
47fn iqcrevoke to long
48if ne get iqcmode 0 1
49ret -95
50end
51if ne get iqcstate 0 1
52ret -4
53end
54put iqcstate 0 2
55put iqchold 0 0
56note No consumer publication on cancellation; queued/unacknowledged records are retained.
57ret 0
58end