Add support for parsing MCFG tables.
This commit is contained in:
parent
d010e873fe
commit
e014bfb618
@ -376,6 +376,28 @@ acpi_handle_ecdt(struct ACPIsdt *sdp)
|
|||||||
printf(END_COMMENT);
|
printf(END_COMMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
acpi_handle_mcfg(struct ACPIsdt *sdp)
|
||||||
|
{
|
||||||
|
struct MCFGbody *mcfg;
|
||||||
|
u_int i, e;
|
||||||
|
|
||||||
|
printf(BEGIN_COMMENT);
|
||||||
|
acpi_print_sdt(sdp);
|
||||||
|
mcfg = (struct MCFGbody *) sdp->body;
|
||||||
|
|
||||||
|
e = (sdp->len - ((caddr_t)&mcfg->s[0] - (caddr_t)sdp)) /
|
||||||
|
sizeof(*mcfg->s);
|
||||||
|
for (i = 0; i < e; i++, mcfg++) {
|
||||||
|
printf("\n");
|
||||||
|
printf("\tBase Address= 0x%016jx\n", mcfg->s[i].baseaddr);
|
||||||
|
printf("\tSegment Group= 0x%04x\n", mcfg->s[i].seg_grp);
|
||||||
|
printf("\tStart Bus= %d\n", mcfg->s[i].start);
|
||||||
|
printf("\tEnd Bus= %d\n", mcfg->s[i].end);
|
||||||
|
}
|
||||||
|
printf(END_COMMENT);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
acpi_print_sdt(struct ACPIsdt *sdp)
|
acpi_print_sdt(struct ACPIsdt *sdp)
|
||||||
{
|
{
|
||||||
@ -683,6 +705,8 @@ acpi_handle_rsdt(struct ACPIsdt *rsdp)
|
|||||||
acpi_handle_hpet(sdp);
|
acpi_handle_hpet(sdp);
|
||||||
else if (!memcmp(sdp->signature, "ECDT", 4))
|
else if (!memcmp(sdp->signature, "ECDT", 4))
|
||||||
acpi_handle_ecdt(sdp);
|
acpi_handle_ecdt(sdp);
|
||||||
|
else if (!memcmp(sdp->signature, "MCFG", 4))
|
||||||
|
acpi_handle_mcfg(sdp);
|
||||||
else {
|
else {
|
||||||
printf(BEGIN_COMMENT);
|
printf(BEGIN_COMMENT);
|
||||||
acpi_print_sdt(sdp);
|
acpi_print_sdt(sdp);
|
||||||
|
@ -293,6 +293,18 @@ struct ECDTbody {
|
|||||||
u_char ec_id[1]; /* Variable length name string */
|
u_char ec_id[1]; /* Variable length name string */
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
|
/* Memory Mapped PCI config space base allocation structure */
|
||||||
|
struct MCFGbody {
|
||||||
|
uint8_t rsvd[8];
|
||||||
|
struct {
|
||||||
|
uint64_t baseaddr; /* Base Address */
|
||||||
|
uint16_t seg_grp; /* Segment group number */
|
||||||
|
uint8_t start; /* Starting bus number */
|
||||||
|
uint8_t end; /* Ending bus number */
|
||||||
|
uint8_t rsvd[4]; /* Reserved */
|
||||||
|
} s[];
|
||||||
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Addresses to scan on ia32 for the RSD PTR. According to section 5.2.2
|
* Addresses to scan on ia32 for the RSD PTR. According to section 5.2.2
|
||||||
* of the ACPI spec, we only consider two regions for the base address:
|
* of the ACPI spec, we only consider two regions for the base address:
|
||||||
|
Loading…
Reference in New Issue
Block a user