From ba571c79af41261bcb378aca343ddd2990da6d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Thu, 24 Nov 2016 08:10:12 +0100 Subject: [PATCH] arch/riscv/mcall.c: Return the correct memory base and size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ibf471787ccb4f5393b0af737a9f7fc47b853a41a Signed-off-by: Jonathan Neuschäfer Reviewed-on: https://review.coreboot.org/17594 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/arch/riscv/mcall.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/arch/riscv/mcall.c b/src/arch/riscv/mcall.c index fdc02bef2b..aa61ae464a 100644 --- a/src/arch/riscv/mcall.c +++ b/src/arch/riscv/mcall.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -36,10 +37,13 @@ uintptr_t mcall_query_memory(uintptr_t id, memory_block_info *info) { if (id == 0) { - mprv_write_ulong(&info->base, 2U*GiB); + uintptr_t base; + size_t size; - /* TODO: Return the correct value */ - mprv_write_ulong(&info->size, 1*GiB); + query_mem(configstring(), &base, &size); + + mprv_write_ulong(&info->base, base); + mprv_write_ulong(&info->size, size); return 0; }