* Initial support for ACPI tables to detect multiprocessor configurations

* ACPI is evaluated first as it also handles things like multi core or hyper threading setups
* Removed other (disabled) hyper threading code per the notes in the corresponding ToDo
* Limit the detected CPU count to 2 for now as I wasn't able to get it working in either emulation nor real hardware with more than 2 CPUs
* Added a reserved byte to the mp_config_table struct, it worked only by luck as the compiler did padding there to get to the same size

I can now boot my Core 2 Quad with two out of four processors active :-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23100 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2007-12-09 21:01:55 +00:00
parent 1a802bca9d
commit f108445b5e
3 changed files with 192 additions and 56 deletions
@@ -0,0 +1,69 @@
/*
* Copyright 2007, Michael Lotz, [email protected]. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_ARCH_x86_SMP_ACPI_H
#define _KERNEL_ARCH_x86_SMP_ACPI_H
#define ACPI_RSDP_SIGNATURE "RSD PTR "
#define ACPI_RSDT_SIGNATURE "RSDT"
#define ACPI_MADT_SIGNATURE "APIC"
struct acpi_rsdp {
char signature[8]; /* "RSD PTR " including blank */
uint8 checksum; /* checksum of bytes 0-19 (per ACPI 1.0) */
char oem_id[6]; /* not null terminated */
uint8 revision; /* 0 = ACPI 1.0, 2 = ACPI 3.0 */
uint32 rsdt_address; /* physical memory address of RSDT */
uint32 rsdt_length; /* length in bytes including header */
uint64 xsdt_address; /* 64bit physical memory address of XSDT */
uint8 extended_checksum; /* including entire table */
uint8 reserved[3];
} _PACKED;
struct acpi_descriptor_header {
char signature[4]; /* table identifier as ASCII string */
uint32 length; /* length in bytes of the entire table */
uint8 revision;
uint8 checksum; /* checksum of entire table */
char oem_id[6]; /* not null terminated */
char oem_table_id[8]; /* oem supplied table identifier */
uint32 oem_revision; /* oem supplied revision number */
char creator_id[4]; /* creator / asl compiler id */
uint32 creator_revision; /* compiler revision */
} _PACKED;
struct acpi_madt {
acpi_descriptor_header header; /* "APIC" signature */
uint32 local_apic_address; /* physical address for local CPUs APICs */
uint32 flags;
} _PACKED;
enum {
ACPI_MADT_LOCAL_APIC = 0,
ACPI_MADT_IO_APIC = 1
};
struct acpi_apic {
uint8 type;
uint8 length;
} _PACKED;
struct acpi_local_apic {
uint8 type; /* 0 = processor local APIC */
uint8 length; /* 8 bytes */
uint8 acpi_processor_id;
uint8 apic_id; /* the id of this APIC */
uint32 flags; /* 1 = enabled */
} _PACKED;
struct acpi_io_apic {
uint8 type; /* 1 = I/O APIC */
uint8 length; /* 12 bytes */
uint8 io_apic_id; /* the id of this APIC */
uint8 reserved;
uint32 io_apic_address; /* phyisical address of I/O APIC */
uint32 interrupt_base; /* global system interrupt base */
} _PACKED;
#endif /* _KERNEL_ARCH_x86_SMP_ACPI_H */
@@ -125,6 +125,7 @@ struct mp_config_table {
uint32 apic; /* address of apic */
uint16 ext_length; /* length of extended section */
uint8 ext_checksum; /* checksum of extended table entries */
uint8 reserved;
};
struct mp_floating_struct {