interplane.Get Omega
Read in your language

omega-gpu-driver

aien-dev/omega-gpu-driver

Brought by drakestapleton

branch main Branches Tags History

omega-gpu-driver / gsp / owned.om

81 lines · 1674 bytes Raw Blame History
1note Checked CPU staging and uncertainty connection only; NOT a hardware publisher or RPC endpoint.
2note Compose after chan/dma+gmmu and gsp/arena+boot. No device opens, barriers or doorbells here.
3note Real publication still requires reviewed coherency/release/acquire and an authorized endpoint.
4global arsepoch ulong 1
5global arsboot ulong 1
6note All staged bytes target the same checked owned mapping. Publish the receipt after the last copy.
7fn arstdata h long n ulong to bool
8if or eq n 0 gt n ARMAX
9ret false
10end
11low = n
12if gt low ARLOW
13low = ARLOW
14end
15if ne mapwrite h 0 arbuf 0 low long low
16ret false
17end
18if eq low n
19ret true
20end
21page = new uchar 4096 0
22o = low
23while lt o n bound 16384
24size = sub n o
25if gt size 4096
26size = ulong 4096
27end
28for i ulong size
29put page i aroutput add o i
30end
31if ne mapwrite h o page 0 size long size
32ret false
33end
34o = add o size
35end
36ret eq o n
37end
38fn arstage gen ulong to long
39if not mmwepoch gen
40ret MMEGEN
41end
42if ne get bstate 0 4
43ret MMESTATE
44end
45if not or eq get mmwst 0 MMWOWN eq get mmwst 0 MMWDMA
46ret MMESTATE
47end
48if ne get arbase 0 get mmwb 0
49ret MMEINVAL
50end
51if or eq get arused 0 0 gt get arused 0 get mmws 0
52ret MMEINVAL
53end
54if gt get arused 0 ARMAX
55ret MMEINVAL
56end
57put arsepoch 0 0
58put arsboot 0 0
59if not arstdata get mmwh 0 get arused 0
60ret MMEIO
61end
62put arsepoch 0 gen
63put arsboot 0 get bgen 0
64ret MMOK
65end
66note Call only for uncertain completion after an actual publication; never reclaim automatically.
67fn arlose gen ulong to long
68if ne gen get arsepoch 0
69ret MMEGEN
70end
71if ne get bgen 0 get arsboot 0
72ret MMEGEN
73end
74if ne get bstate 0 12
75ret MMESTATE
76end
77if ne get mmwst 0 MMWPUB
78ret MMESTATE
79end
80ret mmwquar gen
81end