Subversion Repositories HelenOS-historic

Rev

Rev 792 | Rev 823 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 792 Rev 793
Line 65... Line 65...
65
    .hash = hash,
65
    .hash = hash,
66
    .compare = compare,
66
    .compare = compare,
67
    .remove_callback = remove_callback
67
    .remove_callback = remove_callback
68
};
68
};
69
 
69
 
-
 
70
/** Page mapping operations for page hash table architectures. */
70
page_operations_t page_ht_operations = {
71
page_mapping_operations_t ht_mapping_operations = {
71
    .mapping_insert = ht_mapping_insert,
72
    .mapping_insert = ht_mapping_insert,
72
    .mapping_find = ht_mapping_find
73
    .mapping_find = ht_mapping_find
73
};
74
};
74
 
75
 
75
/** Compute page hash table index.
76
/** Compute page hash table index.
Line 117... Line 118...
117
    ASSERT((keys > 0) && (keys <= PAGE_HT_KEYS));
118
    ASSERT((keys > 0) && (keys <= PAGE_HT_KEYS));
118
 
119
 
119
    /*
120
    /*
120
     * Convert item to PTE.
121
     * Convert item to PTE.
121
     */
122
     */
122
    t = list_get_instance(item, pte_t, link);
123
    t = hash_table_get_instance(item, pte_t, link);
123
 
124
 
124
    if (keys == PAGE_HT_KEYS) {
125
    if (keys == PAGE_HT_KEYS) {
125
        return (key[KEY_AS] == (__address) t->as) && (key[KEY_PAGE] == t->page);
126
        return (key[KEY_AS] == (__address) t->as) && (key[KEY_PAGE] == t->page);
126
    } else {
127
    } else {
127
        return (key[KEY_AS] == (__address) t->as);
128
        return (key[KEY_AS] == (__address) t->as);
Line 139... Line 140...
139
    ASSERT(item);
140
    ASSERT(item);
140
 
141
 
141
    /*
142
    /*
142
     * Convert item to PTE.
143
     * Convert item to PTE.
143
     */
144
     */
144
    t = list_get_instance(item, pte_t, link);
145
    t = hash_table_get_instance(item, pte_t, link);
145
 
146
 
146
    free(t);
147
    free(t);
147
}
148
}
148
 
149
 
149
/** Map page to frame using page hash table.
150
/** Map page to frame using page hash table.
Line 197... Line 198...
197
   
198
   
198
    spinlock_lock(&page_ht_lock);
199
    spinlock_lock(&page_ht_lock);
199
 
200
 
200
    hlp = hash_table_find(&page_ht, key);
201
    hlp = hash_table_find(&page_ht, key);
201
    if (hlp)
202
    if (hlp)
202
        t = list_get_instance(hlp, pte_t, link);
203
        t = hash_table_get_instance(hlp, pte_t, link);
203
 
204
 
204
    spinlock_unlock(&page_ht_lock);
205
    spinlock_unlock(&page_ht_lock);
205
    return t;
206
    return t;
206
}
207
}