mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 01:37:34 +00:00
PCI: Enable LogStream output for addresses
This commit is contained in:
parent
032ce1948e
commit
8639ee2640
3 changed files with 8 additions and 2 deletions
|
@ -141,7 +141,7 @@ E1000NetworkAdapter::E1000NetworkAdapter(PCI::Address address, u8 irq)
|
||||||
{
|
{
|
||||||
set_interface_name("e1k");
|
set_interface_name("e1k");
|
||||||
|
|
||||||
klog() << "E1000: Found at PCI address @ " << String::format("%w", pci_address().seg()) << ":" << String::format("%b", pci_address().bus()) << ":" << String::format("%b", pci_address().slot()) << "." << String::format("%b", pci_address().function());
|
klog() << "E1000: Found @ " << pci_address();
|
||||||
|
|
||||||
enable_bus_mastering(pci_address());
|
enable_bus_mastering(pci_address());
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ RTL8139NetworkAdapter::RTL8139NetworkAdapter(PCI::Address address, u8 irq)
|
||||||
m_tx_buffers.ensure_capacity(RTL8139_TX_BUFFER_COUNT);
|
m_tx_buffers.ensure_capacity(RTL8139_TX_BUFFER_COUNT);
|
||||||
set_interface_name("rtl8139");
|
set_interface_name("rtl8139");
|
||||||
|
|
||||||
klog() << "RTL8139: Found at PCI address " << String::format("%w", pci_address().seg()) << ":" << String::format("%b", pci_address().bus()) << ":" << String::format("%b", pci_address().slot()) << "." << String::format("%b", pci_address().function());
|
klog() << "RTL8139: Found @ " << pci_address();
|
||||||
|
|
||||||
enable_bus_mastering(pci_address());
|
enable_bus_mastering(pci_address());
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/Function.h>
|
#include <AK/Function.h>
|
||||||
|
#include <AK/LogStream.h>
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
@ -129,6 +130,11 @@ namespace PCI {
|
||||||
u8 m_function { 0 };
|
u8 m_function { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline const LogStream& operator<<(const LogStream& stream, const Address value)
|
||||||
|
{
|
||||||
|
return stream << "PCI [" << String::format("%w", value.seg()) << ":" << String::format("%b", value.bus()) << ":" << String::format("%b", value.slot()) << "." << String::format("%b", value.function()) << "]";
|
||||||
|
}
|
||||||
|
|
||||||
struct ChangeableAddress : public Address {
|
struct ChangeableAddress : public Address {
|
||||||
ChangeableAddress()
|
ChangeableAddress()
|
||||||
: Address(0)
|
: Address(0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue