mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Kernel: Reduce code duplication in the PCI IO access read helpers
We just call the early helpers as they do the same thing like the IO access helpers.
This commit is contained in:
parent
6131048a5f
commit
4007ba5137
1 changed files with 3 additions and 6 deletions
|
@ -46,20 +46,17 @@ IOAccess::IOAccess()
|
||||||
|
|
||||||
u8 IOAccess::read8_field(Address address, u32 field)
|
u8 IOAccess::read8_field(Address address, u32 field)
|
||||||
{
|
{
|
||||||
IO::out32(PCI_ADDRESS_PORT, address.io_address_for_field(field));
|
return Access::early_read8_field(address, field);
|
||||||
return IO::in8(PCI_VALUE_PORT + (field & 3));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 IOAccess::read16_field(Address address, u32 field)
|
u16 IOAccess::read16_field(Address address, u32 field)
|
||||||
{
|
{
|
||||||
IO::out32(PCI_ADDRESS_PORT, address.io_address_for_field(field));
|
return Access::early_read16_field(address, field);
|
||||||
return IO::in16(PCI_VALUE_PORT + (field & 2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 IOAccess::read32_field(Address address, u32 field)
|
u32 IOAccess::read32_field(Address address, u32 field)
|
||||||
{
|
{
|
||||||
IO::out32(PCI_ADDRESS_PORT, address.io_address_for_field(field));
|
return Access::early_read32_field(address, field);
|
||||||
return IO::in32(PCI_VALUE_PORT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IOAccess::write8_field(Address address, u32 field, u8 value)
|
void IOAccess::write8_field(Address address, u32 field, u8 value)
|
||||||
|
|
Loading…
Add table
Reference in a new issue