Changeset 25969ac in mainline


Ignore:
Timestamp:
2012-11-17T00:00:28Z (12 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
089c23d
Parents:
853d613
Message:

smp_call: Comments clarifying memory semantics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/smp/smp_call.c

    r853d613 r25969ac  
    6969 * directly.
    7070 *
     71 * All memory accesses of prior to smp_call() will be visible
     72 * to @a func on cpu @a cpu_id. Similarly, any changes @a func
     73 * makes on cpu @a cpu_id will be visible on this cpu once
     74 * smp_call() returns.
     75 *
     76 * Invoking @a func on the destination cpu acts as a memory barrier
     77 * on that cpu.
     78 *
    7179 * @param cpu_id Destination CPU's logical id (eg CPU->id)
    7280 * @param func Function to call.
     
    8997 * @a func to complete.
    9098 *
    91  * @a call_info must be valid until @a func returns.
     99 * @a call_info must be valid until/after @a func returns. Use
     100 * smp_call_wait() to wait until it is safe to free @a call_info.
    92101 *
    93102 * If @a cpu_id is the local CPU, the function will be invoked
    94103 * directly. If the destination cpu id @a cpu_id is invalid
    95104 * or denotes an inactive cpu, the call is discarded immediately.
     105 *
     106 * All memory accesses of the caller prior to smp_call_async()
     107 * will be made visible to @a func on the other cpu. Similarly,
     108 * any changes @a func makes on cpu @a cpu_id will be visible
     109 * to this cpu when smp_call_wait() returns.
     110 *
     111 * Invoking @a func on the destination cpu acts as a memory barrier
     112 * on that cpu.
    96113 *
    97114 * Interrupts must be enabled. Otherwise you run the risk
     
    196213        list_initialize(&calls_list);
    197214       
     215        /*
     216         * Acts as a load memory barrier. Any changes made by the cpu that
     217         * added the smp_call to calls_list will be made visible to this cpu.
     218         */
    198219        spinlock_lock(&CPU->smp_calls_lock);
    199220        list_concat(&calls_list, &CPU->smp_pending_calls);
Note: See TracChangeset for help on using the changeset viewer.