-
Notifications
You must be signed in to change notification settings - Fork 7.5k
userspace: get rid of app section placeholders #13924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
userspace: get rid of app section placeholders #13924
Conversation
2bd1320
to
7875f18
Compare
7875f18
to
de5755d
Compare
Codecov Report
@@ Coverage Diff @@
## master #13924 +/- ##
==========================================
+ Coverage 52.23% 52.33% +0.09%
==========================================
Files 307 307
Lines 45448 45553 +105
Branches 10515 10561 +46
==========================================
+ Hits 23742 23839 +97
- Misses 16912 16914 +2
- Partials 4794 4800 +6
Continue to review full report at Codecov.
|
de5755d
to
ec6a4f3
Compare
@@ -99,9 +99,10 @@ void k_mem_domain_init(struct k_mem_domain *domain, u8_t num_parts, | |||
|
|||
for (i = 0U; i < num_parts; i++) { | |||
__ASSERT(parts[i] != NULL, ""); | |||
__ASSERT((parts[i]->start + parts[i]->size) > | |||
parts[i]->start, ""); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questions, would this ASSERT never happens because the size would be at least 1 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that someone might not want to use the APPMEM partition macros, and just use the k_mem_partition and k_mem_domain directly? And, then, initialize a memory domain in that way? Then we should ASSERT that the size is not zero. Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ioannisg I'm going to get rid of these changes to mem_domain.c in the next version of this patch
The goal of the next version of this patch will be to print a comprehensible error message if a 0-size partition is defined, instead of the mess of linker errors we get if the placeholder is removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this is done now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch looks good. just another question, why just fail with that ASSERT when the partition is empty ?
It seems wrong create partitions that are no used, my guess is that these partitions can be used depending on which build options one is using.
I agree, and will be re-working this a bit. |
No data was ever being put in part2. Signed-off-by: Andrew Boie <[email protected]>
Some text added to help explain what is going on. Signed-off-by: Andrew Boie <[email protected]>
We used to leave byte-long placeholder symbols to ensure that empty application memory sections did not cause build errors that were very difficult to understand. Now we use some relatively portable inline assembly to generate a symbol, but don't take up any extra space. The malloc and libc partitions are now only instantiated if there is some data to put in them. Fixes: zephyrproject-rtos#13923 Signed-off-by: Andrew Boie <[email protected]>
ec6a4f3
to
d48b883
Compare
One failing test traced to #14011 |
We used to leave byte-long placeholder symbols to ensure
that empty application memory sections did not cause
build errors.
Now we use some relatively portable inline assembly to
generate a symbol, but don't take up any extra space.
Adding a zero-sized partition to a domain will now
correctly fail an assertion.
Fixes: #13923
Signed-off-by: Andrew Boie [email protected]