ipc_lck.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. * Copyright (c) 2002-2005 MontaVista Software, Inc.
  3. *
  4. * All rights reserved.
  5. *
  6. * Author: Steven Dake (sdake@mvista.com)
  7. *
  8. * This software licensed under BSD license, the text of which follows:
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions are met:
  12. *
  13. * - Redistributions of source code must retain the above copyright notice,
  14. * this list of conditions and the following disclaimer.
  15. * - Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. * - Neither the name of the MontaVista Software, Inc. nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  26. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  27. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  28. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  29. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  30. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  31. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  32. * THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #ifndef IPC_LCK_H_DEFINED
  35. #define IPC_LCK_H_DEFINED
  36. #include "saAis.h"
  37. #include "saLck.h"
  38. #include "ipc_gen.h"
  39. enum req_lib_lck_resource_types {
  40. MESSAGE_REQ_LCK_RESOURCEOPEN = 0,
  41. MESSAGE_REQ_LCK_RESOURCEOPENASYNC = 1,
  42. MESSAGE_REQ_LCK_RESOURCECLOSE = 2,
  43. MESSAGE_REQ_LCK_RESOURCELOCK = 3,
  44. MESSAGE_REQ_LCK_RESOURCELOCKASYNC = 4,
  45. MESSAGE_REQ_LCK_RESOURCEUNLOCK = 5,
  46. MESSAGE_REQ_LCK_RESOURCEUNLOCKASYNC = 6,
  47. MESSAGE_REQ_LCK_LOCKPURGE = 7,
  48. };
  49. enum res_lib_lck_resource_types {
  50. MESSAGE_RES_LCK_RESOURCEOPEN = 0,
  51. MESSAGE_RES_LCK_RESOURCEOPENASYNC = 1,
  52. MESSAGE_RES_LCK_RESOURCECLOSE = 2,
  53. MESSAGE_RES_LCK_RESOURCELOCK = 3,
  54. MESSAGE_RES_LCK_RESOURCELOCKASYNC = 4,
  55. MESSAGE_RES_LCK_RESOURCEUNLOCK = 5,
  56. MESSAGE_RES_LCK_RESOURCEUNLOCKASYNC = 6,
  57. MESSAGE_RES_LCK_LOCKPURGE = 7,
  58. MESSAGE_RES_LCK_LOCKWAITERCALLBACK = 8
  59. };
  60. struct req_lib_lck_resourceopen {
  61. struct req_header header;
  62. SaInvocationT invocation;
  63. SaNameT lockResourceName;
  64. SaLckResourceOpenFlagsT resourceOpenFlags;
  65. SaLckResourceHandleT resourceHandle;
  66. SaTimeT timeout;
  67. int async_call;
  68. };
  69. struct res_lib_lck_resourceopen {
  70. struct res_header header;
  71. SaLckResourceHandleT resourceHandle;
  72. struct message_source source;
  73. };
  74. struct res_lib_lck_resourceopenasync {
  75. struct res_header header;
  76. SaInvocationT invocation;
  77. SaLckResourceHandleT resourceHandle;
  78. struct message_source source;
  79. };
  80. struct req_lib_lck_resourceclose {
  81. struct req_header header;
  82. SaNameT lockResourceName;
  83. SaLckResourceHandleT resourceHandle;
  84. };
  85. struct res_lib_lck_resourceclose {
  86. struct res_header header;
  87. };
  88. struct req_lib_lck_resourcelock {
  89. struct req_header header;
  90. SaNameT lockResourceName;
  91. SaInvocationT invocation;
  92. SaLckLockModeT lockMode;
  93. SaLckLockFlagsT lockFlags;
  94. SaLckWaiterSignalT waiterSignal;
  95. SaTimeT timeout;
  96. SaLckLockIdT lockId;
  97. int async_call;
  98. struct message_source source;
  99. SaLckResourceHandleT resourceHandle;
  100. };
  101. struct res_lib_lck_resourcelock {
  102. struct res_header header;
  103. SaLckLockStatusT lockStatus;
  104. void *resource_lock;
  105. };
  106. struct res_lib_lck_resourcelockasync {
  107. struct res_header header;
  108. SaLckLockStatusT lockStatus;
  109. SaLckLockIdT lockId;
  110. void *resource_lock;
  111. SaInvocationT invocation;
  112. SaLckResourceHandleT resourceHandle;
  113. };
  114. struct req_lib_lck_resourceunlock {
  115. struct req_header header;
  116. SaNameT lockResourceName;
  117. SaLckLockIdT lockId;
  118. SaInvocationT invocation;
  119. SaTimeT timeout;
  120. int async_call;
  121. void *resource_lock;
  122. };
  123. struct res_lib_lck_resourceunlock {
  124. struct res_header header;
  125. };
  126. struct res_lib_lck_resourceunlockasync {
  127. struct res_header header;
  128. SaInvocationT invocation;
  129. };
  130. struct req_lib_lck_lockpurge {
  131. struct req_header header;
  132. SaNameT lockResourceName;
  133. };
  134. struct res_lib_lck_lockpurge {
  135. struct res_header header;
  136. };
  137. struct res_lib_lck_lockwaitercallback {
  138. struct res_header header;
  139. SaLckWaiterSignalT waiter_signal;
  140. SaLckLockIdT lock_id;
  141. SaLckLockModeT mode_held;
  142. SaLckLockModeT mode_requested;
  143. };
  144. #endif /* IPC_LCK_H_DEFINED */