mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 20:05:54 +00:00
parent
e38060d81e
commit
f545fa0e36
@ -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
|
||||
|
@ -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(); }
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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()); }
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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(); }
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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(); }
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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(); }
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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(); }
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user