Subversion Repositories HelenOS

Rev

Rev 3606 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3606 Rev 4692
Line 57... Line 57...
57
#define FUTEX_HT_SIZE   1024    /* keep it a power of 2 */
57
#define FUTEX_HT_SIZE   1024    /* keep it a power of 2 */
58
 
58
 
59
static void futex_initialize(futex_t *futex);
59
static void futex_initialize(futex_t *futex);
60
 
60
 
61
static futex_t *futex_find(uintptr_t paddr);
61
static futex_t *futex_find(uintptr_t paddr);
62
static index_t futex_ht_hash(unative_t *key);
62
static size_t futex_ht_hash(unative_t *key);
63
static bool futex_ht_compare(unative_t *key, count_t keys, link_t *item);
63
static bool futex_ht_compare(unative_t *key, size_t keys, link_t *item);
64
static void futex_ht_remove_callback(link_t *item);
64
static void futex_ht_remove_callback(link_t *item);
65
 
65
 
66
/**
66
/**
67
 * Read-write lock protecting global futex hash table.
67
 * Read-write lock protecting global futex hash table.
68
 * It is also used to serialize access to all futex_t structures.
68
 * It is also used to serialize access to all futex_t structures.
Line 286... Line 286...
286
 * @param key Address where the key (i.e. physical address of futex counter) is
286
 * @param key Address where the key (i.e. physical address of futex counter) is
287
 *     stored.
287
 *     stored.
288
 *
288
 *
289
 * @return Index into futex hash table.
289
 * @return Index into futex hash table.
290
 */
290
 */
291
index_t futex_ht_hash(unative_t *key)
291
size_t futex_ht_hash(unative_t *key)
292
{
292
{
293
    return *key & (FUTEX_HT_SIZE-1);
293
    return (*key & (FUTEX_HT_SIZE - 1));
294
}
294
}
295
 
295
 
296
/** Compare futex hash table item with a key.
296
/** Compare futex hash table item with a key.
297
 *
297
 *
298
 * @param key Address where the key (i.e. physical address of futex counter) is
298
 * @param key Address where the key (i.e. physical address of futex counter) is
299
 *     stored.
299
 *     stored.
300
 *
300
 *
301
 * @return True if the item matches the key. False otherwise.
301
 * @return True if the item matches the key. False otherwise.
302
 */
302
 */
303
bool futex_ht_compare(unative_t *key, count_t keys, link_t *item)
303
bool futex_ht_compare(unative_t *key, size_t keys, link_t *item)
304
{
304
{
305
    futex_t *futex;
305
    futex_t *futex;
306
 
306
 
307
    ASSERT(keys == 1);
307
    ASSERT(keys == 1);
308
 
308