mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 19:15:07 +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
|
@ -227,7 +227,7 @@ size_t get_BAR_space_size(DeviceIdentifier const& identifier, HeaderType0BaseReg
|
|||
write32_offsetted(identifier, field, 0xFFFFFFFF);
|
||||
u32 space_size = read32_offsetted(identifier, field);
|
||||
write32_offsetted(identifier, field, bar_reserved);
|
||||
space_size &= 0xfffffff0;
|
||||
space_size &= bar_address_mask;
|
||||
space_size = (~space_size) + 1;
|
||||
return space_size;
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ size_t get_expansion_rom_space_size(DeviceIdentifier const& identifier)
|
|||
write32_offsetted(identifier, field, 0xFFFFFFFF);
|
||||
u32 space_size = read32_offsetted(identifier, field);
|
||||
write32_offsetted(identifier, field, bar_reserved);
|
||||
space_size &= 0xfffffff0;
|
||||
space_size &= bar_address_mask;
|
||||
space_size = (~space_size) + 1;
|
||||
return space_size;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue