ipc_target.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (c) 1994 The University of Utah and
  3. * the Computer Systems Laboratory (CSL). All rights reserved.
  4. *
  5. * Permission to use, copy, modify and distribute this software and its
  6. * documentation is hereby granted, provided that both the copyright
  7. * notice and this permission notice appear in all copies of the
  8. * software, derivative works or modified versions, and any portions
  9. * thereof, and that both notices appear in supporting documentation.
  10. *
  11. * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
  12. * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
  13. * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  14. *
  15. * CSL requests users of this software to return to csl-dist@cs.utah.edu any
  16. * improvements that they make and grant CSL redistribution rights.
  17. */
  18. /*
  19. * File: ipc_target.h
  20. *
  21. * Common part of IPC ports and port sets
  22. * representing a target of messages and migrating RPCs.
  23. */
  24. #ifndef _IPC_IPC_RECEIVER_H_
  25. #define _IPC_IPC_RECEIVER_H_
  26. #include "ipc_mqueue.h"
  27. #include "ipc_object.h"
  28. #include <mach/rpc.h>
  29. typedef struct ipc_target {
  30. struct ipc_object ipt_object;
  31. mach_port_t ipt_name;
  32. struct ipc_mqueue ipt_messages;
  33. #ifdef MIGRATING_THREADS
  34. /*** Migrating RPC stuff ***/
  35. int ipt_type;
  36. /* User entry info for migrating RPC */
  37. rpc_info_t ipt_rpcinfo;
  38. /* List of available activations, all active but not in use. */
  39. struct Act *ipt_acts;
  40. /* TRUE if someone is waiting for an activation from this pool. */
  41. int ipt_waiting;
  42. #endif /* MIGRATING_THREADS */
  43. } *ipc_target_t;
  44. #define IPT_TYPE_MESSAGE_RPC 1
  45. #define IPT_TYPE_MIGRATE_RPC 2
  46. void ipc_target_init(struct ipc_target *ipt, mach_port_t name);
  47. void ipc_target_terminate(struct ipc_target *ipt);
  48. #define ipt_lock(ipt) io_lock(&(ipt)->ipt_object)
  49. #define ipt_unlock(ipt) io_unlock(&(ipt)->ipt_object)
  50. #define ipt_reference(ipt) io_reference(&(ipt)->ipt_object)
  51. #define ipt_release(ipt) io_release(&(ipt)->ipt_object)
  52. #define ipt_check_unlock(ipt) io_check_unlock(&(ipt)->ipt_object)
  53. #endif /* _IPC_IPC_RECEIVER_H_ */