Changeset c7ec94a4 in mainline for generic


Ignore:
Timestamp:
2006-02-06T14:18:28Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f5935ed
Parents:
214f5bb
Message:

Page hash table architectures now use generic hash table to manage
mappings.

Location:
generic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • generic/include/adt/hash_table.h

    r214f5bb rc7ec94a4  
    3030#define __HASH_TABLE_H__
    3131
     32#include <adt/list.h>
    3233#include <arch/types.h>
    3334#include <typedefs.h>
    34 #include <adt/list.h>
    3535
    3636/** Hash table structure. */
     
    5454        /** Hash table item comparison function.
    5555         *
    56          * @param key Array of keys that will be compared against item. It is not necessary to pass all keys.
     56         * @param key Array of keys that will be compared with item. It is not necessary to pass all keys.
    5757         *
    5858         * @return true if the keys match, false otherwise.
     
    6767};
    6868
    69 #define hash_table_get_instance(item, type, member)     list_get_instance((item), (type), (member))
     69#define hash_table_get_instance(item,type,member)       list_get_instance((item),(type),(member))
    7070
    7171extern void hash_table_create(hash_table_t *h, count_t m, count_t max_keys, hash_table_operations_t *op);
    72 extern bool hash_table_insert(hash_table_t *h, __native key[], link_t *item);
     72extern void hash_table_insert(hash_table_t *h, __native key[], link_t *item);
    7373extern link_t *hash_table_find(hash_table_t *h, __native key[]);
    7474extern void hash_table_remove(hash_table_t *h, __native key[], count_t keys);
  • generic/src/adt/hash_table.c

    r214f5bb rc7ec94a4  
    6868 * @param hey Array of all keys necessary to compute hash index.
    6969 * @param item Item to be inserted into the hash table.
    70  *
    71  * @return true on success, false if the keys were already present in the hash table.
    7270 */
    73 bool hash_table_insert(hash_table_t *h, __native key[], link_t *item)
     71void hash_table_insert(hash_table_t *h, __native key[], link_t *item)
    7472{
    7573        index_t chain;
     
    8179        ASSERT(chain < h->entries);
    8280       
    83         if (hash_table_find(h, key)) {
    84                 /*
    85                  * The hash table is not redundant.
    86                  * Signal failure on return.
    87                  */
    88                 return false;
    89         }
    90        
    9181        list_append(item, &h->entry[chain]);
    92         return true;
    9382}
    9483
  • generic/src/mm/as.c

    r214f5bb rc7ec94a4  
    282282        ipl = interrupts_disable();
    283283        spinlock_lock(&as->lock);
    284         ASSERT(as->page_table);
    285284        SET_PTL0_ADDRESS(as->page_table);
    286285        spinlock_unlock(&as->lock);
Note: See TracChangeset for help on using the changeset viewer.