mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +00:00
AK: Rename the common integer typedefs to make it obvious what they are.
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
This commit is contained in:
parent
c4c4bbc5ba
commit
27f699ef0c
208 changed files with 1603 additions and 1621 deletions
34
Kernel/PCI.h
34
Kernel/PCI.h
|
@ -6,8 +6,8 @@
|
|||
namespace PCI {
|
||||
|
||||
struct ID {
|
||||
word vendor_id { 0 };
|
||||
word device_id { 0 };
|
||||
u16 vendor_id { 0 };
|
||||
u16 device_id { 0 };
|
||||
|
||||
bool is_null() const { return !vendor_id && !device_id; }
|
||||
|
||||
|
@ -19,7 +19,7 @@ struct ID {
|
|||
|
||||
struct Address {
|
||||
Address() {}
|
||||
Address(byte bus, byte slot, byte function)
|
||||
Address(u8 bus, u8 slot, u8 function)
|
||||
: m_bus(bus)
|
||||
, m_slot(slot)
|
||||
, m_function(function)
|
||||
|
@ -29,29 +29,29 @@ struct Address {
|
|||
bool is_null() const { return !m_bus && !m_slot && !m_function; }
|
||||
operator bool() const { return !is_null(); }
|
||||
|
||||
byte bus() const { return m_bus; }
|
||||
byte slot() const { return m_slot; }
|
||||
byte function() const { return m_function; }
|
||||
u8 bus() const { return m_bus; }
|
||||
u8 slot() const { return m_slot; }
|
||||
u8 function() const { return m_function; }
|
||||
|
||||
dword io_address_for_field(byte field) const
|
||||
u32 io_address_for_field(u8 field) const
|
||||
{
|
||||
return 0x80000000u | (m_bus << 16u) | (m_slot << 11u) | (m_function << 8u) | (field & 0xfc);
|
||||
}
|
||||
|
||||
private:
|
||||
byte m_bus { 0 };
|
||||
byte m_slot { 0 };
|
||||
byte m_function { 0 };
|
||||
u8 m_bus { 0 };
|
||||
u8 m_slot { 0 };
|
||||
u8 m_function { 0 };
|
||||
};
|
||||
|
||||
void enumerate_all(Function<void(Address, ID)>);
|
||||
byte get_interrupt_line(Address);
|
||||
dword get_BAR0(Address);
|
||||
dword get_BAR1(Address);
|
||||
dword get_BAR2(Address);
|
||||
dword get_BAR3(Address);
|
||||
dword get_BAR4(Address);
|
||||
dword get_BAR5(Address);
|
||||
u8 get_interrupt_line(Address);
|
||||
u32 get_BAR0(Address);
|
||||
u32 get_BAR1(Address);
|
||||
u32 get_BAR2(Address);
|
||||
u32 get_BAR3(Address);
|
||||
u32 get_BAR4(Address);
|
||||
u32 get_BAR5(Address);
|
||||
void enable_bus_mastering(Address);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue