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 committed Apr 26, 2024
1 parent c2cfd9a commit 744e2ca
Show file tree
Hide file tree
Showing 2 changed files with 11 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
6 changes: 6 additions & 0 deletions libmicrokit/include/microkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ 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)
{
Expand Down

0 comments on commit 744e2ca

Please sign in to comment.