Changeset cc205f1 in mainline for arch/mips32/src/mm/asid.c


Ignore:
Timestamp:
2005-10-06T12:45:22Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fd3c9e5
Parents:
bca1b47
Message:

Add mm/mapping1 test.
(Will not make it past TLB Invalid exception on mips32.)
Fixes in asid.c.
Make TLB register types union with u32 value.
Implement tlb_invalidate() for mips32.
(TLB invalidation and shootdown path will have to be revised.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/mips32/src/mm/asid.c

    rbca1b47 rcc205f1  
    11/*
    22 * Copyright (C) 2005 Martin Decky
     3 * Copyright (C) 2005 Jakub Jermar
    34 * All rights reserved.
    45 *
     
    3132#include <arch.h>
    3233#include <debug.h>
    33 
    34 #define ASIDS   256
     34#include <typedefs.h>
    3535
    3636static spinlock_t asid_usage_lock;
     
    5454        spinlock_lock(&asid_usage_lock);
    5555       
    56         for (i=0, j = 0; (i<ASIDS); i++) {
     56        for (i = ASID_START, j = ASID_START; i < ASIDS; i++) {
    5757                if (asid_usage[i] < min) {
    5858                        j = i;
     
    6363        }
    6464
    65         asid_usage[i]++;
     65        asid_usage[j]++;
    6666
    6767        spinlock_unlock(&asid_usage_lock);
     
    8484        spinlock_lock(&asid_usage_lock);
    8585
     86        ASSERT(asid != ASID_INVALID);
     87       
    8688        ASSERT(asid_usage[asid] > 0);
    8789        asid_usage[asid]--;
     
    9092        cpu_priority_restore(pri);
    9193}
     94
     95/** Find out whether ASID is used by more address spaces
     96 *
     97 * Find out whether ASID is used by more address spaces.
     98 *
     99 * @param asid ASID in question.
     100 *
     101 * @return True if 'asid' is used by more address spaces, false otherwise.
     102 */
     103bool asid_has_conflicts(asid_t asid)
     104{
     105        bool has_conflicts = false;
     106        pri_t pri;
     107
     108        ASSERT(asid != ASID_INVALID);
     109
     110        pri = cpu_priority_high();
     111        spinlock_lock(&asid_usage_lock);
     112
     113        if (asid_usage[asid] > 1)
     114                has_conflicts = true;
     115
     116        spinlock_unlock(&asid_usage_lock);
     117        cpu_priority_restore(pri);
     118
     119        return has_conflicts;
     120}
Note: See TracChangeset for help on using the changeset viewer.