Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[patch-axel-8] WIP libsel4platsupport: debug log #8

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/sel4test-sim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
cparser:
simulation:
name: Simulation
runs-on: ubuntu-latest
strategy:
Expand Down
17 changes: 16 additions & 1 deletion libsel4muslcsys/src/sys_morecore.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ long sys_mmap_impl(void *addr, size_t length, int prot, int flags, int fd, off_t
if (length > morecore_top - morecore_base) {
return -ENOMEM;
}

ZF_LOGI(
"morecore %p - %p, len %#x, return address: 0x%"PRIxPTR,
morecore_base, morecore_top, length, morecore_top-length);

/* Steal from the top */
morecore_top -= length;
return morecore_top;
Expand Down Expand Up @@ -116,6 +121,8 @@ static void init_morecore_region(void)
morecore_base = (uintptr_t) morecore_area;
morecore_top = (uintptr_t) &morecore_area[morecore_size];
}

ZF_LOGI("morecore %p - %p (%#zd)", morecore_base, morecore_top, morecore_size);
}

static long sys_brk_static(va_list ap)
Expand Down Expand Up @@ -199,8 +206,16 @@ static long sys_mmap_impl_static(void *addr, size_t length, int prot, int flags,
if (base < morecore_base) {
return -ENOMEM;
}
ZF_LOGF_IF(
(base % 0x1000) != 0,
"morecore %p - %p, len %#zx, return address: %p (not 4 KiB aligned)",
(void*)morecore_base, (void*)morecore_top, length, (void*)base);

ZF_LOGI(
"morecore %p - %p, len %#zx, return address: %p",
(void*)morecore_base, (void*)morecore_top, length, (void*)base);

morecore_top = base;
ZF_LOGF_IF((base % 0x1000) != 0, "return address: 0x%"PRIxPTR" requires alignment: 0x%x ", base, 0x1000);
return base;
}
assert(!"not implemented");
Expand Down
Loading