mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-26 19:03:48 +01:00
Add support for parsing MCFG tables.
This commit is contained in:
parent
6c23e6cc5a
commit
a47e681b24
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=141905
@ -376,6 +376,28 @@ acpi_handle_ecdt(struct ACPIsdt *sdp)
|
||||
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
|
||||
acpi_print_sdt(struct ACPIsdt *sdp)
|
||||
{
|
||||
@ -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);
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user