mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 23:38:12 +00:00
Kernel: Add bar_address_mask to mask the last 4 bits of a BAR address
Create a bar_address_mask constant to mask the last 4 bits of a BAR address instead of hand coding the mask all over the kernel.
This commit is contained in:
parent
20d517f1da
commit
83b87a5ade
8 changed files with 14 additions and 15 deletions
|
@ -40,7 +40,7 @@ UNMAP_AFTER_INIT ErrorOr<void> NVMeController::initialize(bool is_queue_polled)
|
|||
|
||||
PCI::enable_memory_space(device_identifier());
|
||||
PCI::enable_bus_mastering(device_identifier());
|
||||
m_bar = PCI::get_BAR0(device_identifier()) & BAR_ADDR_MASK;
|
||||
m_bar = PCI::get_BAR0(device_identifier()) & PCI::bar_address_mask;
|
||||
static_assert(sizeof(ControllerRegister) == REG_SQ0TDBL_START);
|
||||
static_assert(sizeof(NVMeSubmission) == (1 << SQ_WIDTH));
|
||||
|
||||
|
|
|
@ -34,8 +34,6 @@ struct IdentifyNamespace {
|
|||
u64 rsvd3[488];
|
||||
};
|
||||
|
||||
// BAR
|
||||
static constexpr u32 BAR_ADDR_MASK = 0xFFFFFFF0;
|
||||
// DOORBELL
|
||||
static constexpr u32 REG_SQ0TDBL_START = 0x1000;
|
||||
static constexpr u32 REG_SQ0TDBL_END = 0x1003;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue