Skip to content

Commit

Permalink
boot: Remove constant BI_FRAME_SIZE_BITS
Browse files Browse the repository at this point in the history
Use seL4_BootInfoFrameSizeBits directly.

Signed-off-by: Axel Heider <axelheider@gmx.de>
  • Loading branch information
axel-h authored and lsf37 committed Aug 23, 2023
1 parent b8c0b1c commit 4d77c70
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions include/bootinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@
#define BI_REF(p) ((word_t)(p))

#define S_REG_EMPTY (seL4_SlotRegion){ .start = 0, .end = 0 }

#define BI_FRAME_SIZE_BITS seL4_BootInfoFrameBits
2 changes: 1 addition & 1 deletion src/arch/arm/kernel/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ static BOOT_CODE bool_t try_init_kernel(

ipcbuf_vptr = ui_v_reg.end;
bi_frame_vptr = ipcbuf_vptr + BIT(PAGE_BITS);
extra_bi_frame_vptr = bi_frame_vptr + BIT(BI_FRAME_SIZE_BITS);
extra_bi_frame_vptr = bi_frame_vptr + BIT(seL4_BootInfoFrameBits);

/* setup virtual memory for the kernel */
map_kernel_window();
Expand Down
2 changes: 1 addition & 1 deletion src/arch/riscv/kernel/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static BOOT_CODE bool_t try_init_kernel(

ipcbuf_vptr = ui_v_reg.end;
bi_frame_vptr = ipcbuf_vptr + BIT(PAGE_BITS);
extra_bi_frame_vptr = bi_frame_vptr + BIT(BI_FRAME_SIZE_BITS);
extra_bi_frame_vptr = bi_frame_vptr + BIT(seL4_BootInfoFrameBits);

map_kernel_window();

Expand Down
2 changes: 1 addition & 1 deletion src/arch/x86/kernel/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ BOOT_CODE bool_t init_sys_state(

ipcbuf_vptr = ui_v_reg.end;
bi_frame_vptr = ipcbuf_vptr + BIT(PAGE_BITS);
extra_bi_frame_vptr = bi_frame_vptr + BIT(BI_FRAME_SIZE_BITS);
extra_bi_frame_vptr = bi_frame_vptr + BIT(seL4_BootInfoFrameBits);

if (vbe->vbeMode != -1) {
extra_bi_size += sizeof(seL4_X86_BootInfo_VBE);
Expand Down
8 changes: 4 additions & 4 deletions src/kernel/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ BOOT_CODE static word_t calculate_rootserver_size(v_region_t it_v_reg, word_t ex
word_t size = BIT(CONFIG_ROOT_CNODE_SIZE_BITS + seL4_SlotBits);
size += BIT(seL4_TCBBits); // root thread tcb
size += BIT(seL4_PageBits); // ipc buf
size += BIT(BI_FRAME_SIZE_BITS); // boot info
size += BIT(seL4_BootInfoFrameBits); // boot info
size += BIT(seL4_ASIDPoolBits);
size += extra_bi_size_bits > 0 ? BIT(extra_bi_size_bits) : 0;
size += BIT(seL4_VSpaceBits); // root vspace
Expand Down Expand Up @@ -232,8 +232,8 @@ BOOT_CODE static void create_rootserver_objects(pptr_t start, v_region_t it_v_re
* of allocations used in the current implementation here, it can't be any
* bigger.
*/
compile_assert(invalid_BI_FRAME_SIZE_BITS, BI_FRAME_SIZE_BITS == seL4_PageBits);
rootserver.boot_info = alloc_rootserver_obj(BI_FRAME_SIZE_BITS, 1);
compile_assert(invalid_seL4_BootInfoFrameBits, seL4_BootInfoFrameBits == seL4_PageBits);
rootserver.boot_info = alloc_rootserver_obj(seL4_BootInfoFrameBits, 1);

/* TCBs on aarch32 can be larger than page tables in certain configs */
#if seL4_TCBBits >= seL4_PageTableBits
Expand Down Expand Up @@ -348,7 +348,7 @@ BOOT_CODE void populate_bi_frame(node_id_t node_id, word_t num_nodes,
vptr_t ipcbuf_vptr, word_t extra_bi_size)
{
/* clear boot info memory */
clearMemory((void *)rootserver.boot_info, BI_FRAME_SIZE_BITS);
clearMemory((void *)rootserver.boot_info, seL4_BootInfoFrameBits);
if (extra_bi_size) {
clearMemory((void *)rootserver.extra_bi,
calculate_extra_bi_size_bits(extra_bi_size));
Expand Down

0 comments on commit 4d77c70

Please sign in to comment.