osapi.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. ** File: osapi.h
  3. **
  4. ** Copyright (c) 2004-2006, United States government as represented by the
  5. ** administrator of the National Aeronautics Space Administration.
  6. ** All rights reserved. This software was created at NASAs Goddard
  7. ** Space Flight Center pursuant to government contracts.
  8. **
  9. ** This is governed by the NASA Open Source Agreement and may be used,
  10. ** distributed and modified only pursuant to the terms of that agreement.
  11. **
  12. ** Author: Alan Cudmore - Code 582
  13. **
  14. ** Purpose: Contains functions prototype definitions and variables declarations
  15. ** for the OS Abstraction Layer, Core OS module
  16. **
  17. ** $Revision: 1.10 $
  18. **
  19. ** $Date: 2013/07/25 10:01:32GMT-05:00 $
  20. **
  21. ** $Log: osapi.h $
  22. ** Revision 1.10 2013/07/25 10:01:32GMT-05:00 acudmore
  23. ** Added C++ support
  24. ** Revision 1.9 2010/11/12 12:00:17GMT-05:00 acudmore
  25. ** replaced copyright character with (c) and added open source notice where needed.
  26. ** Revision 1.8 2010/03/08 15:57:20EST acudmore
  27. ** include new OSAL version header file
  28. ** Revision 1.7 2009/08/10 14:01:10EDT acudmore
  29. ** Reset OSAL version for trunk
  30. ** Revision 1.6 2009/08/10 13:55:49EDT acudmore
  31. ** Updated OSAL version defines to 3.0
  32. ** Revision 1.5 2009/06/10 14:15:55EDT acudmore
  33. ** Removed HAL include files. HAL code was removed from OSAL.
  34. ** Revision 1.4 2008/08/20 16:12:51EDT apcudmore
  35. ** Updated timer error codes
  36. ** Revision 1.3 2008/08/20 15:46:27EDT apcudmore
  37. ** Add support for timer API
  38. ** Revision 1.2 2008/06/20 15:13:43EDT apcudmore
  39. ** Checked in new Module loader/symbol table functionality
  40. ** Revision 1.1 2008/04/20 22:36:02EDT ruperera
  41. ** Initial revision
  42. ** Member added to project c:/MKSDATA/MKS-REPOSITORY/MKS-OSAL-REPOSITORY/src/os/inc/project.pj
  43. ** Revision 1.6 2008/02/14 11:29:10EST apcudmore
  44. ** Updated version define ( 2.11 )
  45. ** Revision 1.5 2008/02/07 11:31:58EST apcudmore
  46. ** Fixed merge problem
  47. ** Revision 1.4 2008/02/07 11:07:29EST apcudmore
  48. ** Added dynamic loader / Symbol lookup API
  49. ** -- API only, next release will have functionality
  50. ** Revision 1.2 2008/01/29 14:30:49EST njyanchik
  51. ** I added code to all the ports that allow the values of both binary and counting semaphores to be
  52. ** gotten through the OS_*SemGetInfo API.
  53. ** Revision 1.1 2007/10/16 16:14:52EDT apcudmore
  54. ** Initial revision
  55. ** Member added to project d:/mksdata/MKS-OSAL-REPOSITORY/src/os/inc/project.pj
  56. ** Revision 1.2 2007/09/28 15:46:49EDT rjmcgraw
  57. ** Updated version numbers to 5.0
  58. ** Revision 1.1 2007/08/24 13:43:25EDT apcudmore
  59. ** Initial revision
  60. ** Member added to project d:/mksdata/MKS-CFE-PROJECT/fsw/cfe-core/os/inc/project.pj
  61. ** Revision 1.9.1.1 2007/05/21 08:58:51EDT njyanchik
  62. ** The trunk version number has been updated to version 0.0
  63. ** Revision 1.9 2006/06/12 10:20:07EDT rjmcgraw
  64. ** Updated OS_MINOR_VERSION from 3 to 4
  65. ** Revision 1.8 2006/02/03 09:30:45EST njyanchik
  66. ** Changed version number to 2.3
  67. ** Revision 1.7 2006/01/20 11:56:16EST njyanchik
  68. ** Fixed header file information to match api document
  69. ** Revision 1.15 2005/11/09 13:35:49 nyanchik
  70. ** Revisions for 2.2 include:
  71. ** a new scheduler mapper for Linux and OS X
  72. ** addition of OS_printf function
  73. ** fixed issues that would cause warnings at compile time
  74. **
  75. **
  76. */
  77. #ifndef _osapi_
  78. #define _osapi_
  79. #include "common_types.h"
  80. #ifdef __cplusplus
  81. extern "C" {
  82. #endif
  83. #define OS_SUCCESS (0)
  84. #define OS_ERROR (-1)
  85. #define OS_INVALID_POINTER (-2)
  86. #define OS_ERROR_ADDRESS_MISALIGNED (-3)
  87. #define OS_ERROR_TIMEOUT (-4)
  88. #define OS_INVALID_INT_NUM (-5)
  89. #define OS_SEM_FAILURE (-6)
  90. #define OS_SEM_TIMEOUT (-7)
  91. #define OS_QUEUE_EMPTY (-8)
  92. #define OS_QUEUE_FULL (-9)
  93. #define OS_QUEUE_TIMEOUT (-10)
  94. #define OS_QUEUE_INVALID_SIZE (-11)
  95. #define OS_QUEUE_ID_ERROR (-12)
  96. #define OS_ERR_NAME_TOO_LONG (-13)
  97. #define OS_ERR_NO_FREE_IDS (-14)
  98. #define OS_ERR_NAME_TAKEN (-15)
  99. #define OS_ERR_INVALID_ID (-16)
  100. #define OS_ERR_NAME_NOT_FOUND (-17)
  101. #define OS_ERR_SEM_NOT_FULL (-18)
  102. #define OS_ERR_INVALID_PRIORITY (-19)
  103. #define OS_INVALID_SEM_VALUE (-20)
  104. #define OS_ERR_FILE (-27)
  105. #define OS_ERR_NOT_IMPLEMENTED (-28)
  106. #define OS_TIMER_ERR_INVALID_ARGS (-29)
  107. #define OS_TIMER_ERR_TIMER_ID (-30)
  108. #define OS_TIMER_ERR_UNAVAILABLE (-31)
  109. #define OS_TIMER_ERR_INTERNAL (-32)
  110. /*
  111. ** Defines for Queue Timeout parameters
  112. */
  113. #define OS_PEND (0)
  114. #define OS_CHECK (-1)
  115. #include "osapi-version.h"
  116. /*
  117. ** Include the configuration file
  118. */
  119. #include "osconfig.h"
  120. /*
  121. ** Include the OS API modules
  122. */
  123. #include "osapi-os-core.h"
  124. //#include "osapi-os-filesys.h"
  125. //#include "osapi-os-net.h"
  126. //#include "osapi-os-loader.h"
  127. #include "osapi-os-timer.h"
  128. #include "osapi-os-custom.h"
  129. #ifdef __cplusplus
  130. }
  131. #endif
  132. #endif