mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 15:10:28 +00:00
Fix PCI write funcs val calculation.
This commit is contained in:
parent
74b770870f
commit
0f1a63f0a2
1 changed files with 4 additions and 3 deletions
|
@ -69,14 +69,14 @@ U0 PCIWriteU32(I64 bus, I64 dev, I64 fun, I64 rg, I64 val)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
U0 PCIWriteU8(I64 bus, I64 dev, I64 fun, I64 rg, I64 val)
|
||||
{//Write U8 in PCI configspace at bus, dev, fun, reg.
|
||||
if (sys_pci_services)
|
||||
PCIBIOSWriteU8(bus, dev, fun, rg, val);
|
||||
else
|
||||
{
|
||||
PCIWriteU32(bus, dev, fun, rg, val & 0xFF);
|
||||
val = PCIReadU32(bus, dev, fun, rg) & ~0xFF | val & 0xFF;
|
||||
PCIWriteU32(bus, dev, fun, rg, val);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,8 @@ U0 PCIWriteU16(I64 bus, I64 dev, I64 fun, I64 rg, I64 val)
|
|||
PCIBIOSWriteU16(bus, dev, fun, rg, val);
|
||||
else
|
||||
{
|
||||
PCIWriteU32(bus, dev, fun, rg, val & 0xFFFF);
|
||||
val = PCIReadU32(bus, dev, fun, rg) & ~0xFFFF | val & 0xFFFF;
|
||||
PCIWriteU32(bus, dev, fun, rg, val);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue