Skip to content

Commit

Permalink
remove taking address on local vars
Browse files Browse the repository at this point in the history
Signed-off-by: isubasinghe <[email protected]>
  • Loading branch information
isubasinghe committed Jan 18, 2024
1 parent ad271b5 commit 72e3fb2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion libmicrokit/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static void run_init_funcs(void)
}
}

seL4_Word gbadge;
static void handler_loop(void)
{
bool have_reply = false;
Expand All @@ -55,7 +56,8 @@ static void handler_loop(void)
seL4_MessageInfo_t tag;

if (have_reply) {
tag = seL4_ReplyRecv(INPUT_CAP, reply_tag, &badge, REPLY_CAP);
tag = seL4_ReplyRecv(INPUT_CAP, reply_tag, &gbadge, REPLY_CAP);
badge = gbadge;
} else if (have_signal) {
tag = seL4_NBSendRecv(signal, signal_msg, INPUT_CAP, &badge, REPLY_CAP);
have_signal = false;
Expand Down
12 changes: 9 additions & 3 deletions monitor/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,19 @@ static unsigned perform_invocation(seL4_Word *invocation_data, unsigned offset,
return next_offset;
}

seL4_Word gbadge;
seL4_UserContext gregs;
static void monitor(void)
{
for (;;) {
seL4_Word badge, label;
seL4_Word badge;
seL4_Word label;
seL4_MessageInfo_t tag;
seL4_Error err;

tag = seL4_Recv(fault_ep, &badge, reply);
tag = seL4_Recv(fault_ep, &gbadge, reply);
badge = gbadge;

label = seL4_MessageInfo_get_label(tag);

seL4_Word tcb_cap = tcbs[badge];
Expand Down Expand Up @@ -473,10 +478,11 @@ static void monitor(void)

seL4_UserContext regs;

err = seL4_TCB_ReadRegisters(tcb_cap, false, 0, sizeof(seL4_UserContext) / sizeof(seL4_Word), &regs);
err = seL4_TCB_ReadRegisters(tcb_cap, false, 0, sizeof(seL4_UserContext) / sizeof(seL4_Word), &gregs);
if (err != seL4_NoError) {
fail("error reading registers");
}
regs = gregs;

// FIXME: Would be good to print the whole register set
puts("Registers: \n");
Expand Down

0 comments on commit 72e3fb2

Please sign in to comment.