setos

拙OS
Log | Files | Refs | LICENSE

commit 42c2ee5e419c664e90284cb2a91c9f7aa9b4bc7e
parent 58c769c71ff0b5014efee6e64019f15478daffaa
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Thu, 18 Apr 2024 09:34:23 +0900

mask the least 4 bits of xhc base address

Diffstat:
Msys/src/kernel/main.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/src/kernel/main.c b/sys/src/kernel/main.c @@ -61,7 +61,7 @@ kernel_main(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop) for (int i = 0; i < num_pci_dev; i++) { if (pci_dev[i].base_class == 0xc && pci_dev[i].sub_class == 0x3 && pci_dev[i].prog == 0x30) { - uintptr xhc_base = ((uintptr) pci_dev[i].t0.base_address_register[1]) << 32 | pci_dev[i].t0.base_address_register[0]; + uintptr xhc_base = ((uintptr) pci_dev[i].t0.base_address_register[1]) << 32 | pci_dev[i].t0.base_address_register[0]&0xfffffff0; cons_printf(&con0, "xhc_base: %x\n", xhc_base); xhc_capability_registers *xhccr = (xhc_capability_registers *) xhc_base; xhc_operational_registers *xhcor = (xhc_operational_registers *) (xhc_base + xhccr->CAPLENGTH);