m1n1.hw.admac: Add fill_canary()

Signed-off-by: Martin Povišer <povik@protonmail.com>
This commit is contained in:
Martin Povišer 2022-08-29 13:35:44 +02:00 committed by Hector Martin
parent e20509f42d
commit 42f7f46bdc

View file

@ -380,6 +380,13 @@ class ADMAC(Reloadable):
assert self.dart is not None
self.dart.iowrite(self.dart_stream, base, data)
def fill_canary(self):
ranges = self.dart.iotranslate(self.dart_stream,
self.resmem_iova, self.resmem_size)
assert len(ranges) == 1
start, size = ranges[0]
self.p.memset8(start, 0xba, size)
def get_buffer(self, size):
assert size < self.resmem_size