ipc_hash.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Mach Operating System
  3. * Copyright (c) 1991,1990,1989 Carnegie Mellon University
  4. * All Rights Reserved.
  5. *
  6. * Permission to use, copy, modify and distribute this software and its
  7. * documentation is hereby granted, provided that both the copyright
  8. * notice and this permission notice appear in all copies of the
  9. * software, derivative works or modified versions, and any portions
  10. * thereof, and that both notices appear in supporting documentation.
  11. *
  12. * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13. * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14. * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15. *
  16. * Carnegie Mellon requests users of this software to return to
  17. *
  18. * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
  19. * School of Computer Science
  20. * Carnegie Mellon University
  21. * Pittsburgh PA 15213-3890
  22. *
  23. * any improvements or extensions that they make and grant Carnegie Mellon
  24. * the rights to redistribute these changes.
  25. */
  26. /*
  27. * File: ipc/ipc_hash.h
  28. * Author: Rich Draves
  29. * Date: 1989
  30. *
  31. * Declarations of entry hash table operations.
  32. */
  33. #ifndef _IPC_IPC_HASH_H_
  34. #define _IPC_IPC_HASH_H_
  35. #include <mach/boolean.h>
  36. #include <mach/kern_return.h>
  37. typedef natural_t ipc_hash_index_t;
  38. extern void
  39. ipc_hash_init(void);
  40. #if MACH_IPC_DEBUG
  41. extern ipc_hash_index_t
  42. ipc_hash_info(hash_info_bucket_t *, mach_msg_type_number_t);
  43. #endif /* MACH_IPC_DEBUG */
  44. extern boolean_t
  45. ipc_hash_lookup(ipc_space_t space, ipc_object_t obj,
  46. mach_port_t *namep, ipc_entry_t *entryp);
  47. extern void
  48. ipc_hash_insert(ipc_space_t space, ipc_object_t obj,
  49. mach_port_t name, ipc_entry_t entry);
  50. extern void
  51. ipc_hash_delete(ipc_space_t space, ipc_object_t obj,
  52. mach_port_t name, ipc_entry_t entry);
  53. /*
  54. * For use by functions that know what they're doing:
  55. * the global primitives, for splay tree entries,
  56. * and the local primitives, for table entries.
  57. */
  58. #define IPC_HASH_GLOBAL_SIZE 256
  59. extern boolean_t
  60. ipc_hash_global_lookup(ipc_space_t space, ipc_object_t obj,
  61. mach_port_t *namep, ipc_tree_entry_t *entryp);
  62. extern void
  63. ipc_hash_global_insert(ipc_space_t space, ipc_object_t obj,
  64. mach_port_t name, ipc_tree_entry_t entry);
  65. extern void
  66. ipc_hash_global_delete(ipc_space_t space, ipc_object_t obj,
  67. mach_port_t name, ipc_tree_entry_t entry);
  68. extern boolean_t
  69. ipc_hash_local_lookup(ipc_space_t space, ipc_object_t obj,
  70. mach_port_t *namep, ipc_entry_t *entryp);
  71. extern void
  72. ipc_hash_local_insert(ipc_space_t space, ipc_object_t obj,
  73. mach_port_index_t index, ipc_entry_t entry);
  74. extern void
  75. ipc_hash_local_delete(ipc_space_t space, ipc_object_t obj,
  76. mach_port_index_t index, ipc_entry_t entry);
  77. #endif /* _IPC_IPC_HASH_H_ */