Skip to content

Commit

Permalink
use seL4_BootInfoFrameSize
Browse files Browse the repository at this point in the history
Drop hard-coding the 4 KiB assumption.

Signed-off-by: Axel Heider <[email protected]>
  • Loading branch information
Axel Heider authored and lsf37 committed Aug 23, 2023
1 parent 173c80c commit 1f03365
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libsel4simple-default/src/libsel4simple-default.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ ssize_t simple_default_get_extended_bootinfo_size(void *data, seL4_Word type)
seL4_BootInfo *bi = data;

/* start of the extended bootinfo is defined to be 4K from the start of regular bootinfo */
uintptr_t cur = (uintptr_t)bi + PAGE_SIZE_4K;
uintptr_t cur = (uintptr_t)bi + seL4_BootInfoFrameSize;
uintptr_t end = cur + bi->extraLen;
while (cur < end) {
seL4_BootInfoHeader *header = (seL4_BootInfoHeader *)cur;
Expand All @@ -246,7 +246,7 @@ ssize_t simple_default_get_extended_bootinfo(void *data, seL4_Word type, void *d
return -1;
}
/* start of the extended bootinfo is defined to be 4K from the start of regular bootinfo */
uintptr_t cur = (uintptr_t)bi + PAGE_SIZE_4K;
uintptr_t cur = (uintptr_t)bi + seL4_BootInfoFrameSize;
uintptr_t end = cur + bi->extraLen;
while (cur < end) {
seL4_BootInfoHeader *header = (seL4_BootInfoHeader *)cur;
Expand Down
2 changes: 1 addition & 1 deletion libsel4utils/src/vspace/bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ int sel4utils_bootstrap_vspace_with_bootinfo(vspace_t *vspace, sel4utils_alloc_d
void *allocated_object_cookie)
{
size_t extra_pages = BYTES_TO_4K_PAGES(info->extraLen);
uintptr_t extra_base = (uintptr_t)info + PAGE_SIZE_4K;
uintptr_t extra_base = (uintptr_t)info + seL4_BootInfoFrameSize;
void *existing_frames[extra_pages + 3];
existing_frames[0] = info;
/* We assume the IPC buffer is less than a page and fits into one page */
Expand Down

0 comments on commit 1f03365

Please sign in to comment.