File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 12
12
13
13
static u8_t max_partitions ;
14
14
15
-
16
15
void k_mem_domain_init (struct k_mem_domain * domain , u32_t num_parts ,
17
16
struct k_mem_partition * parts [])
18
17
{
@@ -49,6 +48,11 @@ void k_mem_domain_destroy(struct k_mem_domain *domain)
49
48
50
49
key = irq_lock ();
51
50
51
+ /* Handle architecture specifc destroy only if it is the current thread*/
52
+ if (_current -> mem_domain_info .mem_domain == domain ) {
53
+ _arch_mem_domain_destroy (domain );
54
+ }
55
+
52
56
SYS_DLIST_FOR_EACH_NODE_SAFE (& domain -> mem_domain_q , node , next_node ) {
53
57
struct k_thread * thread =
54
58
CONTAINER_OF (node , struct k_thread , mem_domain_info );
@@ -111,6 +115,11 @@ void k_mem_domain_remove_partition(struct k_mem_domain *domain,
111
115
/* Assert if not found */
112
116
__ASSERT (p_idx < max_partitions , "" );
113
117
118
+ /* Handle architecture specifc remove only if it is the current thread*/
119
+ if (_current -> mem_domain_info .mem_domain == domain ) {
120
+ _arch_mem_domain_remove_partition (domain , p_idx );
121
+ }
122
+
114
123
domain -> partitions [p_idx ].start = 0 ;
115
124
domain -> partitions [p_idx ].size = 0 ;
116
125
domain -> partitions [p_idx ].attr = 0 ;
You can’t perform that action at this time.
0 commit comments