mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-26 16:30:17 +00:00
m1n1.agx.channels: Complain if the ring pointer overflows
Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
parent
0e8a522845
commit
7a38d14a0c
1 changed files with 3 additions and 0 deletions
|
@ -44,6 +44,9 @@ class GPURXChannel(GPUChannel):
|
||||||
wptr = self.state.WRITE_PTR.val
|
wptr = self.state.WRITE_PTR.val
|
||||||
rptr = self.state.READ_PTR.val
|
rptr = self.state.READ_PTR.val
|
||||||
|
|
||||||
|
if wptr >= self.ring_size:
|
||||||
|
raise Exception(f"wptr = {wptr:#x} > {self.ring_size:#x}")
|
||||||
|
|
||||||
while rptr != wptr:
|
while rptr != wptr:
|
||||||
msg = self.iface.readmem(self.ring_addr + self.item_size * rptr,
|
msg = self.iface.readmem(self.ring_addr + self.item_size * rptr,
|
||||||
self.item_size)
|
self.item_size)
|
||||||
|
|
Loading…
Reference in a new issue