From 653d520adad2e2370f4eeae453c3ba54a955c14a Mon Sep 17 00:00:00 2001
From: wadesong <wadesong@codeaurora.org>
Date: Sat, 1 Jul 2017 20:37:57 +0800
Subject: [PATCH] lrdp-v2: Add lowmem page address retrieving for ARM32

memstart_addr is now used by lrdp-v2 to retrieve lowmem page
address, but the variable is only defined on ARM64. Add code for
retrieving the same information on ARM32

Change-Id: I825b318962751b1b948df9cb948149e47e3fdf50
---
 linux-ramdump-parser-v2/mm.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/linux-ramdump-parser-v2/mm.py b/linux-ramdump-parser-v2/mm.py
index efcae52..a7661ce 100644
--- a/linux-ramdump-parser-v2/mm.py
+++ b/linux-ramdump-parser-v2/mm.py
@@ -271,8 +271,11 @@ def dont_map_hole_lowmem_page_address(ramdump, page):
 
 def normal_lowmem_page_address(ramdump, page):
     phys = page_to_pfn(ramdump, page) << 12
-    memstart_addr = ramdump.read_s64('memstart_addr')
-    return phys - memstart_addr + ramdump.page_offset
+    if ramdump.arm64:
+        memstart_addr = ramdump.read_s64('memstart_addr')
+        return phys - memstart_addr + ramdump.page_offset
+    else:
+        return phys - ramdump.phys_offset + ramdump.page_offset
 
 
 def lowmem_page_address(ramdump, page):
-- 
GitLab