This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 12318bd947 xtensa_cache:add up_get_cachesize api
12318bd947 is described below

commit 12318bd947fbb0cc8262268e38b6318c15473628
Author: chenrun1 <[email protected]>
AuthorDate: Tue Jul 30 22:03:46 2024 +0800

    xtensa_cache:add up_get_cachesize api
    
    Summary:
      Added up_get_dcache_size and up_get_icache_size common APIs
    
    Signed-off-by: chenrun1 <[email protected]>
---
 arch/xtensa/src/common/xtensa_cache.c | 42 +++++++++++++++++++++++++++++++++--
 1 file changed, 40 insertions(+), 2 deletions(-)

diff --git a/arch/xtensa/src/common/xtensa_cache.c 
b/arch/xtensa/src/common/xtensa_cache.c
index 455605e57f..930c96a759 100644
--- a/arch/xtensa/src/common/xtensa_cache.c
+++ b/arch/xtensa/src/common/xtensa_cache.c
@@ -40,6 +40,26 @@
  * Public Functions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: up_get_icache_size
+ *
+ * Description:
+ *   Get icache size
+ *
+ * Input Parameters:
+ *   None
+ *
+ * Returned Value:
+ *   Cache size
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_XTENSA_ICACHE
+size_t up_get_icache_size(void)
+{
+  return XCHAL_ICACHE_SIZE;
+}
+
 /****************************************************************************
  * Name: up_get_icache_linesize
  *
@@ -54,7 +74,6 @@
  *
  ****************************************************************************/
 
-#ifdef CONFIG_XTENSA_ICACHE
 size_t up_get_icache_linesize(void)
 {
   return XCHAL_ICACHE_LINESIZE;
@@ -266,6 +285,26 @@ void up_unlock_icache_all(void)
 }
 #endif
 
+/****************************************************************************
+ * Name: up_get_dcache_size
+ *
+ * Description:
+ *   Get dcache size
+ *
+ * Input Parameters:
+ *   None
+ *
+ * Returned Value:
+ *   Cache size
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_XTENSA_DCACHE
+size_t up_get_dcache_size(void)
+{
+  return XCHAL_DCACHE_SIZE;
+}
+
 /****************************************************************************
  * Name: up_get_dcache_linesize
  *
@@ -280,7 +319,6 @@ void up_unlock_icache_all(void)
  *
  ****************************************************************************/
 
-#ifdef CONFIG_XTENSA_DCACHE
 size_t up_get_dcache_linesize(void)
 {
   return XCHAL_DCACHE_LINESIZE;

Reply via email to