Changeset cefb126 in mainline for kernel/generic/src/mm/tlb.c


Ignore:
Timestamp:
2010-07-02T14:19:30Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
89c57b6
Parents:
fe7abd0 (diff), e3ee9b9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/tlb.c

    rfe7abd0 rcefb126  
    7373 * to all other processors.
    7474 *
    75  * This function must be called with interrupts disabled.
    76  *
    77  * @param type Type describing scope of shootdown.
    78  * @param asid Address space, if required by type.
    79  * @param page Virtual page address, if required by type.
     75 * @param type  Type describing scope of shootdown.
     76 * @param asid  Address space, if required by type.
     77 * @param page  Virtual page address, if required by type.
    8078 * @param count Number of pages, if required by type.
    8179 *
     80 * @return The interrupt priority level as it existed prior to this call.
     81 *
    8282 */
    83 void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid,
     83ipl_t tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid,
    8484    uintptr_t page, size_t count)
    8585{
     86        ipl_t ipl = interrupts_disable();
    8687        CPU->tlb_active = false;
    8788        irq_spinlock_lock(&tlblock, false);
     
    8990        size_t i;
    9091        for (i = 0; i < config.cpu_count; i++) {
    91                 cpu_t *cpu;
    92                
    9392                if (i == CPU->id)
    9493                        continue;
    9594               
    96                 cpu = &cpus[i];
     95                cpu_t *cpu = &cpus[i];
     96               
    9797                irq_spinlock_lock(&cpu->lock, false);
    9898                if (cpu->tlb_messages_count == TLB_MESSAGE_QUEUE_LEN) {
     
    122122       
    123123busy_wait:
    124         for (i = 0; i < config.cpu_count; i++)
     124        for (i = 0; i < config.cpu_count; i++) {
    125125                if (cpus[i].tlb_active)
    126126                        goto busy_wait;
     127        }
     128       
     129        return ipl;
    127130}
    128131
    129132/** Finish TLB shootdown sequence.
    130133 *
     134 * @param ipl Previous interrupt priority level.
     135 *
    131136 */
    132 void tlb_shootdown_finalize(void)
     137void tlb_shootdown_finalize(ipl_t ipl)
    133138{
    134139        irq_spinlock_unlock(&tlblock, false);
    135140        CPU->tlb_active = true;
     141        interrupts_restore(ipl);
    136142}
    137143
Note: See TracChangeset for help on using the changeset viewer.