Skip to content

Commit

Permalink
arm: Use constants instead of magic numbers
Browse files Browse the repository at this point in the history
Use object size definitions from libsel4 instead of magic numbers.

Signed-off-by: Kent McLeod <[email protected]>
  • Loading branch information
kent-mcleod committed Feb 6, 2022
1 parent 62d8d06 commit 9adad93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions apps/sel4test-tests/sel4_arch/aarch32/arch_frame_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

/* This list must be ordered by size - highest first */
static const frame_type_t frame_types[] = {
{ seL4_ARM_SuperSectionObject, 0, 24, },
{ seL4_ARM_SectionObject, BIT(24), 20, },
{ seL4_ARM_LargePageObject, BIT(24) + BIT(20), 16, },
{ seL4_ARM_SmallPageObject, BIT(24) + BIT(20) + BIT(16), seL4_PageBits, },
{ seL4_ARM_SuperSectionObject, 0, seL4_SuperSectionBits, },
{ seL4_ARM_SectionObject, BIT(seL4_SuperSectionBits), seL4_SectionBits, },
{ seL4_ARM_LargePageObject, BIT(seL4_SuperSectionBits) + BIT(seL4_SectionBits), seL4_LargePageBits, },
{ seL4_ARM_SmallPageObject, BIT(seL4_SuperSectionBits) + BIT(seL4_SectionBits) + BIT(seL4_LargePageBits), seL4_PageBits, },
};

8 changes: 4 additions & 4 deletions apps/sel4test-tests/sel4_arch/arm_hyp/arch_frame_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

/* This list must be ordered by size - highest first */
static const frame_type_t frame_types[] = {
{ seL4_ARM_SuperSectionObject, 0, 25, },
{ seL4_ARM_SectionObject, BIT(25), 21, },
{ seL4_ARM_LargePageObject, BIT(25) + BIT(21), 16, },
{ seL4_ARM_SmallPageObject, BIT(25) + BIT(21) + BIT(16), seL4_PageBits, },
{ seL4_ARM_SuperSectionObject, 0, seL4_SuperSectionBits, },
{ seL4_ARM_SectionObject, BIT(seL4_SuperSectionBits), seL4_SectionBits, },
{ seL4_ARM_LargePageObject, BIT(seL4_SuperSectionBits) + BIT(seL4_SectionBits), seL4_LargePageBits, },
{ seL4_ARM_SmallPageObject, BIT(seL4_SuperSectionBits) + BIT(seL4_SectionBits) + BIT(seL4_LargePageBits), seL4_PageBits, },
};

0 comments on commit 9adad93

Please sign in to comment.