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 / tests / irq_trace.om

63 lines · 1339 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Host-only fixture. A new process is a new model lifetime; never resets a live handler.
3global itinp uchar 16
4global itout uchar 128
5fn itput off ulong v ulong to void
6for i ulong 8
7put itout add off i uchar and shr v mul i 8 255
8end
9end
10fn itstatus off ulong r long to void
11itput off ulong add r 32
12end
13fn main to int
14n = read 0 itinp 0 16
15if ne n 16
16ret 2
17end
18put israw 0 uint get itinp 0
19put ismask 0 uint get itinp 1
20put isdest 0 uint get itinp 2
21put iscnt 0 ulong get itinp 3
22put isedge 0 ulong get itinp 5
23put isfail 0 ulong get itinp 6
24put islock 0 ulong get itinp 7
25put istail 0 ulong get itinp 8
26put ispm 0 ulong get itinp 9
27put iqmode 0 ulong get itinp 10
28r = iqinit 7
29if ne r 0
30ret 3
31end
32gen = ulong 7
33if ne get itinp 11 0
34gen = 8
35end
36r = iqservice gen ulong get itinp 4
37itstatus 0 r
38itput 8 get iqstate 0
39itput 16 ulong get iqpend 0
40itput 24 get iqdone 0
41itput 32 get isdone 0
42itput 40 ulong get israw 0
43itput 48 get isacks 0
44itput 56 get isreads 0
45itput 64 get ismasks 0
46if ne get itinp 12 0
47r = iqservice 7 ulong get itinp 4
48else
49r = iqinit 8
50end
51itstatus 72 r
52itput 80 ulong get iqpend 0
53itput 88 get isdone 0
54itput 96 get isacks 0
55itput 104 get isreads 0
56itput 112 get ismasks 0
57itput 120 get isviol 0
58n = write 1 itout 0 128
59if ne n 128
60ret 4
61end
62ret 0
63end