Factor out acpi_create_madt_lapics. It can be used on all ACPI boards.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4168 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
7e9771cc1a
commit
da65fbf208
|
@ -88,6 +88,25 @@ int acpi_create_madt_lapic(acpi_madt_lapic_t *lapic, u8 cpu, u8 apic)
|
||||||
return(lapic->length);
|
return(lapic->length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long acpi_create_madt_lapics(unsigned long current)
|
||||||
|
{
|
||||||
|
device_t cpu;
|
||||||
|
int cpu_index = 0;
|
||||||
|
|
||||||
|
for(cpu = all_devices; cpu; cpu = cpu->next) {
|
||||||
|
if ((cpu->path.type != DEVICE_PATH_APIC) ||
|
||||||
|
(cpu->bus->dev->path.type != DEVICE_PATH_APIC_CLUSTER)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!cpu->enabled) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current, cpu_index, cpu->path.apic.apic_id);
|
||||||
|
cpu_index++;
|
||||||
|
}
|
||||||
|
return current;
|
||||||
|
}
|
||||||
|
|
||||||
int acpi_create_madt_ioapic(acpi_madt_ioapic_t *ioapic, u8 id, u32 addr,u32 gsi_base)
|
int acpi_create_madt_ioapic(acpi_madt_ioapic_t *ioapic, u8 id, u32 addr,u32 gsi_base)
|
||||||
{
|
{
|
||||||
ioapic->type=1;
|
ioapic->type=1;
|
||||||
|
|
|
@ -28,25 +28,6 @@
|
||||||
|
|
||||||
//it seems some functions can be moved arch/i386/boot/acpi.c
|
//it seems some functions can be moved arch/i386/boot/acpi.c
|
||||||
|
|
||||||
unsigned long acpi_create_madt_lapics(unsigned long current)
|
|
||||||
{
|
|
||||||
device_t cpu;
|
|
||||||
int cpu_index = 0;
|
|
||||||
|
|
||||||
for(cpu = all_devices; cpu; cpu = cpu->next) {
|
|
||||||
if ((cpu->path.type != DEVICE_PATH_APIC) ||
|
|
||||||
(cpu->bus->dev->path.type != DEVICE_PATH_APIC_CLUSTER)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!cpu->enabled) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current, cpu_index, cpu->path.apic.apic_id);
|
|
||||||
cpu_index++;
|
|
||||||
}
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned long acpi_create_madt_lapic_nmis(unsigned long current, u16 flags, u8 lint)
|
unsigned long acpi_create_madt_lapic_nmis(unsigned long current, u16 flags, u8 lint)
|
||||||
{
|
{
|
||||||
device_t cpu;
|
device_t cpu;
|
||||||
|
|
|
@ -48,25 +48,6 @@ acknowledgement of AMD's proprietary rights in them.
|
||||||
|
|
||||||
//it seems some functions can be moved arch/i386/boot/acpi.c
|
//it seems some functions can be moved arch/i386/boot/acpi.c
|
||||||
|
|
||||||
unsigned long acpi_create_madt_lapics(unsigned long current)
|
|
||||||
{
|
|
||||||
device_t cpu;
|
|
||||||
int cpu_index = 0;
|
|
||||||
|
|
||||||
for(cpu = all_devices; cpu; cpu = cpu->next) {
|
|
||||||
if ((cpu->path.type != DEVICE_PATH_APIC) ||
|
|
||||||
(cpu->bus->dev->path.type != DEVICE_PATH_APIC_CLUSTER)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!cpu->enabled) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current, cpu_index, cpu->path.apic.apic_id);
|
|
||||||
cpu_index++;
|
|
||||||
}
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned long acpi_create_madt_lapic_nmis(unsigned long current, u16 flags, u8 lint)
|
unsigned long acpi_create_madt_lapic_nmis(unsigned long current, u16 flags, u8 lint)
|
||||||
{
|
{
|
||||||
device_t cpu;
|
device_t cpu;
|
||||||
|
|
Loading…
Reference in New Issue