core: add Platform::max_caps()

This method returns the kernel-specific system-global limit of the total
number of capabilities.

Issue #2398
This commit is contained in:
Norman Feske
2017-05-07 22:44:15 +02:00
committed by Christian Helmuth
parent 82a98065a0
commit bc82cce72b
14 changed files with 105 additions and 39 deletions

View File

@ -51,6 +51,8 @@ namespace Genode {
addr_t _map_pages(addr_t phys_page, addr_t pages);
size_t _max_caps = 0;
public:
/**
@ -72,6 +74,7 @@ namespace Genode {
addr_t vm_start() const override { return _vm_base; }
size_t vm_size() const override { return _vm_size; }
Rom_fs *rom_fs() override { return &_rom_fs; }
size_t max_caps() const override { return _max_caps; }
void wait_for_exit() override;
bool supports_unmap() override { return true; }

View File

@ -642,7 +642,8 @@ Platform::Platform() :
}
/* add capability selector ranges to map */
unsigned index = 0x2000;
unsigned const first_index = 0x2000;
unsigned index = first_index;
for (unsigned i = 0; i < 32; i++)
{
void * phys_ptr = 0;
@ -658,6 +659,7 @@ Platform::Platform() :
index = range->base() + range->elements();
}
_max_caps = index - first_index;
/* add idle ECs to trace sources */
for (unsigned genode_cpu_id = 0; genode_cpu_id < _cpus.width(); genode_cpu_id++) {