Skip to content
Snippets Groups Projects
Commit d570f89b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "linux-ramdump-parser-v2: Add option for custom page offset"

parents 1cbbb437 4adbacab
No related branches found
No related tags found
No related merge requests found
...@@ -436,7 +436,8 @@ class RamDump(): ...@@ -436,7 +436,8 @@ class RamDump():
if urc < 0: if urc < 0:
break break
def __init__(self, vmlinux_path, nm_path, gdb_path, ebi, file_path, phys_offset, outdir, hw_id=None, hw_version=None, arm64=False): def __init__(self, vmlinux_path, nm_path, gdb_path, ebi, file_path, phys_offset, outdir, hw_id=None, hw_version=None, arm64=False,
page_offset=None):
self.ebi_files = [] self.ebi_files = []
self.phys_offset = None self.phys_offset = None
self.tz_start = 0 self.tz_start = 0
...@@ -476,11 +477,14 @@ class RamDump(): ...@@ -476,11 +477,14 @@ class RamDump():
'[!!!] Phys offset was set to {0:x}'.format(phys_offset)) '[!!!] Phys offset was set to {0:x}'.format(phys_offset))
self.phys_offset = phys_offset self.phys_offset = phys_offset
self.lookup_table = [] self.lookup_table = []
self.page_offset = 0xc0000000
self.config = [] self.config = []
if self.arm64: if self.arm64:
self.page_offset = 0xffffffc000000000 self.page_offset = 0xffffffc000000000
self.thread_size = 16384 self.thread_size = 16384
if page_offset is not None:
print_out_str(
'[!!!] Page offset was set to {0:x}'.format(page_offset))
self.page_offset = page_offset
self.setup_symbol_tables() self.setup_symbol_tables()
# The address of swapper_pg_dir can be used to determine # The address of swapper_pg_dir can be used to determine
......
...@@ -106,6 +106,8 @@ if __name__ == '__main__': ...@@ -106,6 +106,8 @@ if __name__ == '__main__':
dest='stdout', help='Dump to stdout instead of the file') dest='stdout', help='Dump to stdout instead of the file')
parser.add_option('', '--phys-offset', type='int', parser.add_option('', '--phys-offset', type='int',
dest='phys_offset', help='use custom phys offset') dest='phys_offset', help='use custom phys offset')
parser.add_option('', '--page-offset', type='int',
dest='page_offset', help='use custom page offset')
parser.add_option('', '--force-hardware', type='int', parser.add_option('', '--force-hardware', type='int',
dest='force_hardware', help='Force the hardware detection') dest='force_hardware', help='Force the hardware detection')
parser.add_option( parser.add_option(
...@@ -260,7 +262,8 @@ if __name__ == '__main__': ...@@ -260,7 +262,8 @@ if __name__ == '__main__':
dump = RamDump(options.vmlinux, nm_path, gdb_path, options.ram_addr, dump = RamDump(options.vmlinux, nm_path, gdb_path, options.ram_addr,
options.autodump, options.phys_offset, options.outdir, options.autodump, options.phys_offset, options.outdir,
options.force_hardware, options.force_hardware_version, options.force_hardware, options.force_hardware_version,
arm64=options.arm64) arm64=options.arm64,
page_offset=options.page_offset)
if options.shell or options.classic_shell: if options.shell or options.classic_shell:
print("Entering interactive shell mode.") print("Entering interactive shell mode.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment