mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 13:47:56 +00:00
base-hw: explicit bounds check in store_apic_id
Avoid relying on the caller regarding the CPU index argument to ease the reasoning about the code.
This commit is contained in:
parent
01713c74f9
commit
5635c1318c
@ -209,9 +209,12 @@ class Board::Pic : public Genode::Mmio
|
||||
|
||||
void irq_mode(unsigned irq, unsigned trigger, unsigned polarity);
|
||||
|
||||
void store_apic_id(unsigned const cpu_id) {
|
||||
Id::access_t const lapic_id = read<Id>();
|
||||
lapic_ids[cpu_id] = (lapic_id >> 24) & 0xff;
|
||||
void store_apic_id(unsigned const cpu_id)
|
||||
{
|
||||
if (cpu_id < NR_OF_CPUS) {
|
||||
Id::access_t const lapic_id = read<Id>();
|
||||
lapic_ids[cpu_id] = (lapic_id >> 24) & 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
void send_ipi(unsigned const);
|
||||
|
Loading…
Reference in New Issue
Block a user