mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-11 10:07:05 +00:00
m1n1.fw.agx.channels: Remove creation code
Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
parent
3133dcfa15
commit
891bdd3101
1 changed files with 5 additions and 60 deletions
|
@ -308,9 +308,8 @@ class Channel(Reloadable):
|
|||
data = obj.build()
|
||||
self.uat.iowrite(0, self.rb_base[ring] + index * size, data)
|
||||
|
||||
Channel = Channel._reloadcls()
|
||||
|
||||
ChannelInfo = Struct(
|
||||
class ChannelInfo(ConstructClass):
|
||||
subcon = Struct(
|
||||
"state_addr" / Hex(Int64ul),
|
||||
"ringbuffer_addr" / Hex(Int64ul),
|
||||
)
|
||||
|
@ -320,57 +319,3 @@ class Channels(ConstructClass):
|
|||
|
||||
subcon = Struct(*[ name / ChannelInfo for name in channelNames])
|
||||
|
||||
def __init__(self, heap, shared_heap):
|
||||
for i in range(12):
|
||||
setattr(self, channelNames[i], Container(
|
||||
state_addr = shared_heap.malloc(ChannelState.sizeof()),
|
||||
ringbuffer_addr = heap.malloc(256 * NotifyCmdQueueWork.sizeof()),
|
||||
ringbuffer = [Container()] * 256,
|
||||
))
|
||||
|
||||
self.DevCtrl = Container(
|
||||
state_addr = shared_heap.malloc(ChannelState.sizeof()),
|
||||
ringbuffer_addr = heap.malloc(256 * UnknownMsg.sizeof()),
|
||||
ringbuffer = [UnknownMsg()] * 256,
|
||||
)
|
||||
|
||||
self.Return0 = Container(
|
||||
state_addr = heap.malloc(ChannelState.sizeof()),
|
||||
ringbuffer_addr = heap.malloc(256 * 0x38),
|
||||
ringbuffer = [b"\0" * 0x38] * 256
|
||||
)
|
||||
|
||||
self.Return1 = Container(
|
||||
state_addr = heap.malloc(ChannelState.sizeof()),
|
||||
ringbuffer_addr = heap.malloc(256 * UnknownMsg.sizeof()),
|
||||
ringbuffer = [UnknownMsg()] * 256,
|
||||
)
|
||||
|
||||
self.Return2 = Container(
|
||||
state_addr = heap.malloc(ChannelState.sizeof()),
|
||||
ringbuffer_addr = heap.malloc(256 * UnknownMsg.sizeof()),
|
||||
ringbuffer = [UnknownMsg()] * 256,
|
||||
)
|
||||
|
||||
self.Return3 = Container(
|
||||
state_addr = heap.malloc(ChannelState.sizeof()),
|
||||
ringbuffer_addr = heap.malloc(256 * UnknownMsg.sizeof()),
|
||||
ringbuffer = [UnknownMsg()] * 256,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
str = "Channels:\n"
|
||||
for name in channelNames:
|
||||
channel = getattr(self, name)
|
||||
str += f" {name}: head:{channel.state.head} tail:{channel.state.tail} "
|
||||
str += f"ringbuffer: {channel.ringbuffer_addr:#x}\n"
|
||||
|
||||
return str
|
||||
|
||||
def __len__(self):
|
||||
return self.CHAN_COUNT
|
||||
|
||||
def __getitem__(self, item):
|
||||
if isinstance(item, int):
|
||||
item = channelNames[item]
|
||||
return super().__getitem__(item)
|
||||
|
|
Loading…
Reference in a new issue