vbox: use power of two priority levels

Avoids warnings of init in form of

"priority band too small, losing least-significant priority bits"

when virtualbox starts threads.

Fixes #1323
This commit is contained in:
Alexander Boettcher 2014-12-12 11:27:07 +01:00 committed by Christian Helmuth
parent 51489e2f82
commit 6d02c4c89f
1 changed files with 6 additions and 2 deletions

View File

@ -42,8 +42,12 @@ static Genode::Cpu_session * get_cpu_session(RTTHREADTYPE type) {
if (con[type - 1])
return con[type - 1];
long const prio = (RTTHREADTYPE_END - type) *
(Cpu_session::PRIORITY_LIMIT / RTTHREADTYPE_END);
unsigned const VIRTUAL_GENODE_VBOX_LEVELS = 16;
static_assert (RTTHREADTYPE_END < VIRTUAL_GENODE_VBOX_LEVELS,
"prio levels exceeds VIRTUAL_GENODE_VBOX_LEVELS");
long const prio = (VIRTUAL_GENODE_VBOX_LEVELS - type) *
Cpu_session::PRIORITY_LIMIT / VIRTUAL_GENODE_VBOX_LEVELS;
char * data = new (env()->heap()) char[16];