summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg/Scripts
diff options
context:
space:
mode:
authorOlivier Martin <olivier.martin@arm.com>2013-11-28 21:39:23 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2013-11-28 21:39:23 +0000
commitace89877486da16d97b03cd7ffe23cf7d2e0b04a (patch)
tree27636fafec2583551362a1a87d36f4f0aefc7351 /ArmPlatformPkg/Scripts
parent71fd27cbee1468395c0c2be58130bb7642817d25 (diff)
downloadedk2-ace89877486da16d97b03cd7ffe23cf7d2e0b04a.tar.gz
edk2-ace89877486da16d97b03cd7ffe23cf7d2e0b04a.tar.bz2
edk2-ace89877486da16d97b03cd7ffe23cf7d2e0b04a.zip
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 <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14912 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Scripts')
-rw-r--r--ArmPlatformPkg/Scripts/Ds5/system_table.py23
1 files changed, 16 insertions, 7 deletions
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("<IIII", self.ec.getMemoryService().read(str(offset), 16, 32))
if guid == conf_table_guid:
- return self.ec.getMemoryService().readMemory32(offset + 0x10)
+ if edk2_debugger.is_aarch64(self.ec):
+ return self.ec.getMemoryService().readMemory64(offset + 0x10)
+ else:
+ return self.ec.getMemoryService().readMemory32(offset + 0x10)
raise Exception('SystemTable','Configuration Table not found')