From 554146d39c032ad378b4501fe57049745ca48ee0 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Tue, 19 May 2015 14:14:52 +0200 Subject: [PATCH] base: enforce ram_quota donations to be consistent For several basic sessions that core provides default ram quota values exist in the form of enum values. They are used e.g. by init to deduce session costs. Unfortunately they were not used when actually establishing the session, which lead to inconsistencies. Ref #1443 --- repos/base/include/cpu_session/connection.h | 6 +++--- repos/base/include/pd_session/connection.h | 4 ++-- repos/base/include/ram_session/connection.h | 4 ++-- repos/base/include/rm_session/connection.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/repos/base/include/cpu_session/connection.h b/repos/base/include/cpu_session/connection.h index 8c5a9e813a..3fc8da6fd6 100644 --- a/repos/base/include/cpu_session/connection.h +++ b/repos/base/include/cpu_session/connection.h @@ -22,7 +22,7 @@ namespace Genode { struct Cpu_connection; } struct Genode::Cpu_connection : Connection, Cpu_session_client { - enum { RAM_QUOTA = 32*1024 }; + enum { RAM_QUOTA = 36*1024 }; /** * Constructor @@ -36,8 +36,8 @@ struct Genode::Cpu_connection : Connection, Cpu_session_client Affinity const &affinity = Affinity()) : Connection( - session(affinity, "priority=0x%lx, ram_quota=36K, label=\"%s\"", - priority, label)), + session(affinity, "priority=0x%lx, ram_quota=%u, label=\"%s\"", + priority, RAM_QUOTA, label)), Cpu_session_client(cap()) { } }; diff --git a/repos/base/include/pd_session/connection.h b/repos/base/include/pd_session/connection.h index 7916fdc75d..d1b4fa0bd2 100644 --- a/repos/base/include/pd_session/connection.h +++ b/repos/base/include/pd_session/connection.h @@ -30,8 +30,8 @@ struct Genode::Pd_connection : Connection, Pd_session_client * \param label session label */ Pd_connection(char const *label = "", Native_pd_args const *pd_args = 0) - : - Connection(session("ram_quota=4K, label=\"%s\"", label)), + : Connection(session("ram_quota=%u, label=\"%s\"", + RAM_QUOTA, label)), Pd_session_client(cap()) { } }; diff --git a/repos/base/include/ram_session/connection.h b/repos/base/include/ram_session/connection.h index 755aaf2a61..60089aabb0 100644 --- a/repos/base/include/ram_session/connection.h +++ b/repos/base/include/ram_session/connection.h @@ -32,8 +32,8 @@ struct Genode::Ram_connection : Connection, Ram_session_client unsigned long phys_size = 0UL) : Connection( - session("ram_quota=64K, phys_start=0x%lx, phys_size=0x%lx, " - "label=\"%s\"", phys_start, phys_size, label)), + session("ram_quota=%u, phys_start=0x%lx, phys_size=0x%lx, " + "label=\"%s\"", RAM_QUOTA, phys_start, phys_size, label)), Ram_session_client(cap()) { } diff --git a/repos/base/include/rm_session/connection.h b/repos/base/include/rm_session/connection.h index dc39827426..88afd1173a 100644 --- a/repos/base/include/rm_session/connection.h +++ b/repos/base/include/rm_session/connection.h @@ -32,8 +32,8 @@ struct Genode::Rm_connection : Connection, Rm_session_client */ Rm_connection(addr_t start = ~0UL, size_t size = 0) : Connection( - session("ram_quota=64K, start=0x%p, size=0x%zx", - start, size)), + session("ram_quota=%u, start=0x%p, size=0x%zx", + RAM_QUOTA, start, size)), Rm_session_client(cap()) { } };