hw: eliminate missing references for consts

Fix #1606
This commit is contained in:
Stefan Kalkowski 2015-06-29 13:30:35 +02:00 committed by Christian Helmuth
parent 11c31c4432
commit 6552d47e60
9 changed files with 17 additions and 15 deletions

View File

@ -55,13 +55,15 @@ class Kernel::Cpu_priority
public:
static constexpr signed min = 0;
static constexpr signed max = cpu_priorities - 1;
enum {
MIN = 0,
MAX = cpu_priorities - 1,
};
/**
* Construct priority with value 'v'
*/
Cpu_priority(signed const v) : _value(Genode::min(v, max)) { }
Cpu_priority(signed const v) : _value(Genode::min(v, MAX)) { }
/*
* Standard operators
@ -69,7 +71,7 @@ class Kernel::Cpu_priority
Cpu_priority & operator =(signed const v)
{
_value = Genode::min(v, max);
_value = Genode::min(v, MAX);
return *this;
}
@ -118,8 +120,8 @@ class Kernel::Cpu_scheduler
typedef Double_list_typed<Fill> Fill_list;
typedef Cpu_priority Prio;
Claim_list _rcl[Prio::max + 1]; /* ready claims */
Claim_list _ucl[Prio::max + 1]; /* unready claims */
Claim_list _rcl[Prio::MAX + 1]; /* ready claims */
Claim_list _ucl[Prio::MAX + 1]; /* unready claims */
Fill_list _fills; /* ready fills */
Share * const _idle;
Share * _head;
@ -131,7 +133,7 @@ class Kernel::Cpu_scheduler
unsigned const _fill;
template <typename F> void _for_each_prio(F f) {
for (signed p = Prio::max; p > Prio::min - 1; p--) { f(p); } }
for (signed p = Prio::MAX; p > Prio::MIN - 1; p--) { f(p); } }
template <typename T>
static Share * _share(T * const t) { return static_cast<Share *>(t); }

View File

@ -75,7 +75,7 @@ namespace Genode {
unsigned _priority(unsigned virt_prio)
{
return Cpu_session::scale_priority(Kernel::Cpu_priority::max,
return Cpu_session::scale_priority(Kernel::Cpu_priority::MAX,
virt_prio);
}

View File

@ -77,7 +77,7 @@ void Cpu_scheduler::_head_filled(unsigned const r)
bool Cpu_scheduler::_claim_for_head()
{
for (signed p = Prio::max; p > Prio::min - 1; p--) {
for (signed p = Prio::MAX; p > Prio::MIN - 1; p--) {
Share * const s = _share(_rcl[p].head());
if (!s) { continue; }
if (!s->_claim) { continue; }

View File

@ -751,7 +751,7 @@ void Thread::_call()
*****************/
Core_thread::Core_thread()
: Core_object<Thread>(Cpu_priority::max, 0, "core")
: Core_object<Thread>(Cpu_priority::MAX, 0, "core")
{
using Genode::Native_utcb;

View File

@ -83,7 +83,7 @@ void Platform_thread::quota(size_t const quota) {
Platform_thread::Platform_thread(const char * const label,
Native_utcb * utcb)
: Kernel_object<Kernel::Thread>(true, Kernel::Cpu_priority::max, 0, _label),
: Kernel_object<Kernel::Thread>(true, Kernel::Cpu_priority::MAX, 0, _label),
_pd(Kernel::core_pd()->platform_pd()),
_rm_client(nullptr),
_utcb_core_addr(utcb),

View File

@ -21,7 +21,7 @@
using namespace Kernel;
Cpu_idle::Cpu_idle(Cpu * const cpu) : Cpu_job(Cpu_priority::min, 0)
Cpu_idle::Cpu_idle(Cpu * const cpu) : Cpu_job(Cpu_priority::MIN, 0)
{
Cpu_job::cpu(cpu);
cpu_exception = RESET;

View File

@ -26,7 +26,7 @@ using namespace Kernel;
Kernel::Vm::Vm(void * const state,
Kernel::Signal_context * const context,
void * const table)
: Cpu_job(Cpu_priority::min, 0),
: Cpu_job(Cpu_priority::MIN, 0),
_state((Genode::Vm_state * const)state),
_context(context), _table(0)
{

View File

@ -219,7 +219,7 @@ static Vmid_allocator &alloc()
Kernel::Vm::Vm(void * const state,
Kernel::Signal_context * const context,
void * const table)
: Cpu_job(Cpu_priority::min, 0),
: Cpu_job(Cpu_priority::MIN, 0),
_id(alloc().alloc()),
_state((Genode::Vm_state * const)state),
_context(context),

View File

@ -19,7 +19,7 @@
using namespace Kernel;
Cpu_idle::Cpu_idle(Cpu * const cpu) : Cpu_job(Cpu_priority::min, 0)
Cpu_idle::Cpu_idle(Cpu * const cpu) : Cpu_job(Cpu_priority::MIN, 0)
{
Cpu_job::cpu(cpu);
ip = (addr_t)&_main;