mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-19 03:06:39 +00:00
platform_drv: report MSI masking capability
This commit is contained in:
parent
b9c234a341
commit
8ab0638be9
@ -153,11 +153,12 @@ Genode::Irq_session_capability Platform::Device_component::irq(Genode::uint8_t i
|
||||
(!_session->msi_usage() || !_msi_cap()) ? ~0UL : _config_space);
|
||||
_ep->manage(_irq_session);
|
||||
|
||||
Genode::uint16_t msi_cap = _msi_cap();
|
||||
|
||||
if (_irq_session->msi()) {
|
||||
|
||||
Genode::addr_t msi_address = _irq_session->msi_address();
|
||||
Genode::uint32_t msi_value = _irq_session->msi_data();
|
||||
Genode::uint16_t msi_cap = _msi_cap();
|
||||
|
||||
Genode::uint16_t msi = _device_config.read(&_config_access,
|
||||
msi_cap + 2,
|
||||
@ -188,29 +189,32 @@ Genode::Irq_session_capability Platform::Device_component::irq(Genode::uint8_t i
|
||||
Platform::Device::ACCESS_8BIT);
|
||||
}
|
||||
|
||||
bool msi_64 = false;
|
||||
Genode::uint16_t msi_cap = _msi_cap();
|
||||
bool msi_64 = false;
|
||||
bool msi_mask = false;
|
||||
if (msi_cap) {
|
||||
Genode::uint16_t msi = _device_config.read(&_config_access,
|
||||
msi_cap + 2,
|
||||
Platform::Device::ACCESS_16BIT);
|
||||
msi_64 = msi & CAP_MSI_64;
|
||||
msi_64 = msi & CAP_MSI_64;
|
||||
msi_mask = msi & CAP_MASK;
|
||||
}
|
||||
|
||||
if (_irq_session->msi())
|
||||
PINF("%x:%x.%x uses MSI %s, vector 0x%lx, address 0x%lx",
|
||||
PINF("%x:%x.%x uses MSI %s, vector 0x%lx, address 0x%lx%s",
|
||||
_device_config.bus_number(),
|
||||
_device_config.device_number(),
|
||||
_device_config.function_number(),
|
||||
msi_64 ? "64bit" : "32bit",
|
||||
_irq_session->msi_data(), _irq_session->msi_address());
|
||||
_irq_session->msi_data(), _irq_session->msi_address(),
|
||||
msi_mask ? ", maskable" : ", non-maskable");
|
||||
else
|
||||
PINF("%x:%x.%x uses IRQ, vector 0x%x%s",
|
||||
PINF("%x:%x.%x uses IRQ, vector 0x%x%s%s",
|
||||
_device_config.bus_number(),
|
||||
_device_config.device_number(),
|
||||
_device_config.function_number(), _irq_line,
|
||||
msi_cap ? (msi_64 ? ", MSI 64bit capable" :
|
||||
", MSI 32bit capable") : "");
|
||||
", MSI 32bit capable") : "",
|
||||
msi_mask ? ", maskable" : ", non-maskable");
|
||||
|
||||
return _irq_session->cap();
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ class Platform::Device_component : public Genode::Rpc_object<Platform::Device>,
|
||||
PCI_IRQ_PIN = 0x3d,
|
||||
|
||||
CAP_MSI_64 = 0x80,
|
||||
CAP_MASK = 0x100,
|
||||
MSI_ENABLED = 0x1
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user