summaryrefslogtreecommitdiffstats
path: root/sys/ia64/acpica
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2001-10-29 02:16:02 +0000
committermarcel <marcel@FreeBSD.org>2001-10-29 02:16:02 +0000
commit830dbf12d9594406beedd41668c7f2755d92ff51 (patch)
tree4e1c79f52aeff89922742b2fccaa89674395cd9c /sys/ia64/acpica
parent5d44d9cff102901a7355df4382bb3717ee0572ef (diff)
downloadFreeBSD-src-830dbf12d9594406beedd41668c7f2755d92ff51.zip
FreeBSD-src-830dbf12d9594406beedd41668c7f2755d92ff51.tar.gz
o Do not parse the MADT as a side-effect in AcpiOsGetRootPointer,
do it as a side-effect of probing for MP hardware. This allows us to scan for local SAPICs early (especially before MBUF initialization). o Fix the Local SAPIC structure so that matches the Local SAPIC table entry. Now that the Local SAPIC info is the same as the Local APIC info, stop dumping the Local APIC entries. o For every Local SAPIC entry in the MADT that's not disabled, let the SMP code know about it. They represent actual CPUs. o Register the OS_BOOT_RENDEZ entry point and provide a (bogus) implementation for the entry point. o Provide a mapping for internal IPI numbers to ExtINT vectors. o In a MP system, announce the CPUs and start them by sending IPI_AP_WAKEUP to each of them. Not that it makes a difference at this time :-) o Miscellaneous style fixes and other adjustments.
Diffstat (limited to 'sys/ia64/acpica')
-rw-r--r--sys/ia64/acpica/OsdEnvironment.c22
-rw-r--r--sys/ia64/acpica/madt.c166
2 files changed, 78 insertions, 110 deletions
diff --git a/sys/ia64/acpica/OsdEnvironment.c b/sys/ia64/acpica/OsdEnvironment.c
index 5da1d5c..897fc26 100644
--- a/sys/ia64/acpica/OsdEnvironment.c
+++ b/sys/ia64/acpica/OsdEnvironment.c
@@ -51,25 +51,15 @@ AcpiOsTerminate(void)
}
ACPI_STATUS
-AcpiOsGetRootPointer(
- UINT32 Flags,
- ACPI_PHYSICAL_ADDRESS *RsdpPhysicalAddress)
+AcpiOsGetRootPointer(UINT32 Flags, ACPI_PHYSICAL_ADDRESS *RsdpPhysicalAddress)
{
- RSDP_DESCRIPTOR *rsdp;
- XSDT_DESCRIPTOR *xsdt;
- if (ia64_efi_acpi20_table) {
+ if (ia64_efi_acpi20_table)
*RsdpPhysicalAddress = ia64_efi_acpi20_table;
- rsdp = (RSDP_DESCRIPTOR *)
- IA64_PHYS_TO_RR7(ia64_efi_acpi20_table);
- xsdt = (XSDT_DESCRIPTOR *)
- IA64_PHYS_TO_RR7(rsdp->XsdtPhysicalAddress);
- ia64_parse_xsdt(xsdt);
- return(AE_OK);
- } else if (ia64_efi_acpi_table) {
+ else if (ia64_efi_acpi_table)
*RsdpPhysicalAddress = ia64_efi_acpi_table;
- return(AE_OK);
- }
+ else
+ return(AE_NOT_FOUND);
- return(AE_NOT_FOUND);
+ return(AE_OK);
}
diff --git a/sys/ia64/acpica/madt.c b/sys/ia64/acpica/madt.c
index 325bf62..a3bc09d 100644
--- a/sys/ia64/acpica/madt.c
+++ b/sys/ia64/acpica/madt.c
@@ -28,96 +28,71 @@
#include "acpi.h"
+void cpu_mp_add(uint, uint, uint);
+struct sapic *sapic_create(int, int, u_int64_t);
+
#pragma pack(1)
-#define APIC_INTERRUPT_SOURCE_OVERRIDE 2
-#define APIC_NMI 3
-#define APIC_LOCAL_APIC_NMI 4
-#define APIC_LOCAL_APIC_OVERRIDE 5
-#define APIC_IO_SAPIC 6
-#define APIC_LOCAL_SAPIC 7
-#define APIC_PLATFORM_INTERRUPT 8
-
+#define APIC_INTERRUPT_SOURCE_OVERRIDE 2
+#define APIC_NMI 3
+#define APIC_LOCAL_APIC_NMI 4
+#define APIC_LOCAL_APIC_OVERRIDE 5
+#define APIC_IO_SAPIC 6
+#define APIC_LOCAL_SAPIC 7
+#define APIC_PLATFORM_INTERRUPT 8
-typedef struct /* Interrupt Source Override */
+typedef struct /* Interrupt Source Override */
{
- APIC_HEADER header;
- UINT8 Bus;
- UINT8 Source;
- UINT32 GlobalSystemInterrupt;
- UINT16 Flags;
+ APIC_HEADER header;
+ UINT8 Bus;
+ UINT8 Source;
+ UINT32 GlobalSystemInterrupt;
+ UINT16 Flags;
} INTERRUPT_SOURCE_OVERRIDE;
-typedef struct /* IO SAPIC */
+typedef struct /* IO SAPIC */
{
- APIC_HEADER header;
- UINT8 IoSapicId; /* I/O SAPIC ID */
- UINT8 Reserved; /* reserved - must be zero */
- UINT32 Vector; /* interrupt vector index where INTI
- * lines start */
- UINT64 IoSapicAddress; /* SAPIC's physical address */
-
+ APIC_HEADER header;
+ UINT8 IoSapicId; /* I/O SAPIC ID */
+ UINT8 Reserved; /* reserved - must be zero */
+ UINT32 Vector; /* interrupt base */
+ UINT64 IoSapicAddress; /* SAPIC's physical address */
} IO_SAPIC;
-
typedef struct /* LOCAL SAPIC */
{
- APIC_HEADER header;
- UINT16 ProcessorId; /* ACPI processor id */
- UINT16 ProcessorEnabled: 1; /* Processor is usable if set */
- UINT16 Reserved1 : 15;
- UINT8 LocalSapicId; /* processor's local SAPIC id */
- UINT8 LocalSapicEid; /* processor's local SAPIC eid */
-
+ APIC_HEADER header;
+ UINT8 ProcessorId; /* ACPI processor id */
+ UINT8 LocalSapicId; /* Processor local SAPIC id */
+ UINT8 LocalSapicEid; /* Processor local SAPIC eid */
+ UINT8 Reserved;
+ UINT32 Reserved1: 16;
+ UINT32 ProcessorEnabled: 1;
+ UINT32 Reserved2: 15;
} LOCAL_SAPIC;
-
typedef struct /* PLATFORM INTERRUPT SOURCE */
{
- APIC_HEADER header;
- UINT16 Polarity : 2; /* Polarity of input signal */
- UINT16 TriggerMode: 2; /* Trigger mode of input signal */
- UINT16 Reserved1 : 12;
- UINT8 InterruptType; /* 1-PMI, 2-INIT, 3-Error */
- UINT8 ProcessorId; /* Processor ID of destination */
- UINT8 ProcessorEid; /* Processor EID of destination */
- UINT8 IoSapicVector; /* Value for redirection table */
- UINT32 GlobalSystemInterrupt; /* Global System Interrupt */
- UINT32 Reserved2;
-
+ APIC_HEADER header;
+ UINT16 Polarity : 2; /* Polarity of input signal */
+ UINT16 TriggerMode: 2; /* Trigger mode of input signal */
+ UINT16 Reserved1 : 12;
+ UINT8 InterruptType; /* 1-PMI, 2-INIT, 3-Error */
+ UINT8 ProcessorId; /* Processor ID of destination */
+ UINT8 ProcessorEid; /* Processor EID of destination */
+ UINT8 IoSapicVector; /* Value for redirection table */
+ UINT32 GlobalSystemInterrupt; /* Global System Interrupt */
+ UINT32 Reserved2;
} PLATFORM_INTERRUPT_SOURCE;
-
#pragma pack()
static void
-parse_local_apic(PROCESSOR_APIC *apic)
-{
- if (bootverbose) {
- printf("\t\tProcessorId=0x%x, APIC Id=0x%x",
- apic->ProcessorApicId, apic->LocalApicId);
- if (!apic->ProcessorEnabled)
- printf(" (disabled)");
- printf("\n");
- }
-}
-
-static void
-parse_io_apic(IO_APIC *apic)
-{
- if (bootverbose)
- printf("\t\tId=0x%x, Vector=0x%x, Address=0x%lx\n",
- apic->IoApicId, apic->Vector, apic->IoApicAddress);
-}
-
-static void
parse_interrupt_override(INTERRUPT_SOURCE_OVERRIDE *override)
{
if (bootverbose)
- printf("\t\tBus=%d, Source=%d, Irq=0x%x\n",
- override->Bus,
- override->Source,
- override->GlobalSystemInterrupt);
+ printf("\t\tBus=%d, Source=%d, Irq=0x%x\n", override->Bus,
+ override->Source, override->GlobalSystemInterrupt);
}
static void
@@ -125,9 +100,7 @@ parse_io_sapic(IO_SAPIC *sapic)
{
if (bootverbose)
printf("\t\tId=0x%x, Vector=0x%x, Address=0x%lx\n",
- sapic->IoSapicId,
- sapic->Vector,
- sapic->IoSapicAddress);
+ sapic->IoSapicId, sapic->Vector, sapic->IoSapicAddress);
sapic_create(sapic->IoSapicId, sapic->Vector, sapic->IoSapicAddress);
}
@@ -142,6 +115,11 @@ parse_local_sapic(LOCAL_SAPIC *sapic)
printf(" (disabled)");
printf("\n");
}
+#ifdef SMP
+ if (sapic->ProcessorEnabled)
+ cpu_mp_add(sapic->ProcessorId, sapic->LocalSapicId,
+ sapic->LocalSapicEid);
+#endif
}
static void
@@ -149,13 +127,10 @@ parse_platform_interrupt(PLATFORM_INTERRUPT_SOURCE *source)
{
if (bootverbose)
printf("\t\tPolarity=%d, TriggerMode=%d, Id=0x%x, "
- "Eid=0x%x, Vector=0x%x, Irq=%d\n",
- source->Polarity,
- source->TriggerMode,
- source->ProcessorId,
- source->ProcessorEid,
- source->IoSapicVector,
- source->GlobalSystemInterrupt);
+ "Eid=0x%x, Vector=0x%x, Irq=%d\n", source->Polarity,
+ source->TriggerMode, source->ProcessorId,
+ source->ProcessorEid, source->IoSapicVector,
+ source->GlobalSystemInterrupt);
}
static void
@@ -177,13 +152,11 @@ parse_madt(APIC_TABLE *madt)
case APIC_PROC:
if (bootverbose)
printf("Local APIC entry\n");
- parse_local_apic((PROCESSOR_APIC *) head);
break;
case APIC_IO:
if (bootverbose)
printf("I/O APIC entry\n");
- parse_io_apic((IO_APIC *) head);
break;
case APIC_INTERRUPT_SOURCE_OVERRIDE:
@@ -203,6 +176,7 @@ parse_madt(APIC_TABLE *madt)
printf("Local APIC NMI entry\n");
break;
+
case APIC_LOCAL_APIC_OVERRIDE:
if (bootverbose)
printf("Local APIC override entry\n");
@@ -238,28 +212,32 @@ parse_madt(APIC_TABLE *madt)
}
void
-ia64_parse_xsdt(XSDT_DESCRIPTOR *xsdt)
+ia64_probe_sapics(void)
{
- int i, count;
+ ACPI_PHYSICAL_ADDRESS rsdp_phys;
+ RSDP_DESCRIPTOR *rsdp;
+ XSDT_DESCRIPTOR *xsdt;
ACPI_TABLE_HEADER *table;
+ int i, count;
- /*
- * First find the MADT.
- */
- count = (UINT64 *) ((char *) xsdt + xsdt->Header.Length)
- - &xsdt->TableOffsetEntry[0];
+ if (AcpiOsGetRootPointer(0, &rsdp_phys) != AE_OK)
+ return;
+
+ rsdp = (RSDP_DESCRIPTOR *)IA64_PHYS_TO_RR7(rsdp_phys);
+ xsdt = (XSDT_DESCRIPTOR *)IA64_PHYS_TO_RR7(rsdp->XsdtPhysicalAddress);
+
+ count = (UINT64 *)((char *)xsdt + xsdt->Header.Length)
+ - xsdt->TableOffsetEntry;
for (i = 0; i < count; i++) {
table = (ACPI_TABLE_HEADER *)
IA64_PHYS_TO_RR7(xsdt->TableOffsetEntry[i]);
+
if (bootverbose)
- printf("Table '%c%c%c%c' at %p\n",
- table->Signature[0],
- table->Signature[1],
- table->Signature[2],
- table->Signature[3],
- table);
- if (!strncmp(table->Signature, APIC_SIG, 4)) {
+ printf("Table '%c%c%c%c' at %p\n", table->Signature[0],
+ table->Signature[1], table->Signature[2],
+ table->Signature[3], table);
+
+ if (!strncmp(table->Signature, APIC_SIG, 4))
parse_madt((APIC_TABLE *) table);
- }
}
}
OpenPOWER on IntegriCloud