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 / uvm / notify.om

75 lines · 1351 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note UVM-owned MODEL notification, not a physical IRQ or TLB completion lease.
3note Uses omega-mv#1045 eventfd only. No OmcVfioIrq registration or device open.
4abstract unirq ulong
5global unfd int 1
6global unlive ulong 1
7global unwakes ulong 1
8global unbytes uchar 8
9fn unvalid cap unirq to bool
10ret and eq open cap 1 eq get unlive 0 1
11end
12fn unirqmk to unirq
13if ne get unlive 0 0
14ret seal unirq ulong 0
15end
16r = eventfd uint 0
17if lt r 0
18ret seal unirq ulong 0
19end
20put unfd 0 int r
21put unlive 0 1
22ret seal unirq ulong 1
23end
24fn unpost cap unirq to long
25if not unvalid cap
26ret -9
27end
28r = fbpush
29if ne r UVOK
30ret long r
31end
32for j ulong 8
33put unbytes j 0
34end
35put unbytes 0 1
36wr = write get unfd 0 unbytes 0 8
37if ne wr 8
38note Entry remains owned by the ring; never undo a possibly delivered notification.
39ret -5
40end
41ret 0
42end
43fn unpump cap unirq timeout long to long
44if not unvalid cap
45ret -9
46end
47r = waitio get unfd 0 1 timeout
48if eq r 0
49ret 0
50end
51if lt r 0
52ret r
53end
54r = read get unfd 0 unbytes 0 8
55if ne r 8
56ret -5
57end
58count = ulong 0
59for j ulong 8
60count = or count shl ulong get unbytes j mul j 8
61end
62put unwakes 0 add get unwakes 0 count
63r2 = fbbatch
64if ne r2 UVOK
65ret long r2
66end
67ret 1
68end
69fn unclose cap unirq to long
70if not unvalid cap
71ret -9
72end
73put unlive 0 2
74ret fclose get unfd 0
75end