mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -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)
|
||||
{
|
||||
IO::out32(PCI_ADDRESS_PORT, address.io_address_for_field(field));
|
||||
return IO::in8(PCI_VALUE_PORT + (field & 3));
|
||||
return Access::early_read8_field(address, field);
|
||||
}
|
||||
|
||||
u16 IOAccess::read16_field(Address address, u32 field)
|
||||
{
|
||||
IO::out32(PCI_ADDRESS_PORT, address.io_address_for_field(field));
|
||||
return IO::in16(PCI_VALUE_PORT + (field & 2));
|
||||
return Access::early_read16_field(address, field);
|
||||
}
|
||||
|
||||
u32 IOAccess::read32_field(Address address, u32 field)
|
||||
{
|
||||
IO::out32(PCI_ADDRESS_PORT, address.io_address_for_field(field));
|
||||
return IO::in32(PCI_VALUE_PORT);
|
||||
return Access::early_read32_field(address, field);
|
||||
}
|
||||
|
||||
void IOAccess::write8_field(Address address, u32 field, u8 value)
|
||||
|
|
Loading…
Add table
Reference in a new issue