diff options
author | scottl <scottl@FreeBSD.org> | 2005-02-14 11:21:48 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2005-02-14 11:21:48 +0000 |
commit | 332a6d5ce334134ebe5e2b9b348197b378f28f59 (patch) | |
tree | f08dafa5c21a3127a539a1072843b536d7418775 /usr.sbin | |
parent | 5d07a7452ca61f2712d9a2614302164f98044d60 (diff) | |
download | FreeBSD-src-332a6d5ce334134ebe5e2b9b348197b378f28f59.zip FreeBSD-src-332a6d5ce334134ebe5e2b9b348197b378f28f59.tar.gz |
Add support for parsing MCFG tables.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/acpi/acpidump/acpi.c | 24 | ||||
-rw-r--r-- | usr.sbin/acpi/acpidump/acpidump.h | 12 |
2 files changed, 36 insertions, 0 deletions
diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 6b1b2a9..6241dfd 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -377,6 +377,28 @@ acpi_handle_ecdt(struct ACPIsdt *sdp) } 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 acpi_print_sdt(struct ACPIsdt *sdp) { printf(" "); @@ -683,6 +705,8 @@ acpi_handle_rsdt(struct ACPIsdt *rsdp) acpi_handle_hpet(sdp); else if (!memcmp(sdp->signature, "ECDT", 4)) acpi_handle_ecdt(sdp); + else if (!memcmp(sdp->signature, "MCFG", 4)) + acpi_handle_mcfg(sdp); else { printf(BEGIN_COMMENT); acpi_print_sdt(sdp); diff --git a/usr.sbin/acpi/acpidump/acpidump.h b/usr.sbin/acpi/acpidump/acpidump.h index ca56398..0b7712a 100644 --- a/usr.sbin/acpi/acpidump/acpidump.h +++ b/usr.sbin/acpi/acpidump/acpidump.h @@ -293,6 +293,18 @@ struct ECDTbody { u_char ec_id[1]; /* Variable length name string */ } __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 * of the ACPI spec, we only consider two regions for the base address: |