Changeset fc1e4f6 in mainline for genarch/src/mm/page_ht.c


Ignore:
Timestamp:
2006-01-31T00:44:08Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ef67bab
Parents:
6a3c9a7
Message:

Change page_mapping_find/insert interfaces to take as_t * as first argument
and not asid_t as second argument. This change was necessitated by the
removal of mapping array from as_area_t and the fact that an address
space doesn't have an ASID when it is created.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • genarch/src/mm/page_ht.c

    r6a3c9a7 rfc1e4f6  
    3131#include <mm/frame.h>
    3232#include <mm/heap.h>
     33#include <mm/as.h>
    3334#include <arch/mm/asid.h>
    3435#include <arch/types.h>
     
    5354pte_t *page_ht = NULL;
    5455
    55 static void ht_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root);
    56 static pte_t *ht_mapping_find(__address page, asid_t asid, __address root);
     56static void ht_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root);
     57static pte_t *ht_mapping_find(as_t *as, __address page, __address root);
    5758
    5859page_operations_t page_ht_operations = {
     
    6869 * chain.
    6970 *
     71 * @param as Address space to which page belongs. Must be locked prior the call.
    7072 * @param page Virtual address of the page to be mapped.
    71  * @param asid Address space to which page belongs.
    7273 * @param frame Physical address of memory frame to which the mapping is done.
    7374 * @param flags Flags to be used for mapping.
    7475 * @param root Ignored.
    7576 */
    76 void ht_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root)
     77void ht_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root)
    7778{
    7879        pte_t *t, *u;
     
    8182        ipl = interrupts_disable();
    8283        spinlock_lock(&page_ht_lock);
    83        
    84         t = HT_HASH(page, asid);
     84
     85        t = HT_HASH(page, as->asid);
    8586        if (!HT_SLOT_EMPTY(t)) {
    8687       
     
    9293                do {
    9394                        u = t;
    94                         if (HT_COMPARE(page, asid, t)) {
     95                        if (HT_COMPARE(page, as->asid, t)) {
    9596                                /*
    9697                                 * Nothing to do,
     
    110111        }
    111112       
    112         HT_SET_RECORD(t, page, asid, frame, flags);
     113        HT_SET_RECORD(t, page, as->asid, frame, flags);
    113114        HT_SET_NEXT(t, NULL);
    114115       
     
    123124 * Interrupts must be disabled.
    124125 *
     126 * @param as Address space to wich page belongs. Must be locked prior the call.
    125127 * @param page Virtual page.
    126  * @param asid Address space to wich page belongs.
    127128 * @param root Ignored.
    128129 *
    129130 * @return NULL if there is no such mapping; requested mapping otherwise.
    130131 */
    131 pte_t *ht_mapping_find(__address page, asid_t asid, __address root)
     132pte_t *ht_mapping_find(as_t *as, __address page, __address root)
    132133{
    133134        pte_t *t;
    134135       
    135136        spinlock_lock(&page_ht_lock);
    136         t = HT_HASH(page, asid);
     137        t = HT_HASH(page, as->asid);
    137138        if (!HT_SLOT_EMPTY(t)) {
    138                 while (!HT_COMPARE(page, asid, t) && HT_GET_NEXT(t))
     139                while (!HT_COMPARE(page, as->asid, t) && HT_GET_NEXT(t))
    139140                        t = HT_GET_NEXT(t);
    140                 t = HT_COMPARE(page, asid, t) ? t : NULL;
     141                t = HT_COMPARE(page, as->asid, t) ? t : NULL;
    141142        } else {
    142143                t = NULL;
Note: See TracChangeset for help on using the changeset viewer.