From 6552d47e60e7cba25306a6a6282d6d74439f5bcb Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Mon, 29 Jun 2015 13:30:35 +0200 Subject: [PATCH] hw: eliminate missing references for consts Fix #1606 --- .../src/core/include/kernel/cpu_scheduler.h | 16 +++++++++------- repos/base-hw/src/core/include/platform_thread.h | 2 +- repos/base-hw/src/core/kernel/cpu_scheduler.cc | 2 +- repos/base-hw/src/core/kernel/thread.cc | 2 +- repos/base-hw/src/core/platform_thread.cc | 2 +- repos/base-hw/src/core/spec/arm/kernel/cpu.cc | 2 +- .../src/core/spec/arm_v7/trustzone/kernel/vm.cc | 2 +- .../core/spec/arm_v7/virtualization/kernel/vm.cc | 2 +- repos/base-hw/src/core/spec/x86/kernel/cpu.cc | 2 +- 9 files changed, 17 insertions(+), 15 deletions(-) diff --git a/repos/base-hw/src/core/include/kernel/cpu_scheduler.h b/repos/base-hw/src/core/include/kernel/cpu_scheduler.h index 1174d03bd1..ac8040b76d 100644 --- a/repos/base-hw/src/core/include/kernel/cpu_scheduler.h +++ b/repos/base-hw/src/core/include/kernel/cpu_scheduler.h @@ -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_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 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 static Share * _share(T * const t) { return static_cast(t); } diff --git a/repos/base-hw/src/core/include/platform_thread.h b/repos/base-hw/src/core/include/platform_thread.h index cc72cfa0a8..230d4f2091 100644 --- a/repos/base-hw/src/core/include/platform_thread.h +++ b/repos/base-hw/src/core/include/platform_thread.h @@ -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); } diff --git a/repos/base-hw/src/core/kernel/cpu_scheduler.cc b/repos/base-hw/src/core/kernel/cpu_scheduler.cc index 2a26fb07fd..3d27302ce2 100644 --- a/repos/base-hw/src/core/kernel/cpu_scheduler.cc +++ b/repos/base-hw/src/core/kernel/cpu_scheduler.cc @@ -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; } diff --git a/repos/base-hw/src/core/kernel/thread.cc b/repos/base-hw/src/core/kernel/thread.cc index 7d8bb23eaf..6c831369d8 100644 --- a/repos/base-hw/src/core/kernel/thread.cc +++ b/repos/base-hw/src/core/kernel/thread.cc @@ -751,7 +751,7 @@ void Thread::_call() *****************/ Core_thread::Core_thread() -: Core_object(Cpu_priority::max, 0, "core") +: Core_object(Cpu_priority::MAX, 0, "core") { using Genode::Native_utcb; diff --git a/repos/base-hw/src/core/platform_thread.cc b/repos/base-hw/src/core/platform_thread.cc index e2c6084276..34982b0949 100644 --- a/repos/base-hw/src/core/platform_thread.cc +++ b/repos/base-hw/src/core/platform_thread.cc @@ -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(true, Kernel::Cpu_priority::max, 0, _label), +: Kernel_object(true, Kernel::Cpu_priority::MAX, 0, _label), _pd(Kernel::core_pd()->platform_pd()), _rm_client(nullptr), _utcb_core_addr(utcb), diff --git a/repos/base-hw/src/core/spec/arm/kernel/cpu.cc b/repos/base-hw/src/core/spec/arm/kernel/cpu.cc index 94ee1f5e9e..b41ec50fea 100644 --- a/repos/base-hw/src/core/spec/arm/kernel/cpu.cc +++ b/repos/base-hw/src/core/spec/arm/kernel/cpu.cc @@ -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; diff --git a/repos/base-hw/src/core/spec/arm_v7/trustzone/kernel/vm.cc b/repos/base-hw/src/core/spec/arm_v7/trustzone/kernel/vm.cc index df00152c2b..41b57f554a 100644 --- a/repos/base-hw/src/core/spec/arm_v7/trustzone/kernel/vm.cc +++ b/repos/base-hw/src/core/spec/arm_v7/trustzone/kernel/vm.cc @@ -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) { diff --git a/repos/base-hw/src/core/spec/arm_v7/virtualization/kernel/vm.cc b/repos/base-hw/src/core/spec/arm_v7/virtualization/kernel/vm.cc index 356af34bfa..38406f8748 100644 --- a/repos/base-hw/src/core/spec/arm_v7/virtualization/kernel/vm.cc +++ b/repos/base-hw/src/core/spec/arm_v7/virtualization/kernel/vm.cc @@ -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), diff --git a/repos/base-hw/src/core/spec/x86/kernel/cpu.cc b/repos/base-hw/src/core/spec/x86/kernel/cpu.cc index 8a6b4721fb..98e0aa7f25 100644 --- a/repos/base-hw/src/core/spec/x86/kernel/cpu.cc +++ b/repos/base-hw/src/core/spec/x86/kernel/cpu.cc @@ -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;