You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by li...@apache.org on 2023/02/02 14:47:41 UTC

[nuttx] branch master updated (984208f6a2 -> be1c84c96a)

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

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


    from 984208f6a2 tools: parsememdump.py support show total pid memory
     new 555c4fede3 spinlock: Move spinlock_init to public macros
     new be1c84c96a mm/mempool: Initialize spinlock with spin_initialize

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 include/nuttx/spinlock.h | 39 ++++++++++++++++++++-------------------
 mm/mempool/mempool.c     |  2 +-
 2 files changed, 21 insertions(+), 20 deletions(-)


[nuttx] 02/02: mm/mempool: Initialize spinlock with spin_initialize

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit be1c84c96af4c69507b18d1051702e71f12608d0
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri Jan 27 20:51:57 2023 +0800

    mm/mempool: Initialize spinlock with spin_initialize
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 mm/mempool/mempool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mempool/mempool.c b/mm/mempool/mempool.c
index 22641fe28f..297e84a6ac 100644
--- a/mm/mempool/mempool.c
+++ b/mm/mempool/mempool.c
@@ -206,7 +206,7 @@ int mempool_init(FAR struct mempool_s *pool, FAR const char *name)
       kasan_poison(base, size);
     }
 
-  pool->lock = 0;
+  spin_initialize(&pool->lock, 0);
   if (pool->wait && pool->expandsize == 0)
     {
       nxsem_init(&pool->waitsem, 0, 0);


[nuttx] 01/02: spinlock: Move spinlock_init to public macros

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 555c4fede3c19b862eb9466761c4f9a4f79c8f86
Author: anjiahao <an...@xiaomi.com>
AuthorDate: Mon Nov 28 16:59:25 2022 +0800

    spinlock: Move spinlock_init to public macros
    
    Signed-off-by: anjiahao <an...@xiaomi.com>
---
 include/nuttx/spinlock.h | 39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/include/nuttx/spinlock.h b/include/nuttx/spinlock.h
index 4d77b8611f..d3b858e9f0 100644
--- a/include/nuttx/spinlock.h
+++ b/include/nuttx/spinlock.h
@@ -128,25 +128,6 @@ static inline spinlock_t up_testset(volatile FAR spinlock_t *lock)
 }
 #endif
 
-/****************************************************************************
- * Name: spin_initialize
- *
- * Description:
- *   Initialize a non-reentrant spinlock object to its initial,
- *   unlocked state.
- *
- * Input Parameters:
- *   lock  - A reference to the spinlock object to be initialized.
- *   state - Initial state of the spinlock {SP_LOCKED or SP_UNLOCKED)
- *
- * Returned Value:
- *   None.
- *
- ****************************************************************************/
-
-/* void spin_initialize(FAR spinlock_t *lock, spinlock_t state); */
-#define spin_initialize(l,s) do { *(l) = (s); } while (0)
-
 /****************************************************************************
  * Name: spin_lock
  *
@@ -351,6 +332,26 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned int cpu,
 
 #endif /* CONFIG_SPINLOCK */
 
+/****************************************************************************
+ * Name: spin_initialize
+ *
+ * Description:
+ *   Initialize a non-reentrant spinlock object to its initial,
+ *   unlocked state.
+ *
+ * Input Parameters:
+ *   lock  - A reference to the spinlock object to be initialized.
+ *   state - Initial state of the spinlock {SP_LOCKED or SP_UNLOCKED)
+ *
+ * Returned Value:
+ *   None.
+ *
+ ****************************************************************************/
+
+/* void spin_initialize(FAR spinlock_t *lock, spinlock_t state); */
+
+#define spin_initialize(l,s) do { *(l) = (s); } while (0)
+
 /****************************************************************************
  * Name: spin_lock_irqsave
  *