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 / om2 / fnhost / dev.om

51 lines · 1112 bytes Raw Blame History
1note dev.om: an OM-2 function unit (no fn main) using every function-mode clock and device word:
2note monons realns sleepns, devctl devcall uvmctl, mapnew mapaddr mapset mapget mapwrite mapread mapdrop,
3note with cpufence between the payload and the doorbell. The mapping words find their table through
4note runtime-table entry 31 (seed/host/MAPPING.md, function mode); the exact code is pinned by sha256.
5om2
6fn clk to long
7a = monons
8s = sleepns long 1000
9b = monons
10r = realns
11if lt s 0
12ret s
13end
14if lt r 0
15ret r
16end
17ret sub b a
18end
19fn dev fd int to long
20b = new uchar 48 0
21r = devctl fd uint 21531 b 0 4
22if lt r 0
23ret r
24end
25r = devctl fd uint 3224389163 b 0 48
26hd = new uchar 32 0
27pa = new uchar 16 0
28k = devcall fd uint 3223340587 hd 0 32 pa 0 16
29u = uvmctl fd uint 75 b 0 8
30ret add add r k u
31end
32fn ring v ulong to long
33h = mapnew neg int 1 0 4096 3 34
34if lt h 0
35ret h
36end
37p = new uchar 16 7
38a = mapaddr h
39w = mapwrite h 16 p 0 16
40cpufence
41d = mapset h 8 8 v
42d = mapset h 0 4 1
43x = long mapget h 8 8
44q = new uchar 16 0
45n = mapread h 16 q 0 16
46z = mapdrop h
47if eq a 0
48ret -1
49end
50ret add x long get q 15
51end