cpu.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. /*
  2. *********************************************************************************************************
  3. * uC/CPU
  4. * CPU CONFIGURATION & PORT LAYER
  5. *
  6. * Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
  7. *
  8. * SPDX-License-Identifier: APACHE-2.0
  9. *
  10. * This software is subject to an open source license and is distributed by
  11. * Silicon Laboratories Inc. pursuant to the terms of the Apache License,
  12. * Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
  13. *
  14. *********************************************************************************************************
  15. */
  16. /*
  17. *********************************************************************************************************
  18. *
  19. * CPU PORT FILE
  20. *
  21. * RISC-V
  22. * GNU C Compiler
  23. *
  24. * Filename : cpu.h
  25. * Version : V1.32.01
  26. *********************************************************************************************************
  27. */
  28. /*
  29. *********************************************************************************************************
  30. * MODULE
  31. *
  32. * Note(s) : (1) This CPU header file is protected from multiple pre-processor inclusion through use of
  33. * the CPU module present pre-processor macro definition.
  34. *********************************************************************************************************
  35. */
  36. #ifndef CPU_MODULE_PRESENT /* See Note #1. */
  37. #define CPU_MODULE_PRESENT
  38. /*
  39. *********************************************************************************************************
  40. * CPU INCLUDE FILES
  41. *
  42. * Note(s) : (1) The following CPU files are located in the following directories :
  43. *
  44. * (a) \<Your Product Application>\cpu_cfg.h
  45. *
  46. * (b) (1) \<CPU-Compiler Directory>\cpu_def.h
  47. * (2) \<CPU-Compiler Directory>\<cpu>\<compiler>\cpu*.*
  48. *
  49. * where
  50. * <Your Product Application> directory path for Your Product's Application
  51. * <CPU-Compiler Directory> directory path for common CPU-compiler software
  52. * <cpu> directory name for specific CPU
  53. * <compiler> directory name for specific compiler
  54. *
  55. * (2) Compiler MUST be configured to include as additional include path directories :
  56. *
  57. * (a) '\<Your Product Application>\' directory See Note #1a
  58. *
  59. * (b) (1) '\<CPU-Compiler Directory>\' directory See Note #1b1
  60. * (2) '\<CPU-Compiler Directory>\<cpu>\<compiler>\' directory See Note #1b2
  61. *
  62. * (3) Since NO custom library modules are included, 'cpu.h' may ONLY use configurations from
  63. * CPU configuration file 'cpu_cfg.h' that do NOT reference any custom library definitions.
  64. *
  65. * In other words, 'cpu.h' may use 'cpu_cfg.h' configurations that are #define'd to numeric
  66. * constants or to NULL (i.e. NULL-valued #define's); but may NOT use configurations to
  67. * custom library #define's (e.g. DEF_DISABLED or DEF_ENABLED).
  68. *********************************************************************************************************
  69. */
  70. #include <cpu_def.h>
  71. #include <cpu_cfg.h> /* See Note #3. */
  72. #ifdef __cplusplus
  73. extern "C" {
  74. #endif
  75. /*
  76. *********************************************************************************************************
  77. * CONFIGURE STANDARD DATA TYPES
  78. *
  79. * Note(s) : (1) Configure standard data types according to CPU-/compiler-specifications.
  80. *
  81. * (2) (a) (1) 'CPU_FNCT_VOID' data type defined to replace the commonly-used function pointer
  82. * data type of a pointer to a function which returns void & has no arguments.
  83. *
  84. * (2) Example function pointer usage :
  85. *
  86. * CPU_FNCT_VOID FnctName;
  87. *
  88. * FnctName();
  89. *
  90. * (b) (1) 'CPU_FNCT_PTR' data type defined to replace the commonly-used function pointer
  91. * data type of a pointer to a function which returns void & has a single void
  92. * pointer argument.
  93. *
  94. * (2) Example function pointer usage :
  95. *
  96. * CPU_FNCT_PTR FnctName;
  97. * void *p_obj
  98. *
  99. * FnctName(p_obj);
  100. *********************************************************************************************************
  101. */
  102. typedef void CPU_VOID;
  103. typedef char CPU_CHAR; /* 8-bit character */
  104. typedef unsigned char CPU_BOOLEAN; /* 8-bit boolean or logical */
  105. typedef unsigned char CPU_INT08U; /* 8-bit unsigned integer */
  106. typedef signed char CPU_INT08S; /* 8-bit signed integer */
  107. typedef unsigned short CPU_INT16U; /* 16-bit unsigned integer */
  108. typedef signed short CPU_INT16S; /* 16-bit signed integer */
  109. typedef unsigned int CPU_INT32U; /* 32-bit unsigned integer */
  110. typedef signed int CPU_INT32S; /* 32-bit signed integer */
  111. typedef unsigned long long CPU_INT64U; /* 64-bit unsigned integer */
  112. typedef signed long long CPU_INT64S; /* 64-bit signed integer */
  113. typedef float CPU_FP32; /* 32-bit floating point */
  114. typedef double CPU_FP64; /* 64-bit floating point */
  115. typedef volatile CPU_INT08U CPU_REG08; /* 8-bit register */
  116. typedef volatile CPU_INT16U CPU_REG16; /* 16-bit register */
  117. typedef volatile CPU_INT32U CPU_REG32; /* 32-bit register */
  118. typedef volatile CPU_INT64U CPU_REG64; /* 64-bit register */
  119. typedef void (*CPU_FNCT_VOID)(void); /* See Note #2a. */
  120. typedef void (*CPU_FNCT_PTR )(void *p_obj); /* See Note #2b. */
  121. /*
  122. *********************************************************************************************************
  123. * CPU WORD CONFIGURATION
  124. *
  125. * Note(s) : (1) Configure CPU_CFG_ADDR_SIZE, CPU_CFG_DATA_SIZE, & CPU_CFG_DATA_SIZE_MAX with CPU's &/or
  126. * compiler's word sizes :
  127. *
  128. * CPU_WORD_SIZE_08 8-bit word size
  129. * CPU_WORD_SIZE_16 16-bit word size
  130. * CPU_WORD_SIZE_32 32-bit word size
  131. * CPU_WORD_SIZE_64 64-bit word size
  132. *
  133. * (2) Configure CPU_CFG_ENDIAN_TYPE with CPU's data-word-memory order :
  134. *
  135. * (a) CPU_ENDIAN_TYPE_BIG Big- endian word order (CPU words' most significant
  136. * octet @ lowest memory address)
  137. * (b) CPU_ENDIAN_TYPE_LITTLE Little-endian word order (CPU words' least significant
  138. * octet @ lowest memory address)
  139. *********************************************************************************************************
  140. */
  141. /* Define CPU word sizes (see Note #1) : */
  142. #define CPU_CFG_ADDR_SIZE CPU_WORD_SIZE_32 /* Defines CPU address word size (in octets). */
  143. #define CPU_CFG_DATA_SIZE CPU_WORD_SIZE_32 /* Defines CPU data word size (in octets). */
  144. #define CPU_CFG_DATA_SIZE_MAX CPU_WORD_SIZE_64 /* Defines CPU maximum word size (in octets). */
  145. #define CPU_CFG_ENDIAN_TYPE CPU_ENDIAN_TYPE_LITTLE /* Defines CPU data word-memory order (see Note #2). */
  146. /*
  147. *********************************************************************************************************
  148. * CONFIGURE CPU ADDRESS & DATA TYPES
  149. *********************************************************************************************************
  150. */
  151. /* CPU address type based on address bus size. */
  152. #if (CPU_CFG_ADDR_SIZE == CPU_WORD_SIZE_64)
  153. typedef CPU_INT64U CPU_ADDR;
  154. #elif (CPU_CFG_ADDR_SIZE == CPU_WORD_SIZE_32)
  155. typedef CPU_INT32U CPU_ADDR;
  156. #elif (CPU_CFG_ADDR_SIZE == CPU_WORD_SIZE_16)
  157. typedef CPU_INT16U CPU_ADDR;
  158. #else
  159. typedef CPU_INT08U CPU_ADDR;
  160. #endif
  161. /* CPU data type based on data bus size. */
  162. #if (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_64)
  163. typedef CPU_INT64U CPU_DATA;
  164. #elif (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_32)
  165. typedef CPU_INT32U CPU_DATA;
  166. #elif (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_16)
  167. typedef CPU_INT16U CPU_DATA;
  168. #else
  169. typedef CPU_INT08U CPU_DATA;
  170. #endif
  171. typedef CPU_DATA CPU_ALIGN; /* Defines CPU data-word-alignment size. */
  172. typedef CPU_ADDR CPU_SIZE_T; /* Defines CPU standard 'size_t' size. */
  173. /*
  174. *********************************************************************************************************
  175. * CPU STACK CONFIGURATION
  176. *
  177. * Note(s) : (1) Configure CPU_CFG_STK_GROWTH in 'cpu.h' with CPU's stack growth order :
  178. *
  179. * (a) CPU_STK_GROWTH_LO_TO_HI CPU stack pointer increments to the next higher stack
  180. * memory address after data is pushed onto the stack
  181. * (b) CPU_STK_GROWTH_HI_TO_LO CPU stack pointer decrements to the next lower stack
  182. * memory address after data is pushed onto the stack
  183. *
  184. * (2) Configure CPU_CFG_STK_ALIGN_BYTES with the highest minimum alignement required for
  185. * cpu stacks.
  186. *********************************************************************************************************
  187. */
  188. #define CPU_CFG_STK_GROWTH CPU_STK_GROWTH_HI_TO_LO /* Defines CPU stack growth order (see Note #1). */
  189. #define CPU_CFG_STK_ALIGN_BYTES (sizeof(CPU_ALIGN)) /* Defines CPU stack alignment in bytes. (see Note #2). */
  190. typedef CPU_INT32U CPU_STK; /* Defines CPU stack data type. */
  191. typedef CPU_ADDR CPU_STK_SIZE; /* Defines CPU stack size data type. */
  192. /*
  193. *********************************************************************************************************
  194. * CRITICAL SECTION CONFIGURATION
  195. *
  196. * Note(s) : (1) Configure CPU_CFG_CRITICAL_METHOD with CPU's/compiler's critical section method :
  197. *
  198. * Enter/Exit critical sections by ...
  199. *
  200. * CPU_CRITICAL_METHOD_INT_DIS_EN Disable/Enable interrupts
  201. * CPU_CRITICAL_METHOD_STATUS_STK Push/Pop interrupt status onto stack
  202. * CPU_CRITICAL_METHOD_STATUS_LOCAL Save/Restore interrupt status to local variable
  203. *
  204. * (a) CPU_CRITICAL_METHOD_INT_DIS_EN is NOT a preferred method since it does NOT support
  205. * multiple levels of interrupts. However, with some CPUs/compilers, this is the only
  206. * available method.
  207. *
  208. * (b) CPU_CRITICAL_METHOD_STATUS_STK is one preferred method since it supports multiple
  209. * levels of interrupts. However, this method assumes that the compiler provides C-level
  210. * &/or assembly-level functionality for the following :
  211. *
  212. * ENTER CRITICAL SECTION :
  213. * (1) Push/save interrupt status onto a local stack
  214. * (2) Disable interrupts
  215. *
  216. * EXIT CRITICAL SECTION :
  217. * (3) Pop/restore interrupt status from a local stack
  218. *
  219. * (c) CPU_CRITICAL_METHOD_STATUS_LOCAL is one preferred method since it supports multiple
  220. * levels of interrupts. However, this method assumes that the compiler provides C-level
  221. * &/or assembly-level functionality for the following :
  222. *
  223. * ENTER CRITICAL SECTION :
  224. * (1) Save interrupt status into a local variable
  225. * (2) Disable interrupts
  226. *
  227. * EXIT CRITICAL SECTION :
  228. * (3) Restore interrupt status from a local variable
  229. *
  230. * (2) Critical section macro's most likely require inline assembly. If the compiler does NOT
  231. * allow inline assembly in C source files, critical section macro's MUST call an assembly
  232. * subroutine defined in a 'cpu_a.asm' file located in the following software directory :
  233. *
  234. * \<CPU-Compiler Directory>\<cpu>\<compiler>\
  235. *
  236. * where
  237. * <CPU-Compiler Directory> directory path for common CPU-compiler software
  238. * <cpu> directory name for specific CPU
  239. * <compiler> directory name for specific compiler
  240. *
  241. * (3) (a) To save/restore interrupt status, a local variable 'cpu_sr' of type 'CPU_SR' MAY need
  242. * to be declared (e.g. if 'CPU_CRITICAL_METHOD_STATUS_LOCAL' method is configured).
  243. *
  244. * (1) 'cpu_sr' local variable SHOULD be declared via the CPU_SR_ALLOC() macro which, if
  245. * used, MUST be declared following ALL other local variables.
  246. *
  247. * Example :
  248. *
  249. * void Fnct (void)
  250. * {
  251. * CPU_INT08U val_08;
  252. * CPU_INT16U val_16;
  253. * CPU_INT32U val_32;
  254. * CPU_SR_ALLOC(); MUST be declared after ALL other local variables
  255. * :
  256. * :
  257. * }
  258. *
  259. * (b) Configure 'CPU_SR' data type with the appropriate-sized CPU data type large enough to
  260. * completely store the CPU's/compiler's status word.
  261. *********************************************************************************************************
  262. */
  263. /* Configure CPU critical method (see Note #1) : */
  264. #define CPU_CFG_CRITICAL_METHOD CPU_CRITICAL_METHOD_STATUS_LOCAL
  265. typedef CPU_INT32U CPU_SR; /* Defines CPU status register size (see Note #3b). */
  266. /* Allocates CPU status register word (see Note #3a). */
  267. #if (CPU_CFG_CRITICAL_METHOD == CPU_CRITICAL_METHOD_STATUS_LOCAL)
  268. #define CPU_SR_ALLOC() CPU_SR cpu_sr = (CPU_SR)0
  269. #else
  270. #define CPU_SR_ALLOC()
  271. #endif
  272. #if (CPU_CFG_CRITICAL_METHOD == CPU_CRITICAL_METHOD_STATUS_LOCAL)
  273. #define CPU_INT_DIS() do { cpu_sr = CPU_SR_Save(); } while (0) /* Save CPU status word & disable interrupts.*/
  274. #define CPU_INT_EN() do { CPU_SR_Restore(cpu_sr); } while (0) /* Restore CPU status word. */
  275. #endif
  276. #ifdef CPU_CFG_INT_DIS_MEAS_EN
  277. /* Disable interrupts, ... */
  278. /* & start interrupts disabled time measurement.*/
  279. #define CPU_CRITICAL_ENTER() do { CPU_INT_DIS(); \
  280. CPU_IntDisMeasStart(); } while (0)
  281. /* Stop & measure interrupts disabled time, */
  282. /* ... & re-enable interrupts. */
  283. #define CPU_CRITICAL_EXIT() do { CPU_IntDisMeasStop(); \
  284. CPU_INT_EN(); } while (0)
  285. #else
  286. #define CPU_CRITICAL_ENTER() do { CPU_INT_DIS(); } while (0) /* Disable interrupts. */
  287. #define CPU_CRITICAL_EXIT() do { CPU_INT_EN(); } while (0) /* Re-enable interrupts. */
  288. #endif
  289. /*
  290. *********************************************************************************************************
  291. * MEMORY BARRIERS CONFIGURATION
  292. *
  293. * Note(s) : (1) (a) Configure memory barriers if required by the architecture.
  294. *
  295. * CPU_MB Full memory barrier.
  296. * CPU_RMB Read (Loads) memory barrier.
  297. * CPU_WMB Write (Stores) memory barrier.
  298. *
  299. *********************************************************************************************************
  300. */
  301. #define CPU_MB()
  302. #define CPU_RMB()
  303. #define CPU_WMB()
  304. /*
  305. *********************************************************************************************************
  306. * CPU COUNT ZEROS CONFIGURATION
  307. *
  308. * Note(s) : (1) (a) Configure CPU_CFG_LEAD_ZEROS_ASM_PRESENT to define count leading zeros bits
  309. * function(s) in :
  310. *
  311. * (1) 'cpu_a.asm', if CPU_CFG_LEAD_ZEROS_ASM_PRESENT #define'd in 'cpu.h'/
  312. * 'cpu_cfg.h' to enable assembly-optimized function(s)
  313. *
  314. * (2) 'cpu_core.c', if CPU_CFG_LEAD_ZEROS_ASM_PRESENT NOT #define'd in 'cpu.h'/
  315. * 'cpu_cfg.h' to enable C-source-optimized function(s) otherwise
  316. *
  317. * (b) Configure CPU_CFG_TRAIL_ZEROS_ASM_PRESENT to define count trailing zeros bits
  318. * function(s) in :
  319. *
  320. * (1) 'cpu_a.asm', if CPU_CFG_TRAIL_ZEROS_ASM_PRESENT #define'd in 'cpu.h'/
  321. * 'cpu_cfg.h' to enable assembly-optimized function(s)
  322. *
  323. * (2) 'cpu_core.c', if CPU_CFG_TRAIL_ZEROS_ASM_PRESENT NOT #define'd in 'cpu.h'/
  324. * 'cpu_cfg.h' to enable C-source-optimized function(s) otherwise
  325. *********************************************************************************************************
  326. */
  327. #if 0 /* Configure CPU count leading zeros bits ... */
  328. #define CPU_CFG_LEAD_ZEROS_ASM_PRESENT /* ... assembly-version (see Note #1a). */
  329. #endif
  330. #if 0 /* Configure CPU count trailing zeros bits ... */
  331. #define CPU_CFG_TRAIL_ZEROS_ASM_PRESENT /* ... assembly-version (see Note #1b). */
  332. #endif
  333. /*
  334. *********************************************************************************************************
  335. * FUNCTION PROTOTYPES
  336. *********************************************************************************************************
  337. */
  338. /* $$$$ Prototype CPU port functions (if required) : */
  339. void CPU_IntDis (void); /* Disable interrupts. */
  340. void CPU_IntEn (void); /* Enable interrupts. */
  341. CPU_SR CPU_SR_Save (void); /* Save CPU status word & disable interrupts. */
  342. void CPU_SR_Restore(CPU_SR cpu_sr); /* Restore CPU status word. */
  343. /*
  344. *********************************************************************************************************
  345. * CONFIGURATION ERRORS
  346. *********************************************************************************************************
  347. */
  348. #ifndef CPU_CFG_ADDR_SIZE
  349. #error "CPU_CFG_ADDR_SIZE not #define'd in 'cpu.h' "
  350. #error " [MUST be CPU_WORD_SIZE_08 8-bit alignment]"
  351. #error " [ || CPU_WORD_SIZE_16 16-bit alignment]"
  352. #error " [ || CPU_WORD_SIZE_32 32-bit alignment]"
  353. #error " [ || CPU_WORD_SIZE_64 64-bit alignment]"
  354. #elif ((CPU_CFG_ADDR_SIZE != CPU_WORD_SIZE_08) && \
  355. (CPU_CFG_ADDR_SIZE != CPU_WORD_SIZE_16) && \
  356. (CPU_CFG_ADDR_SIZE != CPU_WORD_SIZE_32) && \
  357. (CPU_CFG_ADDR_SIZE != CPU_WORD_SIZE_64))
  358. #error "CPU_CFG_ADDR_SIZE illegally #define'd in 'cpu.h' "
  359. #error " [MUST be CPU_WORD_SIZE_08 8-bit alignment]"
  360. #error " [ || CPU_WORD_SIZE_16 16-bit alignment]"
  361. #error " [ || CPU_WORD_SIZE_32 32-bit alignment]"
  362. #error " [ || CPU_WORD_SIZE_64 64-bit alignment]"
  363. #endif
  364. #ifndef CPU_CFG_DATA_SIZE
  365. #error "CPU_CFG_DATA_SIZE not #define'd in 'cpu.h' "
  366. #error " [MUST be CPU_WORD_SIZE_08 8-bit alignment]"
  367. #error " [ || CPU_WORD_SIZE_16 16-bit alignment]"
  368. #error " [ || CPU_WORD_SIZE_32 32-bit alignment]"
  369. #error " [ || CPU_WORD_SIZE_64 64-bit alignment]"
  370. #elif ((CPU_CFG_DATA_SIZE != CPU_WORD_SIZE_08) && \
  371. (CPU_CFG_DATA_SIZE != CPU_WORD_SIZE_16) && \
  372. (CPU_CFG_DATA_SIZE != CPU_WORD_SIZE_32) && \
  373. (CPU_CFG_DATA_SIZE != CPU_WORD_SIZE_64))
  374. #error "CPU_CFG_DATA_SIZE illegally #define'd in 'cpu.h' "
  375. #error " [MUST be CPU_WORD_SIZE_08 8-bit alignment]"
  376. #error " [ || CPU_WORD_SIZE_16 16-bit alignment]"
  377. #error " [ || CPU_WORD_SIZE_32 32-bit alignment]"
  378. #error " [ || CPU_WORD_SIZE_64 64-bit alignment]"
  379. #endif
  380. #ifndef CPU_CFG_DATA_SIZE_MAX
  381. #error "CPU_CFG_DATA_SIZE_MAX not #define'd in 'cpu.h' "
  382. #error " [MUST be CPU_WORD_SIZE_08 8-bit alignment]"
  383. #error " [ || CPU_WORD_SIZE_16 16-bit alignment]"
  384. #error " [ || CPU_WORD_SIZE_32 32-bit alignment]"
  385. #error " [ || CPU_WORD_SIZE_64 64-bit alignment]"
  386. #elif ((CPU_CFG_DATA_SIZE_MAX != CPU_WORD_SIZE_08) && \
  387. (CPU_CFG_DATA_SIZE_MAX != CPU_WORD_SIZE_16) && \
  388. (CPU_CFG_DATA_SIZE_MAX != CPU_WORD_SIZE_32) && \
  389. (CPU_CFG_DATA_SIZE_MAX != CPU_WORD_SIZE_64))
  390. #error "CPU_CFG_DATA_SIZE_MAX illegally #define'd in 'cpu.h' "
  391. #error " [MUST be CPU_WORD_SIZE_08 8-bit alignment]"
  392. #error " [ || CPU_WORD_SIZE_16 16-bit alignment]"
  393. #error " [ || CPU_WORD_SIZE_32 32-bit alignment]"
  394. #error " [ || CPU_WORD_SIZE_64 64-bit alignment]"
  395. #endif
  396. #if (CPU_CFG_DATA_SIZE_MAX < CPU_CFG_DATA_SIZE)
  397. #error "CPU_CFG_DATA_SIZE_MAX illegally #define'd in 'cpu.h' "
  398. #error " [MUST be >= CPU_CFG_DATA_SIZE]"
  399. #endif
  400. #ifndef CPU_CFG_ENDIAN_TYPE
  401. #error "CPU_CFG_ENDIAN_TYPE not #define'd in 'cpu.h' "
  402. #error " [MUST be CPU_ENDIAN_TYPE_BIG ]"
  403. #error " [ || CPU_ENDIAN_TYPE_LITTLE]"
  404. #elif ((CPU_CFG_ENDIAN_TYPE != CPU_ENDIAN_TYPE_BIG ) && \
  405. (CPU_CFG_ENDIAN_TYPE != CPU_ENDIAN_TYPE_LITTLE))
  406. #error "CPU_CFG_ENDIAN_TYPE illegally #define'd in 'cpu.h' "
  407. #error " [MUST be CPU_ENDIAN_TYPE_BIG ]"
  408. #error " [ || CPU_ENDIAN_TYPE_LITTLE]"
  409. #endif
  410. #ifndef CPU_CFG_STK_GROWTH
  411. #error "CPU_CFG_STK_GROWTH not #define'd in 'cpu.h' "
  412. #error " [MUST be CPU_STK_GROWTH_LO_TO_HI]"
  413. #error " [ || CPU_STK_GROWTH_HI_TO_LO]"
  414. #elif ((CPU_CFG_STK_GROWTH != CPU_STK_GROWTH_LO_TO_HI) && \
  415. (CPU_CFG_STK_GROWTH != CPU_STK_GROWTH_HI_TO_LO))
  416. #error "CPU_CFG_STK_GROWTH illegally #define'd in 'cpu.h' "
  417. #error " [MUST be CPU_STK_GROWTH_LO_TO_HI]"
  418. #error " [ || CPU_STK_GROWTH_HI_TO_LO]"
  419. #endif
  420. #ifndef CPU_CFG_CRITICAL_METHOD
  421. #error "CPU_CFG_CRITICAL_METHOD not #define'd in 'cpu.h' "
  422. #error " [MUST be CPU_CRITICAL_METHOD_INT_DIS_EN ]"
  423. #error " [ || CPU_CRITICAL_METHOD_STATUS_STK ]"
  424. #error " [ || CPU_CRITICAL_METHOD_STATUS_LOCAL]"
  425. #elif ((CPU_CFG_CRITICAL_METHOD != CPU_CRITICAL_METHOD_INT_DIS_EN ) && \
  426. (CPU_CFG_CRITICAL_METHOD != CPU_CRITICAL_METHOD_STATUS_STK ) && \
  427. (CPU_CFG_CRITICAL_METHOD != CPU_CRITICAL_METHOD_STATUS_LOCAL))
  428. #error "CPU_CFG_CRITICAL_METHOD illegally #define'd in 'cpu.h' "
  429. #error " [MUST be CPU_CRITICAL_METHOD_INT_DIS_EN ]"
  430. #error " [ || CPU_CRITICAL_METHOD_STATUS_STK ]"
  431. #error " [ || CPU_CRITICAL_METHOD_STATUS_LOCAL]"
  432. #endif
  433. /*
  434. *********************************************************************************************************
  435. * MODULE END
  436. *
  437. * Note(s) : (1) See 'cpu.h MODULE'.
  438. *********************************************************************************************************
  439. */
  440. #ifdef __cplusplus
  441. }
  442. #endif
  443. #endif /* End of CPU module include. */