Lines Matching refs:key

173  * entries so they can be rapidly accessed by their key values.
176 #define HASH_KEY(key) ((((key) >> 24) ^ ((key) >> 16) ^ ((key) >> 9) ^\
177 (key)) & (HASHTBL_SIZE - 1));
221 static mboxsc_mbox_t *mboxsc_hashfind_mailbox_by_key(uint32_t key);
222 static mboxsc_mbox_t *mboxsc_hashremove_mailbox_by_key(uint32_t key);
227 static int mboxsc_timed_read(clock_t deadline, uint32_t key,
229 static int mboxsc_timed_write(clock_t deadline, uint32_t key,
231 static int mboxsc_timed_get_flag(clock_t deadline, uint32_t key,
233 static int mboxsc_timed_set_flag(clock_t deadline, uint32_t key,
236 static int mboxsc_expire_message(uint32_t key, int *resultp);
391 mboxsc_init(uint32_t key, int direction, void (*event_handler)(void))
397 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%x\n", key);
420 mailboxp->mbox_key = key;
445 * Closes the mailbox with the indicated key, if it exists.
448 mboxsc_fini(uint32_t key)
454 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%x\n", key);
460 mailboxp = mboxsc_hashfind_mailbox_by_key(key);
483 mboxsc_putmsg(uint32_t key, uint32_t type, uint32_t cmd, uint64_t *transidp,
500 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%x\n", key);
553 mailboxp = mboxsc_hashfind_mailbox_by_key(key);
647 error = mboxsc_timed_write(deadline, key, MBOXSC_MSGHDR_OFFSET,
651 error = mboxsc_timed_write(deadline, key, MBOXSC_DATA_OFFSET,
656 error = mboxsc_timed_write(deadline, key, header.msg_length,
676 error = mboxsc_timed_set_flag(deadline, key, IOSRAM_DATA_VALID,
724 error = iosram_get_flag(key, &data_valid, NULL);
753 error = mboxsc_expire_message(key, &result);
787 * Attempt to retrieve a message from the mailbox with the given key that
795 mboxsc_getmsg(uint32_t key, uint32_t *typep, uint32_t *cmdp, uint64_t *transidp,
812 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%x\n", key);
860 mailboxp = mboxsc_hashfind_mailbox_by_key(key);
947 error = iosram_get_flag(key, &data_valid, NULL);
995 error = mboxsc_timed_read(deadline, key, MBOXSC_DATA_OFFSET,
1000 error = mboxsc_timed_read(deadline, key, header.msg_length,
1076 error = mboxsc_timed_get_flag(deadline, key, &data_valid, NULL);
1080 error = mboxsc_timed_read(deadline, key,
1153 error = mboxsc_timed_set_flag(deadline, key, IOSRAM_DATA_INVALID,
1207 mboxsc_ctrl(uint32_t key, uint32_t cmd, void *arg)
1213 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%x\n", key);
1218 mailboxp = mboxsc_hashfind_mailbox_by_key(key);
1338 uint32_t key = (uint32_t)(uintptr_t)arg;
1342 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "arg = 0x%x\n", key);
1345 mailboxp = mboxsc_hashfind_mailbox_by_key(key);
1360 error = iosram_rd(key, MBOXSC_MSGHDR_OFFSET, MBOXSC_MSGHDR_SIZE,
1385 error = iosram_get_flag(key, &data_valid, NULL);
1454 * If no other mailbox exists with the same key as this mailbox, attempt to
1464 uint32_t key = mailboxp->mbox_key;
1477 if (mboxsc_hashfind_mailbox_by_key(key) != NULL) {
1489 error = iosram_ctrl(key, IOSRAM_CMD_CHUNKLEN, &(mailboxp->mbox_length));
1496 error = iosram_register(key, mboxsc_iosram_callback,
1497 (void *)(uintptr_t)(key));
1534 uint32_t key = mailboxp->mbox_key;
1548 error = iosram_unregister(key);
1550 DPRINTF1(DBG_DEV, DBGACT_DEFAULT, "invalid key (0x%08x)"
1551 " reported in mboxsc_close_mailbox.\n", key);
1559 (void) mboxsc_hashremove_mailbox_by_key(key);
1601 * Locate a mailbox with the given key in the hash table. Return a pointer
1606 mboxsc_hashfind_mailbox_by_key(uint32_t key)
1613 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%x\n", key);
1620 hash = HASH_KEY(key);
1623 if (mailboxp->mbox_key == key) {
1637 * Locate a mailbox with the given key in the hash table. If it exists,
1643 mboxsc_hashremove_mailbox_by_key(uint32_t key)
1651 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%x\n", key);
1658 hash = HASH_KEY(key);
1662 if (mailboxp->mbox_key == key) {
1914 mboxsc_timed_read(clock_t deadline, uint32_t key, uint32_t off, uint32_t len,
1921 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%x\n", key);
1927 error = iosram_rd(key, off, len, dptr);
1946 mboxsc_timed_write(clock_t deadline, uint32_t key, uint32_t off, uint32_t len,
1953 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%x\n", key);
1959 error = iosram_wr(key, off, len, dptr);
1978 mboxsc_timed_get_flag(clock_t deadline, uint32_t key, uint8_t *data_validp,
1985 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%x\n", key);
1992 error = iosram_get_flag(key, data_validp, int_pendingp);
2011 mboxsc_timed_set_flag(clock_t deadline, uint32_t key, uint8_t data_valid,
2018 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%x\n", key);
2023 error = iosram_set_flag(key, data_valid, int_pending);
2074 mboxsc_expire_message(uint32_t key, int *resultp)
2083 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%x\n", key);
2104 error = iosram_get_flag(key, &data_valid, NULL);
2126 error = iosram_set_flag(key,
2291 static int print_mailbox_by_key(uint32_t key);
2388 " key: 0x%08x, dir: %d\n", mailboxp->mbox_key,
2399 print_mailbox_by_key(uint32_t key)
2405 DPRINTF1(DBG_ARGS, DBGACT_DEFAULT, "key = 0x%08x\n", key);
2409 mailboxp = mboxsc_hashfind_mailbox_by_key(key);
2415 "print_mailbox_by_key: no such mbox 0x%08x\n", key);
2435 "key = 0x%08x, dir = %d, callback = %p\n",
2439 DPRINTF2(DBG_DEV, DBGACT_DEFAULT, "key = 0x%08x, dir = %d\n",