Changeset d70fc74 in mainline for kernel/generic/src/smp/smp_call.c
- Timestamp:
- 2012-07-06T12:58:58Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ef1603b
- Parents:
- 1f8c11f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/smp/smp_call.c
r1f8c11f rd70fc74 54 54 * 55 55 * If @a cpu_id is the local CPU, the function will be invoked 56 * directly. 56 * directly. If the destination cpu id @a cpu_id is invalid 57 * or denotes an inactive cpu, the call is discarded immediately. 57 58 * 58 59 * Interrupts must be enabled. Otherwise you run the risk 59 60 * of a deadlock. 60 61 * 61 * @param cpu_id Destination CPU's logical id (eg CPU->id) 62 * @param cpu_id Destination CPU's logical id (eg CPU->id). 62 63 * @param func Function to call. 63 64 * @param arg Argument to pass to the user supplied function @a func. … … 73 74 74 75 /* Discard invalid calls. */ 75 if (config.cpu_count <= cpu_id ) {76 if (config.cpu_count <= cpu_id || !cpus[cpu_id].active) { 76 77 call_start(call_info, func, arg); 77 78 call_done(call_info); … … 81 82 /* Protect cpu->id against migration. */ 82 83 preemption_disable(); 83 84 84 85 call_start(call_info, func, arg); 85 86 … … 89 90 list_append(&call_info->calls_link, &cpus[cpu_id].smp_pending_calls); 90 91 spinlock_unlock(&cpus[cpu_id].smp_calls_lock); 91 92 93 /* 94 * If a platform supports SMP it must implement arch_smp_call_ipi(). 95 * It should issue an IPI an cpu_id and invoke smp_call_ipi_recv() 96 * on cpu_id in turn. 97 * 98 * Do not implement as just an empty dummy function. Instead 99 * consider providing a full implementation or at least a version 100 * that panics if invoked. Note that smp_call_async() never 101 * calls arch_smp_call_ipi() on uniprocessors even if CONFIG_SMP. 102 */ 92 103 arch_smp_call_ipi(cpu_id); 93 104 #endif … … 131 142 /** Architecture independent smp call IPI handler. 132 143 * 133 * Interrupts must be disabled. 144 * Interrupts must be disabled. Tolerates spurious calls. 134 145 */ 135 146 void smp_call_ipi_recv(void)
Note:
See TracChangeset
for help on using the changeset viewer.