Skip to content

Commit

Permalink
libmicrokit: add func to get mr count from msginfo
Browse files Browse the repository at this point in the history
Signed-off-by: Krishnan Winter <[email protected]>
  • Loading branch information
Kswin01 authored and Ivan-Velickovic committed Apr 26, 2024
1 parent c54ae62 commit f093985
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ Additionally, if the protection domain provides a protected procedure it must al
void microkit_notify(microkit_channel ch);
microkit_msginfo microkit_msginfo_new(uint64_t label, uint16_t count);
uint64_t microkit_msginfo_get_label(microkit_msginfo msginfo);
uint64_t microkit_msginfo_get_count(microkit_msginfo msginfo);
void microkit_irq_ack(microkit_channel ch);
void microkit_mr_set(uint8_t mr, uint64_t value);
uint64_t microkit_mr_get(uint8_t mr);
Expand Down Expand Up @@ -421,6 +422,10 @@ The message can be passed to `microkit_ppcall` or returned from `protected`.

Returns the label from a message.

## `uint64_t microkit_msginfo_get_count(microkit_msginfo msginfo)`

Returns the count of message registers in the message.

## `uint64_t microkit_mr_get(uint8_t mr)`

Get a message register.
Expand Down
5 changes: 5 additions & 0 deletions libmicrokit/include/microkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ static inline uint64_t microkit_msginfo_get_label(microkit_msginfo msginfo)
return seL4_MessageInfo_get_label(msginfo);
}

static inline uint64_t microkit_msginfo_get_count(microkit_msginfo msginfo)
{
return seL4_MessageInfo_get_length(msginfo);
}

static void microkit_mr_set(uint8_t mr, uint64_t value)
{
seL4_SetMR(mr, value);
Expand Down

0 comments on commit f093985

Please sign in to comment.