Changeset a35b458 in mainline for kernel/generic/src/smp/smp_call.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/smp/smp_call.c
r3061bc1 ra35b458 55 55 assert(CPU); 56 56 assert(PREEMPTION_DISABLED || interrupts_disabled()); 57 57 58 58 spinlock_initialize(&CPU->smp_calls_lock, "cpu[].smp_calls_lock"); 59 59 list_initialize(&CPU->smp_pending_calls); … … 133 133 assert(!interrupts_disabled()); 134 134 assert(call_info != NULL); 135 135 136 136 /* Discard invalid calls. */ 137 137 if (config.cpu_count <= cpu_id || !cpus[cpu_id].active) { … … 140 140 return; 141 141 } 142 142 143 143 /* Protect cpu->id against migration. */ 144 144 preemption_disable(); 145 145 146 146 call_start(call_info, func, arg); 147 147 148 148 if (cpu_id != CPU->id) { 149 149 #ifdef CONFIG_SMP … … 169 169 func(arg); 170 170 interrupts_restore(ipl); 171 171 172 172 call_done(call_info); 173 173 } 174 174 175 175 preemption_enable(); 176 176 } … … 209 209 assert(interrupts_disabled()); 210 210 assert(CPU); 211 211 212 212 list_t calls_list; 213 213 list_initialize(&calls_list); 214 214 215 215 /* 216 216 * Acts as a load memory barrier. Any changes made by the cpu that … … 224 224 for (link_t *cur = calls_list.head.next, *next = cur->next; 225 225 !list_empty(&calls_list); cur = next, next = cur->next) { 226 226 227 227 smp_call_t *call_info = list_get_instance(cur, smp_call_t, calls_link); 228 228 list_remove(cur); 229 229 230 230 call_info->func(call_info->arg); 231 231 call_done(call_info); … … 240 240 call_info->func = func; 241 241 call_info->arg = arg; 242 242 243 243 /* 244 244 * We can't use standard spinlocks here because we want to lock … … 247 247 */ 248 248 atomic_set(&call_info->pending, 1); 249 249 250 250 /* Let initialization complete before continuing. */ 251 251 memory_barrier();
Note:
See TracChangeset
for help on using the changeset viewer.