dmc_monitor: arm need check memory map [1/1]

PD#SWPL-132402

Problem:
read no map memory failed when arm build

Solution:
check memory map when arm build

Verify:
local

Change-Id: Ie9a0359168e3ed620a8bb2a5b7a3ef3e85d983bc
Signed-off-by: qinglin.li <qinglin.li@amlogic.com>
This commit is contained in:
qinglin.li
2023-08-01 17:47:57 +08:00
committed by Dongjin Kim
parent f1d84fcb1f
commit ff7f9cb5b5
2 changed files with 16 additions and 0 deletions

View File

@@ -155,6 +155,9 @@ typedef struct page *pgtable_t;
#ifdef CONFIG_HAVE_ARCH_PFN_VALID
extern int pfn_valid(unsigned long);
#if IS_ENABLED(CONFIG_AMLOGIC_DMC_MONITOR_BREAK_GKI)
extern int pfn_is_map_memory(unsigned long pfn);
#endif
#endif
#include <asm/memory.h>

View File

@@ -147,6 +147,19 @@ int pfn_valid(unsigned long pfn)
return 0;
}
EXPORT_SYMBOL(pfn_valid);
#if IS_ENABLED(CONFIG_AMLOGIC_DMC_MONITOR_BREAK_GKI)
int pfn_is_map_memory(unsigned long pfn)
{
phys_addr_t addr = __pfn_to_phys(pfn);
if (pfn_valid(pfn))
return memblock_is_map_memory(addr);
return 0;
}
EXPORT_SYMBOL(pfn_is_map_memory);
#endif
#endif
static bool arm_memblock_steal_permitted = true;