summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMadhukar Pappireddy <madhukar.pappireddy@arm.com>2020-10-16 22:00:04 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-10-16 22:00:04 +0000
commit4a6b33ec17702dfa23d8380e8e55b7f49f49dc7a (patch)
tree054961bb1000139e73f5ab3e9d4a65ea4bc6d7ef /lib
parent29736030f3a75db07775a55dc1d129895b6c2087 (diff)
parent4b918452bdb3f117c3ab735313e8a1b86e938440 (diff)
Merge changes Iba51bff1,I3f563cff into integration
* changes: plat:qti Mandate SMC implementaion and bug fix Update in coreboot_get_memory_type API to include size as well
Diffstat (limited to 'lib')
-rw-r--r--lib/coreboot/coreboot_table.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/coreboot/coreboot_table.c b/lib/coreboot/coreboot_table.c
index c4cd1d752..fb31ef1e0 100644
--- a/lib/coreboot/coreboot_table.c
+++ b/lib/coreboot/coreboot_table.c
@@ -89,7 +89,7 @@ static void setup_cbmem_console(uintptr_t baseaddr)
CONSOLE_FLAG_CRASH);
}
-coreboot_memory_t coreboot_get_memory_type(uintptr_t address)
+coreboot_memory_t coreboot_get_memory_type(uintptr_t start, size_t size)
{
int i;
@@ -98,9 +98,11 @@ coreboot_memory_t coreboot_get_memory_type(uintptr_t address)
if (range->type == CB_MEM_NONE)
break; /* end of table reached */
- if (address >= range->start &&
- address - range->start < range->size)
+ if ((start >= range->start) &&
+ (start - range->start < range->size) &&
+ (size <= range->size - (start - range->start))) {
return range->type;
+ }
}
return CB_MEM_NONE;