Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 791 → Rev 792

/kernel/trunk/generic/include/adt/hash_table.h
29,9 → 29,9
#ifndef __HASH_TABLE_H__
#define __HASH_TABLE_H__
 
#include <adt/list.h>
#include <arch/types.h>
#include <typedefs.h>
#include <adt/list.h>
 
/** Hash table structure. */
struct hash_table {
53,7 → 53,7
/** Hash table item comparison function.
*
* @param key Array of keys that will be compared against item. It is not necessary to pass all keys.
* @param key Array of keys that will be compared with item. It is not necessary to pass all keys.
*
* @return true if the keys match, false otherwise.
*/
66,10 → 66,10
void (*remove_callback)(link_t *item);
};
 
#define hash_table_get_instance(item, type, member) list_get_instance((item), (type), (member))
#define hash_table_get_instance(item,type,member) list_get_instance((item),(type),(member))
 
extern void hash_table_create(hash_table_t *h, count_t m, count_t max_keys, hash_table_operations_t *op);
extern bool hash_table_insert(hash_table_t *h, __native key[], link_t *item);
extern void hash_table_insert(hash_table_t *h, __native key[], link_t *item);
extern link_t *hash_table_find(hash_table_t *h, __native key[]);
extern void hash_table_remove(hash_table_t *h, __native key[], count_t keys);
 
/kernel/trunk/generic/src/adt/hash_table.c
67,10 → 67,8
* @param h Hash table.
* @param hey Array of all keys necessary to compute hash index.
* @param item Item to be inserted into the hash table.
*
* @return true on success, false if the keys were already present in the hash table.
*/
bool hash_table_insert(hash_table_t *h, __native key[], link_t *item)
void hash_table_insert(hash_table_t *h, __native key[], link_t *item)
{
index_t chain;
 
80,16 → 78,7
chain = h->op->hash(key);
ASSERT(chain < h->entries);
if (hash_table_find(h, key)) {
/*
* The hash table is not redundant.
* Signal failure on return.
*/
return false;
}
list_append(item, &h->entry[chain]);
return true;
}
 
/** Search hash table for an item matching keys.
/kernel/trunk/generic/src/mm/as.c
281,7 → 281,6
ipl = interrupts_disable();
spinlock_lock(&as->lock);
ASSERT(as->page_table);
SET_PTL0_ADDRESS(as->page_table);
spinlock_unlock(&as->lock);
interrupts_restore(ipl);