2020-01-18 09:38:21 +01:00
|
|
|
/*
|
2020-03-06 16:59:29 +02:00
|
|
|
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
|
2020-01-18 09:38:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
2021-01-25 16:07:10 +01:00
|
|
|
#include <Kernel/Debug.h>
|
2020-10-31 22:24:01 +02:00
|
|
|
#include <Kernel/IO.h>
|
2019-12-31 13:04:30 +02:00
|
|
|
#include <Kernel/PCI/Access.h>
|
|
|
|
#include <Kernel/PCI/IOAccess.h>
|
|
|
|
|
2020-02-16 01:27:42 +01:00
|
|
|
namespace Kernel {
|
2020-04-08 17:29:37 +02:00
|
|
|
namespace PCI {
|
2020-02-16 01:27:42 +01:00
|
|
|
|
2020-04-08 17:29:37 +02:00
|
|
|
static Access* s_access;
|
2019-12-31 13:04:30 +02:00
|
|
|
|
2020-04-08 17:29:37 +02:00
|
|
|
inline void write8(Address address, u32 field, u8 value) { Access::the().write8_field(address, field, value); }
|
|
|
|
inline void write16(Address address, u32 field, u16 value) { Access::the().write16_field(address, field, value); }
|
|
|
|
inline void write32(Address address, u32 field, u32 value) { Access::the().write32_field(address, field, value); }
|
|
|
|
inline u8 read8(Address address, u32 field) { return Access::the().read8_field(address, field); }
|
|
|
|
inline u16 read16(Address address, u32 field) { return Access::the().read16_field(address, field); }
|
|
|
|
inline u32 read32(Address address, u32 field) { return Access::the().read32_field(address, field); }
|
2020-04-08 17:08:00 +02:00
|
|
|
|
2020-04-08 17:29:37 +02:00
|
|
|
Access& Access::the()
|
2019-12-31 13:04:30 +02:00
|
|
|
{
|
|
|
|
if (s_access == nullptr) {
|
2021-02-23 20:42:32 +01:00
|
|
|
VERIFY_NOT_REACHED(); // We failed to initialize the PCI subsystem, so stop here!
|
2019-12-31 13:04:30 +02:00
|
|
|
}
|
|
|
|
return *s_access;
|
|
|
|
}
|
|
|
|
|
2020-04-08 17:29:37 +02:00
|
|
|
bool Access::is_initialized()
|
2019-12-31 13:04:30 +02:00
|
|
|
{
|
|
|
|
return (s_access != nullptr);
|
|
|
|
}
|
|
|
|
|
2021-02-19 21:29:46 +01:00
|
|
|
UNMAP_AFTER_INIT Access::Access()
|
2019-12-31 13:04:30 +02:00
|
|
|
{
|
|
|
|
s_access = this;
|
|
|
|
}
|
|
|
|
|
2020-12-18 20:24:32 +02:00
|
|
|
PhysicalID Access::get_physical_id(Address address) const
|
|
|
|
{
|
|
|
|
for (auto physical_id : m_physical_ids) {
|
|
|
|
if (physical_id.address().seg() == address.seg()
|
|
|
|
&& physical_id.address().bus() == address.bus()
|
2021-01-31 12:03:23 +01:00
|
|
|
&& physical_id.address().device() == address.device()
|
2020-12-18 20:24:32 +02:00
|
|
|
&& physical_id.address().function() == address.function()) {
|
|
|
|
return physical_id;
|
|
|
|
}
|
|
|
|
}
|
2021-02-23 20:42:32 +01:00
|
|
|
VERIFY_NOT_REACHED();
|
2020-12-18 20:24:32 +02:00
|
|
|
}
|
|
|
|
|
2020-10-31 22:24:01 +02:00
|
|
|
u8 Access::early_read8_field(Address address, u32 field)
|
2020-04-08 16:56:36 +02:00
|
|
|
{
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: Early reading 8-bit field {:#08x} for {}", field, address);
|
2020-10-31 22:24:01 +02:00
|
|
|
IO::out32(PCI_ADDRESS_PORT, address.io_address_for_field(field));
|
|
|
|
return IO::in8(PCI_VALUE_PORT + (field & 3));
|
|
|
|
}
|
|
|
|
|
|
|
|
u16 Access::early_read16_field(Address address, u32 field)
|
|
|
|
{
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: Early reading 16-bit field {:#08x} for {}", field, address);
|
2020-10-31 22:24:01 +02:00
|
|
|
IO::out32(PCI_ADDRESS_PORT, address.io_address_for_field(field));
|
|
|
|
return IO::in16(PCI_VALUE_PORT + (field & 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 Access::early_read32_field(Address address, u32 field)
|
|
|
|
{
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: Early reading 32-bit field {:#08x} for {}", field, address);
|
2020-10-31 22:24:01 +02:00
|
|
|
IO::out32(PCI_ADDRESS_PORT, address.io_address_for_field(field));
|
|
|
|
return IO::in32(PCI_VALUE_PORT);
|
|
|
|
}
|
|
|
|
|
|
|
|
u16 Access::early_read_type(Address address)
|
|
|
|
{
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: Early reading type for {}", address);
|
2020-10-31 22:24:01 +02:00
|
|
|
return (early_read8_field(address, PCI_CLASS) << 8u) | early_read8_field(address, PCI_SUBCLASS);
|
2020-04-08 16:56:36 +02:00
|
|
|
}
|
|
|
|
|
2021-01-31 12:03:23 +01:00
|
|
|
void Access::enumerate_functions(int type, u8 bus, u8 device, u8 function, Function<void(Address, ID)>& callback, bool recursive)
|
2019-12-31 13:04:30 +02:00
|
|
|
{
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: Enumerating function type={}, bus={}, device={}, function={}", type, bus, device, function);
|
2021-01-31 12:03:23 +01:00
|
|
|
Address address(0, bus, device, function);
|
2020-10-31 22:24:01 +02:00
|
|
|
if (type == -1 || type == early_read_type(address))
|
|
|
|
callback(address, { early_read16_field(address, PCI_VENDOR_ID), early_read16_field(address, PCI_DEVICE_ID) });
|
2021-01-31 12:03:23 +01:00
|
|
|
if (early_read_type(address) == PCI_TYPE_BRIDGE && recursive) {
|
2020-10-31 22:24:01 +02:00
|
|
|
u8 secondary_bus = early_read8_field(address, PCI_SECONDARY_BUS);
|
2021-03-12 13:57:56 +01:00
|
|
|
dbgln_if(PCI_DEBUG, "PCI: Found secondary bus: {}", secondary_bus);
|
2021-02-23 20:42:32 +01:00
|
|
|
VERIFY(secondary_bus != bus);
|
2021-01-31 12:03:23 +01:00
|
|
|
enumerate_bus(type, secondary_bus, callback, recursive);
|
2019-12-31 13:04:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-31 12:03:23 +01:00
|
|
|
void Access::enumerate_device(int type, u8 bus, u8 device, Function<void(Address, ID)>& callback, bool recursive)
|
2019-12-31 13:04:30 +02:00
|
|
|
{
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: Enumerating device type={}, bus={}, device={}", type, bus, device);
|
2021-01-31 12:03:23 +01:00
|
|
|
Address address(0, bus, device, 0);
|
2020-10-31 22:24:01 +02:00
|
|
|
if (early_read16_field(address, PCI_VENDOR_ID) == PCI_NONE)
|
2019-12-31 13:04:30 +02:00
|
|
|
return;
|
2021-01-31 12:03:23 +01:00
|
|
|
enumerate_functions(type, bus, device, 0, callback, recursive);
|
2020-10-31 22:24:01 +02:00
|
|
|
if (!(early_read8_field(address, PCI_HEADER_TYPE) & 0x80))
|
2019-12-31 13:04:30 +02:00
|
|
|
return;
|
|
|
|
for (u8 function = 1; function < 8; ++function) {
|
2021-01-31 12:03:23 +01:00
|
|
|
Address address(0, bus, device, function);
|
2020-10-31 22:24:01 +02:00
|
|
|
if (early_read16_field(address, PCI_VENDOR_ID) != PCI_NONE)
|
2021-01-31 12:03:23 +01:00
|
|
|
enumerate_functions(type, bus, device, function, callback, recursive);
|
2019-12-31 13:04:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-31 12:03:23 +01:00
|
|
|
void Access::enumerate_bus(int type, u8 bus, Function<void(Address, ID)>& callback, bool recursive)
|
2019-12-31 13:04:30 +02:00
|
|
|
{
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: Enumerating bus type={}, bus={}", type, bus);
|
2021-01-31 12:03:23 +01:00
|
|
|
for (u8 device = 0; device < 32; ++device)
|
|
|
|
enumerate_device(type, bus, device, callback, recursive);
|
2019-12-31 13:04:30 +02:00
|
|
|
}
|
|
|
|
|
2020-04-10 20:25:03 +03:00
|
|
|
void Access::enumerate(Function<void(Address, ID)>& callback) const
|
2020-03-22 13:12:45 +13:00
|
|
|
{
|
2020-04-10 20:25:03 +03:00
|
|
|
for (auto& physical_id : m_physical_ids) {
|
|
|
|
callback(physical_id.address(), physical_id.id());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void enumerate(Function<void(Address, ID)> callback)
|
|
|
|
{
|
|
|
|
Access::the().enumerate(callback);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-03-08 16:50:46 +02:00
|
|
|
|
2020-12-18 17:37:51 +02:00
|
|
|
Optional<u8> get_capabilities_pointer(Address address)
|
|
|
|
{
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: Getting capabilities pointer for {}", address);
|
2020-12-18 17:37:51 +02:00
|
|
|
if (PCI::read16(address, PCI_STATUS) & (1 << 4)) {
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: Found capabilities pointer for {}", address);
|
2020-12-18 17:37:51 +02:00
|
|
|
return PCI::read8(address, PCI_CAPABILITIES_POINTER);
|
|
|
|
}
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: No capabilities pointer for {}", address);
|
2020-12-18 17:37:51 +02:00
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2020-12-18 20:24:32 +02:00
|
|
|
PhysicalID get_physical_id(Address address)
|
|
|
|
{
|
|
|
|
return Access::the().get_physical_id(address);
|
|
|
|
}
|
|
|
|
|
2020-12-18 17:37:51 +02:00
|
|
|
Vector<Capability> get_capabilities(Address address)
|
|
|
|
{
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: Getting capabilities for {}", address);
|
2020-12-18 17:37:51 +02:00
|
|
|
auto capabilities_pointer = PCI::get_capabilities_pointer(address);
|
2020-12-22 04:22:32 +00:00
|
|
|
if (!capabilities_pointer.has_value()) {
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: No capabilities for {}", address);
|
2020-12-18 17:37:51 +02:00
|
|
|
return {};
|
2020-12-22 04:22:32 +00:00
|
|
|
}
|
2020-12-18 17:37:51 +02:00
|
|
|
Vector<Capability> capabilities;
|
|
|
|
auto capability_pointer = capabilities_pointer.value();
|
|
|
|
while (capability_pointer != 0) {
|
2021-02-07 15:33:24 +03:30
|
|
|
dbgln_if(PCI_DEBUG, "PCI: Reading in capability at {:#02x} for {}", capability_pointer, address);
|
2020-12-18 17:37:51 +02:00
|
|
|
u16 capability_header = PCI::read16(address, capability_pointer);
|
|
|
|
u8 capability_id = capability_header & 0xff;
|
2021-01-02 19:33:30 +02:00
|
|
|
capabilities.append({ address, capability_id, capability_pointer });
|
2020-12-18 17:37:51 +02:00
|
|
|
capability_pointer = capability_header >> 8;
|
|
|
|
}
|
|
|
|
return capabilities;
|
|
|
|
}
|
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
void raw_access(Address address, u32 field, size_t access_size, u32 value)
|
|
|
|
{
|
2021-02-23 20:42:32 +01:00
|
|
|
VERIFY(access_size != 0);
|
2020-03-22 13:12:45 +13:00
|
|
|
if (access_size == 1) {
|
2020-04-08 17:08:00 +02:00
|
|
|
write8(address, field, value);
|
2020-03-22 13:12:45 +13:00
|
|
|
return;
|
2020-02-22 17:15:03 +02:00
|
|
|
}
|
2020-03-22 13:12:45 +13:00
|
|
|
if (access_size == 2) {
|
2020-04-08 17:08:00 +02:00
|
|
|
write16(address, field, value);
|
2020-03-22 13:12:45 +13:00
|
|
|
return;
|
2020-02-22 17:15:03 +02:00
|
|
|
}
|
2020-03-22 13:12:45 +13:00
|
|
|
if (access_size == 4) {
|
2020-04-08 17:08:00 +02:00
|
|
|
write32(address, field, value);
|
2020-03-22 13:12:45 +13:00
|
|
|
return;
|
2020-02-22 17:15:03 +02:00
|
|
|
}
|
2021-02-23 20:42:32 +01:00
|
|
|
VERIFY_NOT_REACHED();
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-02-16 01:27:42 +01:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
ID get_id(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return { read16(address, PCI_VENDOR_ID), read16(address, PCI_DEVICE_ID) };
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
void enable_interrupt_line(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
write16(address, PCI_COMMAND, read16(address, PCI_COMMAND) & ~(1 << 10));
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
void disable_interrupt_line(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
write16(address, PCI_COMMAND, read16(address, PCI_COMMAND) | 1 << 10);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
u8 get_interrupt_line(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return read8(address, PCI_INTERRUPT_LINE);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
u32 get_BAR0(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return read32(address, PCI_BAR0);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
u32 get_BAR1(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return read32(address, PCI_BAR1);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
u32 get_BAR2(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return read32(address, PCI_BAR2);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
u32 get_BAR3(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return read16(address, PCI_BAR3);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
u32 get_BAR4(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return read32(address, PCI_BAR4);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
u32 get_BAR5(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return read32(address, PCI_BAR5);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2021-01-02 19:43:45 +02:00
|
|
|
u32 get_BAR(Address address, u8 bar)
|
|
|
|
{
|
2021-01-02 19:53:05 +02:00
|
|
|
VERIFY(bar <= 5);
|
2021-01-02 19:43:45 +02:00
|
|
|
switch (bar) {
|
|
|
|
case 0:
|
|
|
|
return get_BAR0(address);
|
|
|
|
case 1:
|
|
|
|
return get_BAR1(address);
|
|
|
|
case 2:
|
|
|
|
return get_BAR2(address);
|
|
|
|
case 3:
|
|
|
|
return get_BAR3(address);
|
|
|
|
case 4:
|
|
|
|
return get_BAR4(address);
|
|
|
|
case 5:
|
|
|
|
return get_BAR5(address);
|
|
|
|
default:
|
2021-01-02 19:53:05 +02:00
|
|
|
VERIFY_NOT_REACHED();
|
2021-01-02 19:43:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
u8 get_revision_id(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return read8(address, PCI_REVISION_ID);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
u8 get_subclass(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return read8(address, PCI_SUBCLASS);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
u8 get_class(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return read8(address, PCI_CLASS);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-09-03 20:59:58 +02:00
|
|
|
u8 get_programming_interface(Address address)
|
|
|
|
{
|
|
|
|
return read8(address, PCI_PROG_IF);
|
|
|
|
}
|
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
u16 get_subsystem_id(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return read16(address, PCI_SUBSYSTEM_ID);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
u16 get_subsystem_vendor_id(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
return read16(address, PCI_SUBSYSTEM_VENDOR_ID);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
void enable_bus_mastering(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
auto value = read16(address, PCI_COMMAND);
|
2020-04-08 16:56:36 +02:00
|
|
|
value |= (1 << 2);
|
|
|
|
value |= (1 << 0);
|
2020-04-08 17:08:00 +02:00
|
|
|
write16(address, PCI_COMMAND, value);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
2020-03-22 13:12:45 +13:00
|
|
|
void disable_bus_mastering(Address address)
|
|
|
|
{
|
2020-04-08 17:08:00 +02:00
|
|
|
auto value = read16(address, PCI_COMMAND);
|
2020-04-08 16:56:36 +02:00
|
|
|
value &= ~(1 << 2);
|
|
|
|
value |= (1 << 0);
|
2020-04-08 17:08:00 +02:00
|
|
|
write16(address, PCI_COMMAND, value);
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-04-08 16:56:36 +02:00
|
|
|
|
|
|
|
size_t get_BAR_space_size(Address address, u8 bar_number)
|
2020-03-22 13:12:45 +13:00
|
|
|
{
|
2020-04-08 16:56:36 +02:00
|
|
|
// See PCI Spec 2.3, Page 222
|
2021-02-23 20:42:32 +01:00
|
|
|
VERIFY(bar_number < 6);
|
2020-04-08 16:56:36 +02:00
|
|
|
u8 field = (PCI_BAR0 + (bar_number << 2));
|
2020-04-08 17:08:00 +02:00
|
|
|
u32 bar_reserved = read32(address, field);
|
|
|
|
write32(address, field, 0xFFFFFFFF);
|
|
|
|
u32 space_size = read32(address, field);
|
|
|
|
write32(address, field, bar_reserved);
|
2020-04-08 16:56:36 +02:00
|
|
|
space_size &= 0xfffffff0;
|
|
|
|
space_size = (~space_size) + 1;
|
|
|
|
return space_size;
|
2020-03-22 13:12:45 +13:00
|
|
|
}
|
2020-02-16 01:27:42 +01:00
|
|
|
|
2021-01-02 19:33:30 +02:00
|
|
|
u8 Capability::read8(u32 field) const
|
|
|
|
{
|
|
|
|
return PCI::read8(m_address, m_ptr + field);
|
|
|
|
}
|
|
|
|
|
|
|
|
u16 Capability::read16(u32 field) const
|
|
|
|
{
|
|
|
|
return PCI::read16(m_address, m_ptr + field);
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 Capability::read32(u32 field) const
|
|
|
|
{
|
|
|
|
return PCI::read32(m_address, m_ptr + field);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Capability::write8(u32 field, u8 value)
|
|
|
|
{
|
|
|
|
PCI::write8(m_address, m_ptr + field, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Capability::write16(u32 field, u16 value)
|
|
|
|
{
|
|
|
|
PCI::write16(m_address, m_ptr + field, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Capability::write32(u32 field, u32 value)
|
|
|
|
{
|
|
|
|
PCI::write32(m_address, m_ptr + field, value);
|
|
|
|
}
|
|
|
|
|
2019-12-31 13:04:30 +02:00
|
|
|
}
|
2020-04-08 17:29:37 +02:00
|
|
|
}
|