mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +00:00
Kernel: Rename two PCI components
Rename ID => HardwareID, and PhysicalID => DeviceIdentifier. This change merely does that to clarify what these objects really are.
This commit is contained in:
parent
82bb08a15c
commit
da327746a2
26 changed files with 97 additions and 97 deletions
|
@ -73,7 +73,7 @@ struct [[gnu::packed]] BochsDisplayMMIORegisters {
|
|||
|
||||
UNMAP_AFTER_INIT NonnullRefPtr<BochsGraphicsAdapter> BochsGraphicsAdapter::initialize(PCI::Address address)
|
||||
{
|
||||
PCI::ID id = PCI::get_id(address);
|
||||
PCI::HardwareID id = PCI::get_hardware_id(address);
|
||||
VERIFY((id.vendor_id == PCI::VendorID::QEMUOld && id.device_id == 0x1111) || (id.vendor_id == PCI::VendorID::VirtualBox && id.device_id == 0xbeef));
|
||||
return adopt_ref(*new BochsGraphicsAdapter(address));
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ UNMAP_AFTER_INIT BochsGraphicsAdapter::BochsGraphicsAdapter(PCI::Address pci_add
|
|||
GraphicsManagement::the().m_console = m_framebuffer_console;
|
||||
|
||||
// Note: If we use VirtualBox graphics adapter (which is based on Bochs one), we need to use IO ports
|
||||
auto id = PCI::get_id(pci_address);
|
||||
auto id = PCI::get_hardware_id(pci_address);
|
||||
if (id.vendor_id == 0x80ee && id.device_id == 0xbeef)
|
||||
m_io_required = true;
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ static inline bool is_display_controller_pci_device(PCI::Address address)
|
|||
return PCI::get_class(address) == 0x3;
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT bool GraphicsManagement::determine_and_initialize_graphics_device(const PCI::Address& address, PCI::ID id)
|
||||
UNMAP_AFTER_INIT bool GraphicsManagement::determine_and_initialize_graphics_device(const PCI::Address& address, PCI::HardwareID id)
|
||||
{
|
||||
VERIFY(is_vga_compatible_pci_device(address) || is_display_controller_pci_device(address));
|
||||
auto add_and_configure_adapter = [&](GraphicsDevice& graphics_device) {
|
||||
|
@ -179,13 +179,13 @@ UNMAP_AFTER_INIT bool GraphicsManagement::initialize()
|
|||
dbgln("Forcing no initialization of framebuffer devices");
|
||||
}
|
||||
|
||||
PCI::enumerate([&](const PCI::Address& address, PCI::PhysicalID const& physical_id) {
|
||||
PCI::enumerate([&](const PCI::Address& address, PCI::DeviceIdentifier const& device_identifier) {
|
||||
// Note: Each graphics controller will try to set its native screen resolution
|
||||
// upon creation. Later on, if we don't want to have framebuffer devices, a
|
||||
// framebuffer console will take the control instead.
|
||||
if (!is_vga_compatible_pci_device(address) && !is_display_controller_pci_device(address))
|
||||
return;
|
||||
determine_and_initialize_graphics_device(address, physical_id.id());
|
||||
determine_and_initialize_graphics_device(address, device_identifier.hardware_id());
|
||||
});
|
||||
|
||||
if (m_graphics_devices.is_empty()) {
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
void activate_graphical_mode();
|
||||
|
||||
private:
|
||||
bool determine_and_initialize_graphics_device(const PCI::Address& address, PCI::ID id);
|
||||
bool determine_and_initialize_graphics_device(const PCI::Address& address, PCI::HardwareID id);
|
||||
NonnullRefPtrVector<GraphicsDevice> m_graphics_devices;
|
||||
RefPtr<Graphics::Console> m_console;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ static bool is_supported_model(u16 device_id)
|
|||
|
||||
RefPtr<IntelNativeGraphicsAdapter> IntelNativeGraphicsAdapter::initialize(PCI::Address address)
|
||||
{
|
||||
auto id = PCI::get_id(address);
|
||||
auto id = PCI::get_hardware_id(address);
|
||||
VERIFY(id.vendor_id == 0x8086);
|
||||
if (!is_supported_model(id.device_id))
|
||||
return {};
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Kernel::Graphics::VirtIOGPU {
|
|||
|
||||
NonnullRefPtr<GraphicsAdapter> GraphicsAdapter::initialize(PCI::Address base_address)
|
||||
{
|
||||
VERIFY(PCI::get_id(base_address).vendor_id == PCI::VendorID::VirtIO);
|
||||
VERIFY(PCI::get_hardware_id(base_address).vendor_id == PCI::VendorID::VirtIO);
|
||||
return adopt_ref(*new GraphicsAdapter(base_address));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue