From fdf41cd08c8ad6394e914883cdbbde92f72739fa Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Fri, 19 Aug 2016 16:45:28 +0200 Subject: [PATCH] nova: set max memory mapping supported by nova ABI Related #2063 --- repos/base-nova/src/core/include/util.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repos/base-nova/src/core/include/util.h b/repos/base-nova/src/core/include/util.h index d56262925..61a720ea1 100644 --- a/repos/base-nova/src/core/include/util.h +++ b/repos/base-nova/src/core/include/util.h @@ -33,7 +33,12 @@ namespace Genode { inline addr_t map_src_addr(addr_t core_local, addr_t phys) { return phys; } - inline size_t constrain_map_size_log2(size_t size_log2) { return size_log2; } + inline size_t constrain_map_size_log2(size_t size_log2) + { + /* Nova::Mem_crd order has 5 bits available and is in 4K page units */ + enum { MAX_MAP_LOG2 = (1U << 5) - 1 + 12 }; + return size_log2 > MAX_MAP_LOG2 ? MAX_MAP_LOG2 : size_log2; + } inline void print_page_fault(const char *msg, addr_t pf_addr, addr_t pf_ip,