in ArmPlatformPkg/Scripts/Ds5/system_table.py [0:0]
def __init__(self, ec, membase, memsize):
self.membase = membase
self.memsize = memsize
self.ec = ec
found = False
# Start from the top of the memory
offset = self.membase + self.memsize
# Align to highest 4MB boundary
offset = offset & ~0x3FFFFF
# We should not have a System Table at the top of the System Memory
offset = offset - 0x400000
# Start at top and look on 4MB boundaries for system table ptr structure
while offset > self.membase:
try:
signature = struct.unpack("cccccccc", self.ec.getMemoryService().read(str(offset), 8, 32))
except DebugException:
raise Exception('SystemTable','Fail to access System Memory. Ensure all the memory in the region [0x%x;0x%X] is accessible.' % (membase,membase+memsize))
if signature == SystemTable.CONST_ST_SIGNATURE:
found = True
if edk2_debugger.is_aarch64(self.ec):
self.system_table_base = self.ec.getMemoryService().readMemory64(offset + 0x8)
else:
self.system_table_base = self.ec.getMemoryService().readMemory32(offset + 0x8)
break
offset = offset - 0x400000
if not found:
raise Exception('SystemTable','System Table not found in System Memory [0x%x;0x%X]' % (membase,membase+memsize))