Changeset 7f1c620 in mainline for genarch/src/mm/page_ht.c


Ignore:
Timestamp:
2006-07-04T17:17:56Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ffa3ef5
Parents:
991779c5
Message:

Replace old u?? types with respective C99 variants (e.g. uint32_t, int64_t, uintptr_t etc.).

File:
1 edited

Legend:

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

    r991779c5 r7f1c620  
    5353#include <align.h>
    5454
    55 static index_t hash(__native key[]);
    56 static bool compare(__native key[], count_t keys, link_t *item);
     55static index_t hash(unative_t key[]);
     56static bool compare(unative_t key[], count_t keys, link_t *item);
    5757static void remove_callback(link_t *item);
    5858
    59 static void ht_mapping_insert(as_t *as, __address page, __address frame, int flags);
    60 static void ht_mapping_remove(as_t *as, __address page);
    61 static pte_t *ht_mapping_find(as_t *as, __address page);
     59static void ht_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags);
     60static void ht_mapping_remove(as_t *as, uintptr_t page);
     61static pte_t *ht_mapping_find(as_t *as, uintptr_t page);
    6262
    6363/**
     
    9494 * @return Index into page hash table.
    9595 */
    96 index_t hash(__native key[])
     96index_t hash(unative_t key[])
    9797{
    9898        as_t *as = (as_t *) key[KEY_AS];
    99         __address page = (__address) key[KEY_PAGE];
     99        uintptr_t page = (uintptr_t) key[KEY_PAGE];
    100100        index_t index;
    101101       
     
    112112         * hash index.
    113113         */
    114         index |= ((__native) as) & (PAGE_HT_ENTRIES-1);
     114        index |= ((unative_t) as) & (PAGE_HT_ENTRIES-1);
    115115       
    116116        return index;
     
    125125 * @return true on match, false otherwise.
    126126 */
    127 bool compare(__native key[], count_t keys, link_t *item)
     127bool compare(unative_t key[], count_t keys, link_t *item)
    128128{
    129129        pte_t *t;
     
    138138
    139139        if (keys == PAGE_HT_KEYS) {
    140                 return (key[KEY_AS] == (__address) t->as) && (key[KEY_PAGE] == t->page);
     140                return (key[KEY_AS] == (uintptr_t) t->as) && (key[KEY_PAGE] == t->page);
    141141        } else {
    142                 return (key[KEY_AS] == (__address) t->as);
     142                return (key[KEY_AS] == (uintptr_t) t->as);
    143143        }
    144144}
     
    174174 * @param flags Flags to be used for mapping.
    175175 */
    176 void ht_mapping_insert(as_t *as, __address page, __address frame, int flags)
     176void ht_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags)
    177177{
    178178        pte_t *t;
    179         __native key[2] = { (__address) as, page = ALIGN_DOWN(page, PAGE_SIZE) };
     179        unative_t key[2] = { (uintptr_t) as, page = ALIGN_DOWN(page, PAGE_SIZE) };
    180180       
    181181        if (!hash_table_find(&page_ht, key)) {
     
    209209 * @param page Virtual address of the page to be demapped.
    210210 */
    211 void ht_mapping_remove(as_t *as, __address page)
    212 {
    213         __native key[2] = { (__address) as, page = ALIGN_DOWN(page, PAGE_SIZE) };
     211void ht_mapping_remove(as_t *as, uintptr_t page)
     212{
     213        unative_t key[2] = { (uintptr_t) as, page = ALIGN_DOWN(page, PAGE_SIZE) };
    214214       
    215215        /*
     
    232232 * @return NULL if there is no such mapping; requested mapping otherwise.
    233233 */
    234 pte_t *ht_mapping_find(as_t *as, __address page)
     234pte_t *ht_mapping_find(as_t *as, uintptr_t page)
    235235{
    236236        link_t *hlp;
    237237        pte_t *t = NULL;
    238         __native key[2] = { (__address) as, page = ALIGN_DOWN(page, PAGE_SIZE) };
     238        unative_t key[2] = { (uintptr_t) as, page = ALIGN_DOWN(page, PAGE_SIZE) };
    239239       
    240240        hlp = hash_table_find(&page_ht, key);
Note: See TracChangeset for help on using the changeset viewer.