Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-gpu-driver/blob/main/tests/irqqueue_trace.om # omega-gpu-driver aien-dev/omega-gpu-driver Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-gpu-driver / tests / irqqueue_trace.om` 116 lines ยท 2388 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 note HOST_MODEL only. Reuses independently constructed wire frames and anonymous mapped queues. 3 global qrout uchar 128 4 fn qrword off ulong value ulong to void 5 for i ulong 8 6 put qrout add off i uchar and shr value mul i 8 255 7 end 8 end 9 fn qrseq value ulong to void 10 put gspmode 0 0 11 siminit 12 rqclear 52 13 rqput32 4 0 3 14 rqput32 4 4 2 15 rqput32 4 40 SQDLY 16 rqput32 4 44 value 17 qframe 4098 52 0 0 0 18 end 19 fn qrpeer mode uchar to void 20 if or eq mode 1 eq mode 8 21 qrseq 5 22 ret 23 end 24 rqclear 1 25 if or eq mode 2 eq mode 6 26 rqput 4 0 1 27 if eq mode 6 28 qframe 4124 0 0 0 0 29 else 30 qframe 4124 1 0 0 0 31 end 32 ret 33 end 34 if eq mode 4 35 qframe 4099 0 0 0 0 36 ret 37 end 38 qframe 4097 0 0 0 0 39 end 40 fn qradversary mode uchar to void 41 if eq mode 7 42 rqclear 0 43 tf 4099 0 0 0 0 44 else 45 rqclear 52 46 rqput32 4 0 3 47 rqput32 4 4 2 48 rqput32 4 40 SQDLY 49 rqput32 4 44 99 50 tf 4098 52 0 0 0 51 end 52 note Explicit hostile peer overwrite BEFORE consumer publication; handler must use immutable captured bytes. 53 r = mapwrite get mmwh 0 add get qtstat 0 RQSLOT rqtmp 0 RQSLOT 54 qck eq r long RQSLOT 55 end 56 fn main to int 57 m = new uchar 1 0 58 qck eq read 0 m 0 1 1 59 mode = get m 0 60 qsetup 61 qck eq drvprep 123 2 3 4 5 0 62 if ne mode 13 63 qrpeer mode 64 end 65 if eq mode 3 66 note Flip the actual mapped wire checksum, not the parser's private captured copy. 67 r = mapset get mmwh 0 add get qtstat 0 add RQSLOT 32 4 1 68 qck eq r 0 69 end 70 if eq mode 14 71 put qtepoch 0 add get qtepoch 0 1 72 end 73 if eq mode 15 74 r = mapset get mmwh 0 add get qtstat 0 16 4 RQCOUNT 75 qck eq r 0 76 end 77 qrword 16 mapget get mmwh 0 add get qtcmd 0 32 4 78 captured = qrready 79 qrword 0 ulong add captured 32 80 qrword 24 mapget get mmwh 0 add get qtcmd 0 32 4 81 probe = long -6 82 if eq mode 9 83 probe = qtfinish get qrtoken 0 84 end 85 if eq mode 10 86 probe = qthandled add get qrtoken 0 1 87 end 88 if eq mode 11 89 probe = qrready 90 end 91 if or eq mode 7 eq mode 8 92 qradversary mode 93 end 94 handled = long 0 95 if eq captured 1 96 handled = qrrecv 97 end 98 qrword 8 ulong add handled 32 99 qrword 32 mapget get mmwh 0 add get qtcmd 0 32 4 100 qrword 40 rqget32 0 32 101 qrword 48 ulong get qtpend 0 102 qrword 56 get qtstate 0 103 qrword 64 get bstate 0 104 qrword 72 get qrstate 0 105 qrword 80 get qrlock 0 106 qrword 88 ulong get rqrx 0 107 qrword 96 ulong get sqdly 0 108 qrword 104 ulong get sqdly 1 109 if not or or eq mode 9 eq mode 10 eq mode 11 110 probe = qrrecv 111 end 112 qrword 112 ulong add probe 32 113 qrword 120 ulong get rqdead 0 114 qck eq write 1 qrout 0 128 128 115 ret 0 116 end