myotypes.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Copyright 2010-2013 Intel Corporation.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU Lesser General Public License as published
  6. * by the Free Software Foundation, version 2.1.
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public
  14. * License along with this library; if not, write to the Free Software
  15. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. * 02110-1301 USA.
  17. *
  18. * Disclaimer: The codes contained in these modules may be specific
  19. * to the Intel Software Development Platform codenamed Knights Ferry,
  20. * and the Intel product codenamed Knights Corner, and are not backward
  21. * compatible with other Intel products. Additionally, Intel will NOT
  22. * support the codes or instruction set in future products.
  23. *
  24. * Intel offers no warranty of any kind regarding the code. This code is
  25. * licensed on an "AS IS" basis and Intel is not obligated to provide
  26. * any support, assistance, installation, training, or other services
  27. * of any kind. Intel is also not obligated to provide any updates,
  28. * enhancements or extensions. Intel specifically disclaims any warranty
  29. * of merchantability, non-infringement, fitness for any particular
  30. * purpose, and any other warranty.
  31. *
  32. * Further, Intel disclaims all liability of any kind, including but
  33. * not limited to liability for infringement of any proprietary rights,
  34. * relating to the use of the code, even if Intel is notified of the
  35. * possibility of such liability. Except as expressly stated in an Intel
  36. * license agreement provided with this code and agreed upon with Intel,
  37. * no license, express or implied, by estoppel or otherwise, to any
  38. * intellectual property rights is granted herein.
  39. */
  40. /**
  41. Description: Define the types used by APIs of MYO programming.
  42. */
  43. #ifndef _MYO_TYPES_H_
  44. #define _MYO_TYPES_H_
  45. #include <string.h> /* For size_t */
  46. /** @ingroup MYO
  47. * @addtogroup MYOTYPES
  48. @{
  49. * @file myotypes.h
  50. */
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54. /*! MYO Status
  55. */
  56. typedef enum {
  57. MYO_SUCCESS = 0, /*!< Success */
  58. MYO_ERROR, /*!< Error */
  59. MYO_INVALID_ENV, /*!< Invalid Env */
  60. MYO_INVALID_ARGUMENT, /*!< Invalid Argument */
  61. MYO_NOT_INITIALIZED, /*!< Not Initialized */
  62. MYO_ALREADY_FINALIZED,/*!< Already Finalized */
  63. MYO_BUF_ERROR, /*!< Buffer Error */
  64. MYO_OUT_OF_RANGE, /*!< Out of Range */
  65. MYO_OUT_OF_MEMORY, /*!< Out of Memory */
  66. MYO_ALREADY_EXISTS, /*!< Already Exists */
  67. MYO_EOF, /*!< EOF */
  68. } MyoError;
  69. /*! Arena Ownership */
  70. typedef enum {
  71. MYO_ARENA_MINE = 1, /*!< Arena MINE Ownership */
  72. MYO_ARENA_OURS, /*!< Arena OURS Ownership */
  73. } MyoOwnershipType;
  74. /*************************************************************
  75. * define the property of MYO Arena
  76. ***********************************************************/
  77. #define MYO_CONSISTENCY_MODE 0x3
  78. #define MYO_RELEASE_CONSISTENCY 0x1
  79. #define MYO_STRONG_RELEASE_CONSISTENCY 0x2
  80. #define MYO_STRONG_CONSISTENCY 0x3
  81. #define MYO_UPDATE_ON_DEMAND 0x8
  82. #define MYO_UPDATE_ON_ACQUIRE 0x10
  83. #define MYO_RECORD_DIRTY 0x20
  84. #define MYO_NOT_RECORD_DIRTY 0x40
  85. #define MYO_ONE_VERSION 0x80
  86. #define MYO_MULTI_VERSIONS 0x100
  87. #define MYO_CONSISTENCY 0x200
  88. #define MYO_NO_CONSISTENCY 0x400
  89. #define MYO_HOST_TO_DEVICE 0x800
  90. #define MYO_DEVICE_TO_HOST 0x1000
  91. #define MYO_HYBRID_UPDATE 0x2000
  92. typedef unsigned int MyoArena;
  93. typedef void * MyoMutex;
  94. typedef void * MyoSem;
  95. typedef void * MyoBarrier;
  96. #ifdef __cplusplus
  97. }
  98. #endif
  99. #endif // _MYO_TYPES_H_
  100. /*! @} */