ipc_kobject.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * Mach Operating System
  3. * Copyright (c) 1991,1990,1989 Carnegie Mellon University.
  4. * Copyright (c) 1993,1994 The University of Utah and
  5. * the Computer Systems Laboratory (CSL).
  6. * All rights reserved.
  7. *
  8. * Permission to use, copy, modify and distribute this software and its
  9. * documentation is hereby granted, provided that both the copyright
  10. * notice and this permission notice appear in all copies of the
  11. * software, derivative works or modified versions, and any portions
  12. * thereof, and that both notices appear in supporting documentation.
  13. *
  14. * CARNEGIE MELLON, THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF
  15. * THIS SOFTWARE IN ITS "AS IS" CONDITION, AND DISCLAIM ANY LIABILITY
  16. * OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF
  17. * THIS SOFTWARE.
  18. *
  19. * Carnegie Mellon requests users of this software to return to
  20. *
  21. * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
  22. * School of Computer Science
  23. * Carnegie Mellon University
  24. * Pittsburgh PA 15213-3890
  25. *
  26. * any improvements or extensions that they make and grant Carnegie Mellon
  27. * the rights to redistribute these changes.
  28. */
  29. /*
  30. */
  31. /*
  32. * File: kern/ipc_kobject.h
  33. * Author: Rich Draves
  34. * Date: 1989
  35. *
  36. * Declarations for letting a port represent a kernel object.
  37. */
  38. #ifndef _KERN_IPC_KOBJECT_H_
  39. #define _KERN_IPC_KOBJECT_H_
  40. #include <mach/machine/vm_types.h>
  41. #include <ipc/ipc_types.h>
  42. #include <ipc/ipc_kmsg.h>
  43. typedef vm_offset_t ipc_kobject_t;
  44. #define IKO_NULL ((ipc_kobject_t) 0)
  45. typedef unsigned int ipc_kobject_type_t;
  46. #define IKOT_NONE 0
  47. #define IKOT_THREAD 1
  48. #define IKOT_TASK 2
  49. #define IKOT_HOST 3
  50. #define IKOT_HOST_PRIV 4
  51. #define IKOT_PROCESSOR 5
  52. #define IKOT_PSET 6
  53. #define IKOT_PSET_NAME 7
  54. #define IKOT_PAGER 8
  55. #define IKOT_PAGING_REQUEST 9
  56. #define IKOT_DEVICE 10
  57. #define IKOT_XMM_OBJECT 11
  58. #define IKOT_XMM_PAGER 12
  59. #define IKOT_XMM_KERNEL 13
  60. #define IKOT_XMM_REPLY 14
  61. #define IKOT_PAGER_TERMINATING 15
  62. #define IKOT_PAGING_NAME 16
  63. #define IKOT_HOST_SECURITY 17
  64. #define IKOT_LEDGER 18
  65. #define IKOT_MASTER_DEVICE 19
  66. #define IKOT_ACT 20
  67. #define IKOT_SUBSYSTEM 21
  68. #define IKOT_IO_DONE_QUEUE 22
  69. #define IKOT_SEMAPHORE 23
  70. #define IKOT_LOCK_SET 24
  71. #define IKOT_CLOCK 25
  72. #define IKOT_CLOCK_CTRL 26
  73. #define IKOT_PAGER_PROXY 27
  74. /* << new entries here */
  75. #define IKOT_UNKNOWN 28 /* magic catchall */
  76. #define IKOT_MAX_TYPE 29 /* # of IKOT_ types */
  77. /* Please keep ipc/ipc_object.c:ikot_print_array up to date */
  78. #define is_ipc_kobject(ikot) (ikot != IKOT_NONE)
  79. /*
  80. * Define types of kernel objects that use page lists instead
  81. * of entry lists for copyin of out of line memory.
  82. */
  83. #define ipc_kobject_vm_page_list(ikot) \
  84. ((ikot == IKOT_PAGING_REQUEST) || (ikot == IKOT_DEVICE))
  85. #define ipc_kobject_vm_page_steal(ikot) (ikot == IKOT_PAGING_REQUEST)
  86. /* Initialize kernel server dispatch table */
  87. /* XXX
  88. extern void mig_init(void);
  89. */
  90. /* Dispatch a kernel server function */
  91. extern ipc_kmsg_t ipc_kobject_server(
  92. ipc_kmsg_t request);
  93. /* Make a port represent a kernel object of the given type */
  94. extern void ipc_kobject_set(
  95. ipc_port_t port,
  96. ipc_kobject_t kobject,
  97. ipc_kobject_type_t type);
  98. /* Release any kernel object resources associated with a port */
  99. extern void ipc_kobject_destroy(
  100. ipc_port_t port);
  101. /* Deliver notifications to kobjects that care about them */
  102. extern boolean_t ipc_kobject_notify (
  103. mach_msg_header_t *request_header,
  104. mach_msg_header_t *reply_header);
  105. #define null_conversion(port) (port)
  106. #endif /* _KERN_IPC_KOBJECT_H_ */