mcs: correct MinSchedContextBits

This also adds a compile assert for checking that MinSchedContextBits
is the correct size in relation to seL4_CoreSchedContextBytes.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
This commit is contained in:
Michael McInerney 2022-10-24 18:29:11 +10:30 committed by Gerwin Klein
parent b07d653bdb
commit bb6a00ffe2

View file

@ -74,12 +74,17 @@ typedef enum {
#ifdef CONFIG_KERNEL_MCS
/* Minimum size of a scheduling context (2^{n} bytes) */
#define seL4_MinSchedContextBits 8
#define seL4_MinSchedContextBits 7
#ifndef __ASSEMBLER__
/* the size of a scheduling context, excluding extra refills */
#define seL4_CoreSchedContextBytes (10 * sizeof(seL4_Word) + (6 * 8))
/* the size of a single extra refill */
#define seL4_RefillSizeBytes (2 * 8)
SEL4_COMPILE_ASSERT(MinSchedContextBits_min_1, seL4_MinSchedContextBits > 1)
SEL4_COMPILE_ASSERT(MinSchedContextBits_sufficient,
seL4_CoreSchedContextBytes <= LIBSEL4_BIT(seL4_MinSchedContextBits))
SEL4_COMPILE_ASSERT(MinSchedContextBits_necessary,
seL4_CoreSchedContextBytes > LIBSEL4_BIT(seL4_MinSchedContextBits - 1))
/*
* @brief Calculate the max extra refills a scheduling context can contain for a specific size.