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

View File

@ -77,7 +77,7 @@ void Cpu_scheduler::_head_filled(unsigned const r)
bool Cpu_scheduler::_claim_for_head() 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()); Share * const s = _share(_rcl[p].head());
if (!s) { continue; } if (!s) { continue; }
if (!s->_claim) { continue; } if (!s->_claim) { continue; }

View File

@ -751,7 +751,7 @@ void Thread::_call()
*****************/ *****************/
Core_thread::Core_thread() Core_thread::Core_thread()
: Core_object<Thread>(Cpu_priority::max, 0, "core") : Core_object<Thread>(Cpu_priority::MAX, 0, "core")
{ {
using Genode::Native_utcb; 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, Platform_thread::Platform_thread(const char * const label,
Native_utcb * utcb) 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()), _pd(Kernel::core_pd()->platform_pd()),
_rm_client(nullptr), _rm_client(nullptr),
_utcb_core_addr(utcb), _utcb_core_addr(utcb),

View File

@ -21,7 +21,7 @@
using namespace Kernel; 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_job::cpu(cpu);
cpu_exception = RESET; cpu_exception = RESET;

View File

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

View File

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

View File

@ -19,7 +19,7 @@
using namespace Kernel; 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_job::cpu(cpu);
ip = (addr_t)&_main; ip = (addr_t)&_main;