diff options
| author | Simon Glass <[email protected]> | 2024-10-21 10:19:28 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-10-25 14:22:24 -0600 |
| commit | 48008ec71148c0749ff34f7036a0278d4d92ae7b (patch) | |
| tree | 09608c31044efb9243c4c8854862ad0f8a091d4b /include | |
| parent | 040ab117c79795ff2a13f70c3c3847fa66db7d04 (diff) | |
bootstage: Allow counting memory without strings
The bootstage array includes pointers to strings but not the strings
themselves. The strings are added when stashing, but including them in
the size calculation gives an inflated view of the amount of space used
by the array.
Update this function so it can return the amount of memory used by the
bootstage structures themselves, without the strings which they point
to.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/bootstage.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/bootstage.h b/include/bootstage.h index 57792648c49..3300ca0248a 100644 --- a/include/bootstage.h +++ b/include/bootstage.h @@ -371,9 +371,10 @@ int bootstage_unstash(const void *base, int size); /** * bootstage_get_size() - Get the size of the bootstage data * + * @add_strings: true to add the size of attached strings (for stashing) * Return: size of boostage data in bytes */ -int bootstage_get_size(void); +int bootstage_get_size(bool add_strings); /** * bootstage_init() - Prepare bootstage for use @@ -444,7 +445,7 @@ static inline int bootstage_unstash(const void *base, int size) return 0; /* Pretend to succeed */ } -static inline int bootstage_get_size(void) +static inline int bootstage_get_size(bool add_strings) { return 0; } |
