use BIT() macro instead of explicit shifts
As a side effect, the BIT() macro creates a word_t instead of an int, so it can can handle even shift that exceed the int limits. This makes the code more robust and provides the preferred coding pattern. Signed-off-by: Axel Heider <axelheider@gmx.de>
This commit is contained in:
parent
0f7135aae4
commit
7bff9f4cd1
2 changed files with 2 additions and 2 deletions
|
|
@ -34,7 +34,7 @@ BOOT_CODE void map_kernel_devices(void)
|
|||
if (!kernel_devices[i].userAvailable) {
|
||||
p_region_t reg = {
|
||||
.start = kernel_devices[i].paddr,
|
||||
.end = kernel_devices[i].paddr + (1 << PAGE_BITS),
|
||||
.end = kernel_devices[i].paddr + BIT(PAGE_BITS),
|
||||
};
|
||||
reserve_region(reg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ BOOT_CODE void map_kernel_devices(void)
|
|||
if (!kernel_devices[i].userAvailable) {
|
||||
p_region_t reg = {
|
||||
.start = kernel_devices[i].paddr,
|
||||
.end = kernel_devices[i].paddr + (1 << seL4_LargePageBits),
|
||||
.end = kernel_devices[i].paddr + BIT(seL4_LargePageBits),
|
||||
};
|
||||
reserve_region(reg);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue