los_builddef.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /* ----------------------------------------------------------------------------
  2. * Copyright (c) Huawei Technologies Co., Ltd. 2013-2019. All rights reserved.
  3. * Description: System Build Define HeadFile
  4. * Author: Huawei LiteOS Team
  5. * Create: 2013-01-01
  6. * Redistribution and use in source and binary forms, with or without modification,
  7. * are permitted provided that the following conditions are met:
  8. * 1. Redistributions of source code must retain the above copyright notice, this list of
  9. * conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright notice, this list
  11. * of conditions and the following disclaimer in the documentation and/or other materials
  12. * provided with the distribution.
  13. * 3. Neither the name of the copyright holder nor the names of its contributors may be used
  14. * to endorse or promote products derived from this software without specific prior written
  15. * permission.
  16. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  18. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  20. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  21. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  22. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  23. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  24. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  25. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  26. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. * --------------------------------------------------------------------------- */
  28. #ifndef _LOS_BUILDEF_H
  29. #define _LOS_BUILDEF_H
  30. #ifdef __cplusplus
  31. #if __cplusplus
  32. extern "C" {
  33. #endif /* __cplusplus */
  34. #endif /* __cplusplus */
  35. #define OS_LITTLE_ENDIAN 0x1234 /* Little endian */
  36. #define OS_BIG_ENDIAN 0x4321 /* Big endian */
  37. #ifndef OS_BYTE_ORDER
  38. #define OS_BYTE_ORDER OS_LITTLE_ENDIAN
  39. #endif
  40. /* Define OS code data sections */
  41. /* The indicator function is inline */
  42. #ifndef LITE_OS_SEC_ALW_INLINE
  43. #define LITE_OS_SEC_ALW_INLINE /* __attribute__((always_inline)) */
  44. #endif
  45. #ifndef LITE_OS_SEC_TEXT
  46. #define LITE_OS_SEC_TEXT /* __attribute__((section(".text.sram"))) */
  47. #endif
  48. #ifndef LITE_OS_SEC_TEXT_MINOR
  49. #define LITE_OS_SEC_TEXT_MINOR /* __attribute__((section(".text.ddr"))) */
  50. #endif
  51. #ifndef LITE_OS_SEC_TEXT_INIT
  52. #define LITE_OS_SEC_TEXT_INIT /* __attribute__((section(".text.init"))) */
  53. #endif
  54. #ifndef LITE_OS_SEC_DATA
  55. #define LITE_OS_SEC_DATA /* __attribute__((section(".data.sram"))) */
  56. #endif
  57. #ifndef LITE_OS_SEC_DATA_MINOR
  58. #define LITE_OS_SEC_DATA_MINOR /* __attribute__((section(".data.ddr"))) */
  59. #endif
  60. #ifndef LITE_OS_SEC_DATA_INIT
  61. #define LITE_OS_SEC_DATA_INIT /* __attribute__((section(".data.init"))) */
  62. #endif
  63. #ifndef LITE_OS_SEC_DATA_VEC
  64. #define LITE_OS_SEC_DATA_VEC __attribute__((section(".data.vector")))
  65. #endif
  66. #ifndef LITE_OS_SEC_BSS
  67. #define LITE_OS_SEC_BSS /* __attribute__((section(".bss.sram"))) */
  68. #endif
  69. #ifndef LITE_OS_SEC_BSS_MINOR
  70. #define LITE_OS_SEC_BSS_MINOR /* __attribute__((section(".bss.ddr"))) */
  71. #endif
  72. #ifndef LITE_OS_SEC_BSS_INIT
  73. #define LITE_OS_SEC_BSS_INIT /* __attribute__((section(".bss.init"))) */
  74. #endif
  75. #ifndef LITE_OS_SEC_ITCM
  76. #define LITE_OS_SEC_ITCM /* __attribute__((section(".itcm "))) */
  77. #endif
  78. #ifndef LITE_OS_SEC_DTCM
  79. #define LITE_OS_SEC_DTCM /* __attribute__((section(".dtcm"))) */
  80. #endif
  81. #define PACK1
  82. #ifndef LITE_OS_ATTR_SEC
  83. #define LITE_OS_ATTR_SEC(name) __attribute__((section(#name)))
  84. #endif
  85. #ifndef LITE_OS_ATTR_ALIGN
  86. #define LITE_OS_ATTR_ALIGN(x) __attribute__((aligned(x)))
  87. #endif
  88. #ifndef LITE_OS_ATTR_SEC_ALIGN
  89. #define LITE_OS_ATTR_SEC_ALIGN(name, x) __attribute__((section(#name), aligned(x)))
  90. #endif
  91. #ifndef OS_EMBED_ASM
  92. #define OS_EMBED_ASM __asm__ __volatile__
  93. #endif
  94. #ifdef __cplusplus
  95. #if __cplusplus
  96. }
  97. #endif /* __cplusplus */
  98. #endif /* __cplusplus */
  99. #endif /* _LOS_BUILDEF_H */