From 6a8200c7c57da60815bbda0796217f47ab198bfb Mon Sep 17 00:00:00 2001 From: Krishnan Winter Date: Fri, 26 Apr 2024 13:37:50 +1000 Subject: [PATCH] libmicrokit: add func to get mr count from msginfo Signed-off-by: Krishnan Winter --- docs/manual.md | 5 +++++ libmicrokit/include/microkit.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/docs/manual.md b/docs/manual.md index cce200610..0e4a77c04 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -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); @@ -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. diff --git a/libmicrokit/include/microkit.h b/libmicrokit/include/microkit.h index 78373474f..cd00d869a 100644 --- a/libmicrokit/include/microkit.h +++ b/libmicrokit/include/microkit.h @@ -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) {