mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +00:00
Kernel: Run clang-format on PCI definitions file
This commit is contained in:
parent
0cda92d5da
commit
fc611be592
1 changed files with 134 additions and 134 deletions
|
@ -31,7 +31,6 @@
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
|
|
||||||
#define PCI_VENDOR_ID 0x00 // word
|
#define PCI_VENDOR_ID 0x00 // word
|
||||||
#define PCI_DEVICE_ID 0x02 // word
|
#define PCI_DEVICE_ID 0x02 // word
|
||||||
#define PCI_COMMAND 0x04 // word
|
#define PCI_COMMAND 0x04 // word
|
||||||
|
@ -52,6 +51,7 @@ namespace Kernel {
|
||||||
#define PCI_BAR5 0x24 // u32
|
#define PCI_BAR5 0x24 // u32
|
||||||
#define PCI_SUBSYSTEM_ID 0x2C // u16
|
#define PCI_SUBSYSTEM_ID 0x2C // u16
|
||||||
#define PCI_SUBSYSTEM_VENDOR_ID 0x2E // u16
|
#define PCI_SUBSYSTEM_VENDOR_ID 0x2E // u16
|
||||||
|
#define PCI_CAPABILITIES_POINTER 0x34 // u8
|
||||||
#define PCI_INTERRUPT_LINE 0x3C // byte
|
#define PCI_INTERRUPT_LINE 0x3C // byte
|
||||||
#define PCI_SECONDARY_BUS 0x19 // byte
|
#define PCI_SECONDARY_BUS 0x19 // byte
|
||||||
#define PCI_HEADER_TYPE_DEVICE 0
|
#define PCI_HEADER_TYPE_DEVICE 0
|
||||||
|
@ -67,7 +67,7 @@ namespace Kernel {
|
||||||
//#define PCI_DEBUG 1
|
//#define PCI_DEBUG 1
|
||||||
|
|
||||||
namespace PCI {
|
namespace PCI {
|
||||||
struct ID {
|
struct ID {
|
||||||
u16 vendor_id { 0 };
|
u16 vendor_id { 0 };
|
||||||
u16 device_id { 0 };
|
u16 device_id { 0 };
|
||||||
|
|
||||||
|
@ -81,10 +81,10 @@ struct ID {
|
||||||
{
|
{
|
||||||
return vendor_id != other.vendor_id || device_id != other.device_id;
|
return vendor_id != other.vendor_id || device_id != other.device_id;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Address {
|
struct Address {
|
||||||
public:
|
public:
|
||||||
Address() {}
|
Address() {}
|
||||||
Address(u16 seg)
|
Address(u16 seg)
|
||||||
: m_seg(seg)
|
: m_seg(seg)
|
||||||
|
@ -122,14 +122,14 @@ public:
|
||||||
return 0x80000000u | (m_bus << 16u) | (m_slot << 11u) | (m_function << 8u) | (field & 0xfc);
|
return 0x80000000u | (m_bus << 16u) | (m_slot << 11u) | (m_function << 8u) | (field & 0xfc);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
u32 m_seg { 0 };
|
u32 m_seg { 0 };
|
||||||
u8 m_bus { 0 };
|
u8 m_bus { 0 };
|
||||||
u8 m_slot { 0 };
|
u8 m_slot { 0 };
|
||||||
u8 m_function { 0 };
|
u8 m_function { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ChangeableAddress : public Address {
|
struct ChangeableAddress : public Address {
|
||||||
ChangeableAddress()
|
ChangeableAddress()
|
||||||
: Address(0)
|
: Address(0)
|
||||||
{
|
{
|
||||||
|
@ -161,34 +161,34 @@ struct ChangeableAddress : public Address {
|
||||||
set_function(address.function());
|
set_function(address.function());
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ID get_id(PCI::Address);
|
ID get_id(PCI::Address);
|
||||||
void enumerate_all(Function<void(Address, ID)> callback);
|
void enumerate_all(Function<void(Address, ID)> callback);
|
||||||
void enable_interrupt_line(Address);
|
void enable_interrupt_line(Address);
|
||||||
void disable_interrupt_line(Address);
|
void disable_interrupt_line(Address);
|
||||||
u8 get_interrupt_line(Address);
|
u8 get_interrupt_line(Address);
|
||||||
u32 get_BAR0(Address);
|
u32 get_BAR0(Address);
|
||||||
u32 get_BAR1(Address);
|
u32 get_BAR1(Address);
|
||||||
u32 get_BAR2(Address);
|
u32 get_BAR2(Address);
|
||||||
u32 get_BAR3(Address);
|
u32 get_BAR3(Address);
|
||||||
u32 get_BAR4(Address);
|
u32 get_BAR4(Address);
|
||||||
u32 get_BAR5(Address);
|
u32 get_BAR5(Address);
|
||||||
u8 get_revision_id(Address);
|
u8 get_revision_id(Address);
|
||||||
u8 get_subclass(Address);
|
u8 get_subclass(Address);
|
||||||
u8 get_class(Address);
|
u8 get_class(Address);
|
||||||
u16 get_subsystem_id(Address);
|
u16 get_subsystem_id(Address);
|
||||||
u16 get_subsystem_vendor_id(Address);
|
u16 get_subsystem_vendor_id(Address);
|
||||||
size_t get_BAR_Space_Size(Address, u8);
|
size_t get_BAR_Space_Size(Address, u8);
|
||||||
void enable_bus_mastering(Address);
|
void enable_bus_mastering(Address);
|
||||||
void disable_bus_mastering(Address);
|
void disable_bus_mastering(Address);
|
||||||
|
|
||||||
class Initializer;
|
class Initializer;
|
||||||
class Access;
|
class Access;
|
||||||
class MMIOAccess;
|
class MMIOAccess;
|
||||||
class IOAccess;
|
class IOAccess;
|
||||||
class MMIOSegment;
|
class MMIOSegment;
|
||||||
class Device;
|
class Device;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue