fix(mhuv2): provide only the usable size of memory

The function mhu_get_max_message_size() for MHUv2 should return only the
available memory for use after considering all the overheads for its own
use.

Signed-off-by: Sathyam Panda <sathyam.panda@arm.com>
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Change-Id: I14ad16e8f4b781e396bca6173077513db74157d5
This commit is contained in:
Sathyam Panda 2023-03-29 12:17:11 +01:00 committed by Vijayenthiran Subramaniam
parent fb7f6a4422
commit 5cd10848be

View file

@ -308,5 +308,10 @@ size_t mhu_get_max_message_size(void)
assert(num_channels != 0);
return num_channels * sizeof(uint32_t);
/*
* Returns only usable size of memory. As one channel is specifically
* used to inform about the size of payload, discard it from avialable
* memory size.
*/
return (num_channels - 1) * sizeof(uint32_t);
}