From 3ff79066b1dc84836470136d881111bad285e456 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 23 Nov 2020 12:31:38 +0100 Subject: [PATCH] Note an interrogation about integer value representation Especially 0 values may need special treatment since they can't be used as an array size. Signed-off-by: Gilles Peskine --- docs/proposed/psa-driver-interface.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/proposed/psa-driver-interface.md b/docs/proposed/psa-driver-interface.md index 18b15ed7f3..a0e16e1f32 100644 --- a/docs/proposed/psa-driver-interface.md +++ b/docs/proposed/psa-driver-interface.md @@ -840,6 +840,19 @@ psa_set_key_lifetime(&attributes, PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION ## Open questions +### Value representation + +#### Integers + +It would be better if there was a uniform requirement on integer values. Do they have to be JSON integers? C preprocessor integers (which could be e.g. a macro defined in some header file)? C compile-time constants (allowing `sizeof`)? + +This choice is partly driven by the use of the values, so they might not be uniform. Note that if the value can be zero and it's plausible that the core would want to statically allocate an array of the given size, the core needs to know whether the value is 0 so that it could use code like +``` +#if ACME_FOO_SIZE != 0 + uint8_t foo[ACME_FOO_SIZE]; +#endif +``` + ### Driver declarations #### Declaring driver entry points