From ace89877486da16d97b03cd7ffe23cf7d2e0b04a Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Thu, 28 Nov 2013 21:39:23 +0000 Subject: ArmPlatformPkg/Ds5: Update script to support System Memory above the 32bit space on AArch64 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14912 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Scripts/Ds5/system_table.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'ArmPlatformPkg/Scripts') diff --git a/ArmPlatformPkg/Scripts/Ds5/system_table.py b/ArmPlatformPkg/Scripts/Ds5/system_table.py index 2128e25f23..ff1db2f6e4 100644 --- a/ArmPlatformPkg/Scripts/Ds5/system_table.py +++ b/ArmPlatformPkg/Scripts/Ds5/system_table.py @@ -29,14 +29,17 @@ class DebugInfoTable: def get_debug_info(self): # Get the information from EFI_DEBUG_IMAGE_INFO_TABLE_HEADER count = self.ec.getMemoryService().readMemory32(self.base + 0x4) - debug_info_table_base = self.ec.getMemoryService().readMemory32(self.base + 0x8) + if edk2_debugger.is_aarch64(self.ec): + debug_info_table_base = self.ec.getMemoryService().readMemory64(self.base + 0x8) + else: + debug_info_table_base = self.ec.getMemoryService().readMemory32(self.base + 0x8) self.DebugInfos = [] for i in range(0, count): # Get the address of the structure EFI_DEBUG_IMAGE_INFO if edk2_debugger.is_aarch64(self.ec): - debug_info = self.ec.getMemoryService().readMemory32(debug_info_table_base + (i * 8)) + debug_info = self.ec.getMemoryService().readMemory64(debug_info_table_base + (i * 8)) else: debug_info = self.ec.getMemoryService().readMemory32(debug_info_table_base + (i * 4)) @@ -46,9 +49,9 @@ class DebugInfoTable: if debug_info_type == 1: if edk2_debugger.is_aarch64(self.ec): # Get the base address of the structure EFI_LOADED_IMAGE_PROTOCOL - loaded_image_protocol = self.ec.getMemoryService().readMemory32(debug_info + 0x8) + loaded_image_protocol = self.ec.getMemoryService().readMemory64(debug_info + 0x8) - image_base = self.ec.getMemoryService().readMemory32(loaded_image_protocol + 0x40) + image_base = self.ec.getMemoryService().readMemory64(loaded_image_protocol + 0x40) image_size = self.ec.getMemoryService().readMemory32(loaded_image_protocol + 0x48) else: # Get the base address of the structure EFI_LOADED_IMAGE_PROTOCOL @@ -135,7 +138,10 @@ class SystemTable: 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 - self.system_table_base = self.ec.getMemoryService().readMemory32(offset + 0x8) + 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 @@ -148,7 +154,7 @@ class SystemTable: conf_table_entry_count = self.ec.getMemoryService().readMemory32(self.system_table_base + 0x68) # Get location of the Configuration Table entries - conf_table_offset = self.ec.getMemoryService().readMemory32(self.system_table_base + 0x70) + conf_table_offset = self.ec.getMemoryService().readMemory64(self.system_table_base + 0x70) else: # Number of configuration Table entry conf_table_entry_count = self.ec.getMemoryService().readMemory32(self.system_table_base + 0x40) @@ -163,6 +169,9 @@ class SystemTable: offset = conf_table_offset + (i * 0x14) guid = struct.unpack("