diff --git a/base-hw/src/core/arndale/processor_driver.h b/base-hw/src/core/arndale/processor_driver.h index 6dfa0b0130..4e616f5afe 100644 --- a/base-hw/src/core/arndale/processor_driver.h +++ b/base-hw/src/core/arndale/processor_driver.h @@ -29,7 +29,10 @@ namespace Genode /** * Return kernel name of the executing processor */ - static unsigned id() { return Mpidr::Aff_0::get(Mpidr::read()); } + static unsigned executing_id() + { + return Mpidr::Aff_0::get(Mpidr::read()); + } /** * Return kernel name of the primary processor diff --git a/base-hw/src/core/imx53/processor_driver.h b/base-hw/src/core/imx53/processor_driver.h index d5ce16404e..fa0bcecebf 100644 --- a/base-hw/src/core/imx53/processor_driver.h +++ b/base-hw/src/core/imx53/processor_driver.h @@ -34,7 +34,7 @@ namespace Genode /** * Return kernel name of the executing processor */ - static unsigned id() { return primary_id(); } + static unsigned executing_id() { return primary_id(); } }; } diff --git a/base-hw/src/core/kernel/irq.cc b/base-hw/src/core/kernel/irq.cc index 7f8b27c52f..f583c7cc5d 100644 --- a/base-hw/src/core/kernel/irq.cc +++ b/base-hw/src/core/kernel/irq.cc @@ -22,4 +22,4 @@ namespace Kernel { Pic * pic(); } void Irq::_disable() const { pic()->mask(_id()); } -void Irq::_enable() const { pic()->unmask(_id(), Processor::id()); } +void Irq::_enable() const { pic()->unmask(_id(), Processor::executing_id()); } diff --git a/base-hw/src/core/kernel/kernel.cc b/base-hw/src/core/kernel/kernel.cc index 6ae0c310ec..b7916a918d 100644 --- a/base-hw/src/core/kernel/kernel.cc +++ b/base-hw/src/core/kernel/kernel.cc @@ -236,7 +236,7 @@ extern "C" void init_kernel_multiprocessor() /* initialize interrupt controller */ pic()->init_processor_local(); - unsigned const processor_id = Processor::id(); + unsigned const processor_id = Processor::executing_id(); pic()->unmask(Timer::interrupt_id(processor_id), processor_id); /* as primary processor create the core main thread */ @@ -278,7 +278,7 @@ extern "C" void init_kernel_multiprocessor() extern "C" void kernel() { data_lock().lock(); - unsigned const processor_id = Processor::id(); + unsigned const processor_id = Processor::executing_id(); Processor * const processor = processor_pool()->select(processor_id); Processor_scheduler * const scheduler = processor->scheduler(); scheduler->head()->exception(processor_id); diff --git a/base-hw/src/core/kernel/processor.h b/base-hw/src/core/kernel/processor.h index b6db1f35f4..f56dc277b0 100644 --- a/base-hw/src/core/kernel/processor.h +++ b/base-hw/src/core/kernel/processor.h @@ -92,6 +92,7 @@ class Kernel::Processor : public Processor_driver { private: + unsigned const _id; Idle_thread _idle; Processor_scheduler _scheduler; @@ -99,14 +100,21 @@ class Kernel::Processor : public Processor_driver /** * Constructor + * + * \param id kernel name of the processor object */ - Processor() : _idle(this), _scheduler(&_idle) { } + Processor(unsigned const id) + : + _id(id), _idle(this), _scheduler(&_idle) + { } /*************** ** Accessors ** ***************/ + unsigned id() const { return _id; } + Processor_scheduler * scheduler() { return &_scheduler; } }; @@ -126,7 +134,7 @@ class Kernel::Processor_pool Processor_pool() { for (unsigned i = 0; i < PROCESSORS; i++) { - new (_data[i]) Processor; + new (_data[i]) Processor(i); } } diff --git a/base-hw/src/core/odroid_xu/processor_driver.h b/base-hw/src/core/odroid_xu/processor_driver.h index eb5ed23bcb..c4db794aa3 100644 --- a/base-hw/src/core/odroid_xu/processor_driver.h +++ b/base-hw/src/core/odroid_xu/processor_driver.h @@ -29,7 +29,7 @@ namespace Genode /** * Return kernel name of the executing processor */ - static unsigned id() { return 0; } + static unsigned executing_id() { return 0; } /** * Return kernel name of the primary processor diff --git a/base-hw/src/core/panda/processor_driver.h b/base-hw/src/core/panda/processor_driver.h index ebe63f3afb..b067a37252 100644 --- a/base-hw/src/core/panda/processor_driver.h +++ b/base-hw/src/core/panda/processor_driver.h @@ -34,7 +34,7 @@ namespace Genode /** * Return kernel name of the executing processor */ - static unsigned id() { return primary_id(); } + static unsigned executing_id() { return primary_id(); } }; } diff --git a/base-hw/src/core/pbxa9/processor_driver.h b/base-hw/src/core/pbxa9/processor_driver.h index 4dc5b3dc82..3f61b8b8d5 100644 --- a/base-hw/src/core/pbxa9/processor_driver.h +++ b/base-hw/src/core/pbxa9/processor_driver.h @@ -34,7 +34,7 @@ namespace Genode /** * Return kernel name of the executing processor */ - static unsigned id() { return primary_id(); } + static unsigned executing_id() { return primary_id(); } }; } diff --git a/base-hw/src/core/processor_driver/arm_v6.h b/base-hw/src/core/processor_driver/arm_v6.h index 86f49ca34f..e8abea282e 100644 --- a/base-hw/src/core/processor_driver/arm_v6.h +++ b/base-hw/src/core/processor_driver/arm_v6.h @@ -212,7 +212,7 @@ namespace Arm_v6 /** * Return kernel name of the executing processor */ - static unsigned id() { return primary_id(); } + static unsigned executing_id() { return primary_id(); } }; } diff --git a/base-hw/src/core/vea9x4/processor_driver.h b/base-hw/src/core/vea9x4/processor_driver.h index 99f21e991a..bfa75098dd 100644 --- a/base-hw/src/core/vea9x4/processor_driver.h +++ b/base-hw/src/core/vea9x4/processor_driver.h @@ -34,7 +34,7 @@ namespace Genode /** * Return kernel name of the executing processor */ - static unsigned id() { return primary_id(); } + static unsigned executing_id() { return primary_id(); } }; }