mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-21 16:39:39 +00:00
committed by
Christian Helmuth
parent
d4a3db22bd
commit
e3f82b09d7
@ -157,10 +157,10 @@ addr_t Cpu::stack_start() {
|
||||
return (addr_t)&kernel_stack + KERNEL_STACK_SIZE * (_id+1); }
|
||||
|
||||
|
||||
Cpu::Cpu(unsigned const id, Board::Pic & pic,
|
||||
Cpu::Cpu(unsigned const id,
|
||||
Inter_processor_work_list & global_work_list)
|
||||
:
|
||||
_id(id), _pic(pic), _timer(*this),
|
||||
_id(id), _timer(*this),
|
||||
_scheduler(&_idle, _quota(), _fill()), _idle(*this),
|
||||
_ipi_irq(*this),
|
||||
_global_work_list(global_work_list)
|
||||
@ -174,7 +174,7 @@ Cpu::Cpu(unsigned const id, Board::Pic & pic,
|
||||
bool Cpu_pool::initialize()
|
||||
{
|
||||
unsigned id = Cpu::executing_id();
|
||||
_cpus[id].construct(id, _pic, _global_work_list);
|
||||
_cpus[id].construct(id, _global_work_list);
|
||||
return --_initialized == 0;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ class Kernel::Cpu : public Genode::Cpu, private Irq::Pool, private Timeout
|
||||
|
||||
|
||||
unsigned const _id;
|
||||
Board::Pic &_pic;
|
||||
Board::Pic _pic {};
|
||||
Timer _timer;
|
||||
Cpu_scheduler _scheduler;
|
||||
Idle_thread _idle;
|
||||
@ -132,7 +132,7 @@ class Kernel::Cpu : public Genode::Cpu, private Irq::Pool, private Timeout
|
||||
/**
|
||||
* Construct object for CPU 'id'
|
||||
*/
|
||||
Cpu(unsigned const id, Board::Pic & pic,
|
||||
Cpu(unsigned const id,
|
||||
Inter_processor_work_list & global_work_list);
|
||||
|
||||
static inline unsigned primary_id() { return 0; }
|
||||
@ -191,7 +191,6 @@ class Kernel::Cpu_pool
|
||||
{
|
||||
private:
|
||||
|
||||
Board::Pic _pic {};
|
||||
Inter_processor_work_list _global_work_list {};
|
||||
unsigned _count;
|
||||
unsigned _initialized { _count };
|
||||
|
@ -105,8 +105,6 @@ class Kernel::Timer
|
||||
|
||||
unsigned interrupt_id() const;
|
||||
|
||||
static void init_cpu_local();
|
||||
|
||||
time_t time() const { return _time + _duration(); }
|
||||
};
|
||||
|
||||
|
@ -53,7 +53,6 @@ class Board::Pic : Genode::Mmio
|
||||
|
||||
Pic();
|
||||
|
||||
void init_cpu_local();
|
||||
bool take_request(unsigned &irq);
|
||||
void finish_request() { }
|
||||
void mask();
|
||||
|
@ -17,11 +17,16 @@
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
static inline Genode::addr_t redistributor_addr()
|
||||
{
|
||||
return Platform::mmio_to_virt(Board::Cpu_mmio::IRQ_CONTROLLER_REDIST_BASE
|
||||
+ (Cpu::executing_id() * 0x20000));
|
||||
};
|
||||
|
||||
Hw::Pic::Pic()
|
||||
: _distr(Platform::mmio_to_virt(Board::Cpu_mmio::IRQ_CONTROLLER_DISTR_BASE)),
|
||||
_redistr(Platform::mmio_to_virt(Board::Cpu_mmio::IRQ_CONTROLLER_REDIST_BASE)),
|
||||
_redistr_sgi(Platform::mmio_to_virt(Board::Cpu_mmio::IRQ_CONTROLLER_REDIST_BASE)
|
||||
+ Board::Cpu_mmio::IRQ_CONTROLLER_REDIST_SIZE / 2),
|
||||
_redistr(redistributor_addr()),
|
||||
_redistr_sgi(redistributor_addr() + 0x10000),
|
||||
_max_irq(_distr.max_irq())
|
||||
{
|
||||
_redistributor_init();
|
||||
|
@ -22,8 +22,6 @@ void Kernel::Cpu::_arch_init()
|
||||
Idt::init();
|
||||
Tss::init();
|
||||
|
||||
Timer::init_cpu_local();
|
||||
|
||||
/* enable timer interrupt */
|
||||
_pic.store_apic_id(id());
|
||||
_pic.unmask(_timer.interrupt_id(), id());
|
||||
|
@ -56,9 +56,6 @@ Board::Timer::Timer(unsigned) : ticks_per_ms(sinfo()->get_tsc_khz()), start(0)
|
||||
}
|
||||
|
||||
|
||||
void Timer::init_cpu_local() { }
|
||||
|
||||
|
||||
unsigned Timer::interrupt_id() const {
|
||||
return Board::TIMER_VECTOR_KERNEL; }
|
||||
|
||||
|
@ -75,11 +75,7 @@ Board::Timer::Timer(unsigned)
|
||||
/* Calculate timer frequency */
|
||||
ticks_per_ms = pit_calc_timer_freq();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Timer::init_cpu_local()
|
||||
{
|
||||
/**
|
||||
* Disable PIT timer channel. This is necessary since BIOS sets up
|
||||
* channel 0 to fire periodically.
|
||||
|
Reference in New Issue
Block a user