You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

136 regels
4.6 KiB

  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. * CACHE CPU MODULE
  20. *
  21. * Filename : cpu_cache.h
  22. * Version : V1.32.01
  23. *********************************************************************************************************
  24. */
  25. /*
  26. *********************************************************************************************************
  27. * MODULE
  28. *
  29. * Note(s) : (1) This cache CPU header file is protected from multiple pre-processor inclusion through use of
  30. * the cache CPU module present pre-processor macro definition.
  31. *********************************************************************************************************
  32. */
  33. #ifndef CPU_CACHE_MODULE_PRESENT /* See Note #1. */
  34. #define CPU_CACHE_MODULE_PRESENT
  35. /*
  36. *********************************************************************************************************
  37. * EXTERNS
  38. *********************************************************************************************************
  39. */
  40. #ifdef CPU_CACHE_MODULE
  41. #define CPU_CACHE_EXT
  42. #else
  43. #define CPU_CACHE_EXT extern
  44. #endif
  45. /*
  46. *********************************************************************************************************
  47. * INCLUDE FILES
  48. *********************************************************************************************************
  49. */
  50. #include <cpu.h>
  51. #include <lib_def.h>
  52. #include <cpu_cfg.h>
  53. /*
  54. *********************************************************************************************************
  55. * CACHE CONFIGURATION
  56. *********************************************************************************************************
  57. */
  58. #ifndef CPU_CFG_CACHE_MGMT_EN
  59. #define CPU_CFG_CACHE_MGMT_EN DEF_DISABLED
  60. #endif
  61. /*
  62. *********************************************************************************************************
  63. * CACHE OPERATIONS DEFINES
  64. *********************************************************************************************************
  65. */
  66. #if (CPU_CFG_CACHE_MGMT_EN == DEF_ENABLED)
  67. #ifndef CPU_DCACHE_RANGE_FLUSH
  68. #define CPU_DCACHE_RANGE_FLUSH(addr_start, len) CPU_DCache_RangeFlush(addr_start, len)
  69. #endif /* CPU_DCACHE_RANGE_FLUSH */
  70. #else
  71. #define CPU_DCACHE_RANGE_FLUSH(addr_start, len)
  72. #endif /* CPU_CFG_CACHE_MGMT_EN) */
  73. #if (CPU_CFG_CACHE_MGMT_EN == DEF_ENABLED)
  74. #ifndef CPU_DCACHE_RANGE_INV
  75. #define CPU_DCACHE_RANGE_INV(addr_start, len) CPU_DCache_RangeInv(addr_start, len)
  76. #endif /* CPU_DCACHE_RANGE_INV */
  77. #else
  78. #define CPU_DCACHE_RANGE_INV(addr_start, len)
  79. #endif /* CPU_CFG_CACHE_MGMT_EN) */
  80. /*
  81. *********************************************************************************************************
  82. * FUNCTION PROTOTYPES
  83. *********************************************************************************************************
  84. */
  85. #if (CPU_CFG_CACHE_MGMT_EN == DEF_ENABLED)
  86. #ifdef __cplusplus
  87. extern "C" {
  88. #endif
  89. void CPU_Cache_Init (void);
  90. void CPU_DCache_RangeFlush(void *addr_start,
  91. CPU_ADDR len);
  92. void CPU_DCache_RangeInv (void *addr_start,
  93. CPU_ADDR len);
  94. #ifdef __cplusplus
  95. }
  96. #endif
  97. #endif /* CPU_CFG_CACHE_MGMT_EN */
  98. /*
  99. *********************************************************************************************************
  100. * MODULE END
  101. *
  102. * Note(s) : (1) See 'cpu_core.h MODULE'.
  103. *********************************************************************************************************
  104. */
  105. #endif /* End of CPU core module include. */