Skip to content

Commit 475d279

Browse files
Andrew Boieandrewboie
authored andcommitted
userspace: clarify memory domain assertions
Some text added to help explain what is going on. Signed-off-by: Andrew Boie <[email protected]>
1 parent 8207801 commit 475d279

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

kernel/mem_domain.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ void k_mem_domain_init(struct k_mem_domain *domain, u8_t num_parts,
100100
for (i = 0U; i < num_parts; i++) {
101101
__ASSERT(parts[i] != NULL, "");
102102
__ASSERT((parts[i]->start + parts[i]->size) >
103-
parts[i]->start, "");
103+
parts[i]->start,
104+
"invalid partition %p size %d",
105+
parts[i], parts[i]->size);
104106

105107
#if defined(CONFIG_EXECUTE_XOR_WRITE) || \
106108
defined(CONFIG_MPU_REQUIRES_NON_OVERLAPPING_REGIONS)
@@ -153,7 +155,8 @@ void k_mem_domain_add_partition(struct k_mem_domain *domain,
153155

154156
__ASSERT(domain != NULL, "");
155157
__ASSERT(part != NULL, "");
156-
__ASSERT((part->start + part->size) > part->start, "");
158+
__ASSERT((part->start + part->size) > part->start,
159+
"invalid partition %p size %d", part, part->size);
157160

158161
#if defined(CONFIG_EXECUTE_XOR_WRITE) || \
159162
defined(CONFIG_MPU_REQUIRES_NON_OVERLAPPING_REGIONS)
@@ -208,7 +211,7 @@ void k_mem_domain_remove_partition(struct k_mem_domain *domain,
208211
}
209212

210213
/* Assert if not found */
211-
__ASSERT(p_idx < max_partitions, "");
214+
__ASSERT(p_idx < max_partitions, "no matching partition found");
212215

213216
/* Handle architecture-specific remove
214217
* only if it is the current thread.

0 commit comments

Comments
 (0)