You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/04/04 05:22:14 UTC

[incubator-nuttx] branch master updated: arch/riscv: Rename SCRATCH_HARTID_OFFSET to RISCV_PERCPU_HARTID_OFFSET

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

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


The following commit(s) were added to refs/heads/master by this push:
     new bf48c6d4a8 arch/riscv: Rename SCRATCH_HARTID_OFFSET to RISCV_PERCPU_HARTID_OFFSET
bf48c6d4a8 is described below

commit bf48c6d4a897fbf225ff3374abe55ede8ffa2c57
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sat Apr 2 05:37:00 2022 +0800

    arch/riscv: Rename SCRATCH_HARTID_OFFSET to RISCV_PERCPU_HARTID_OFFSET
    
    and fix the typo error
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/risc-v/src/common/riscv_percpu.c | 5 ++++-
 arch/risc-v/src/common/riscv_percpu.h | 9 ++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/risc-v/src/common/riscv_percpu.c b/arch/risc-v/src/common/riscv_percpu.c
index a10164b1f1..21cc316246 100644
--- a/arch/risc-v/src/common/riscv_percpu.c
+++ b/arch/risc-v/src/common/riscv_percpu.c
@@ -40,6 +40,9 @@
 
 #define HART_CNT    (CONFIG_ARCH_CPU_COUNT)
 
+static_assert(RISCV_PERCPU_HARTID_OFFSET == offsetof(riscv_percpu_s, hartid),
+              "RISCV_PERCPU_HARTID_OFFSET with a wrong value");
+
 /****************************************************************************
  * Private Data
  ****************************************************************************/
@@ -70,7 +73,7 @@ void riscv_percpu_init(void)
 }
 
 /****************************************************************************
- * Name: riscv_percpu_get_addr
+ * Name: riscv_percpu_add_hart
  *
  * Description:
  *   Get add a hart to the per CPU area
diff --git a/arch/risc-v/src/common/riscv_percpu.h b/arch/risc-v/src/common/riscv_percpu.h
index ddb35a5145..76edfe6941 100644
--- a/arch/risc-v/src/common/riscv_percpu.h
+++ b/arch/risc-v/src/common/riscv_percpu.h
@@ -38,10 +38,9 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#ifdef __ASSEMBLY__
-#define SCRATCH_HARTID_OFFSET   (0 * INT_REG_SIZE)
-#else
-#define SCRATCH_HARTID_OFFSET   offsetof(riscv_percpu_s, hartid)
+#define RISCV_PERCPU_HARTID_OFFSET   (0 * INT_REG_SIZE)
+
+#ifndef __ASSEMBLY__
 
 /****************************************************************************
  * Public Types
@@ -74,7 +73,7 @@ struct riscv_percpu_s
 void riscv_percpu_init(void);
 
 /****************************************************************************
- * Name: riscv_percpu_get_addr
+ * Name: riscv_percpu_add_hart
  *
  * Description:
  *   Get add a hart to the per CPU area