xiaoxiang781216 merged PR #10776:
URL: https://github.com/apache/nuttx/pull/10776
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscr...@nu
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359893853
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359893853
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359892463
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
xiaoxiang781216 commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359892358
##
sched/semaphore/spinlock.c:
##
@@ -521,7 +521,7 @@ void read_lock(FAR volatile rwlock_t *lock)
bool read_trylock(FAR volatile rwlock_t *lock)
{
- rwlock
xiaoxiang781216 commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359892040
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359891808
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359891808
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359890835
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
xiaoxiang781216 commented on PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#issuecomment-1763410835
please fix the style issue, @TaiJuWu .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go
xiaoxiang781216 commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359890167
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,234 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
xiaoxiang781216 commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359889589
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
xiaoxiang781216 commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359889532
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359881979
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359881263
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359878907
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359878610
##
sched/semaphore/spinlock.c:
##
@@ -474,7 +474,7 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned int
cpu,
void read_lock(FAR volatile rwlock_t *lock)
{
xiaoxiang781216 commented on PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#issuecomment-1763269226
> > @TaiJuWu please squash the change into one patch.
>
> I prefer maintaining two commits of this PR. The reason is the first one
commit is implementations of rw lock. The
xiaoxiang781216 commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359755758
##
sched/irq/irq_spinlock.c:
##
@@ -45,6 +45,17 @@ static volatile spinlock_t g_irq_spin = SP_UNLOCKED;
static volatile uint8_t g_irq_spin_count[CONFIG_SMP_N
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359587912
##
sched/Kconfig:
##
@@ -318,6 +318,12 @@ config TICKET_SPINLOCK
endif # SPINLOCK
+config RW_SPINLOCK
+ bool "Support read-write Spinlocks"
+ default y
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359587912
##
sched/Kconfig:
##
@@ -318,6 +318,12 @@ config TICKET_SPINLOCK
endif # SPINLOCK
+config RW_SPINLOCK
+ bool "Support read-write Spinlocks"
+ default y
TaiJuWu commented on PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#issuecomment-1763102461
> @TaiJuWu please squash the change into one patch.
I prefer to maintain two commits of this PR.
The reason is the first one commit is implementations of rw lock.
The second is
xiaoxiang781216 commented on PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#issuecomment-1763058232
@TaiJuWu please squash the change into one patch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL
xiaoxiang781216 commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359495720
##
include/nuttx/spinlock.h:
##
@@ -32,6 +32,14 @@
#include
+#ifdef CONFIG_RW_SPINLOCK
+#include
+typedef atomic_int rwlock_t;
Review Comment:
Ok
davids5 commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1359142047
##
sched/irq/irq_spinlock.c:
##
@@ -209,4 +220,202 @@ void spin_unlock_irqrestore_wo_note(spinlock_t *lock,
irqstate_t flags)
up_irq_restore(flags);
}
+#ifdef CO
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1358860001
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1358866963
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1358866963
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1358866963
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354283729
##
include/nuttx/spinlock.h:
##
@@ -32,6 +32,14 @@
#include
+#ifdef CONFIG_RW_SPINLOCK
+#include
+typedef atomic_int rwlock_t;
Review Comment:
It can't.
T
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1358860001
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1358860001
##
sched/semaphore/spinlock.c:
##
@@ -446,4 +446,225 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned
int cpu,
}
#endif
+#ifdef CONFIG_RW_SPINLOCK
+
+/***
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354283729
##
include/nuttx/spinlock.h:
##
@@ -32,6 +32,14 @@
#include
+#ifdef CONFIG_RW_SPINLOCK
+#include
+typedef atomic_int rwlock_t;
Review Comment:
It can't.
T
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354283729
##
include/nuttx/spinlock.h:
##
@@ -32,6 +32,14 @@
#include
+#ifdef CONFIG_RW_SPINLOCK
+#include
+typedef atomic_int rwlock_t;
Review Comment:
It can't.
T
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354283729
##
include/nuttx/spinlock.h:
##
@@ -32,6 +32,14 @@
#include
+#ifdef CONFIG_RW_SPINLOCK
+#include
+typedef atomic_int rwlock_t;
Review Comment:
It can't.
T
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354283729
##
include/nuttx/spinlock.h:
##
@@ -32,6 +32,14 @@
#include
+#ifdef CONFIG_RW_SPINLOCK
+#include
+typedef atomic_int rwlock_t;
Review Comment:
It can't.
T
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354283729
##
include/nuttx/spinlock.h:
##
@@ -32,6 +32,14 @@
#include
+#ifdef CONFIG_RW_SPINLOCK
+#include
+typedef atomic_int rwlock_t;
Review Comment:
It can't.
T
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354283729
##
include/nuttx/spinlock.h:
##
@@ -32,6 +32,14 @@
#include
+#ifdef CONFIG_RW_SPINLOCK
+#include
+typedef atomic_int rwlock_t;
Review Comment:
It can't.
T
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354283729
##
include/nuttx/spinlock.h:
##
@@ -32,6 +32,14 @@
#include
+#ifdef CONFIG_RW_SPINLOCK
+#include
+typedef atomic_int rwlock_t;
Review Comment:
It can't.
T
xiaoxiang781216 commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354649450
##
sched/irq/irq_spinlock.c:
##
@@ -209,4 +220,202 @@ void spin_unlock_irqrestore_wo_note(spinlock_t *lock,
irqstate_t flags)
up_irq_restore(flags);
}
+#
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354294685
##
sched/irq/irq_spinlock.c:
##
@@ -209,4 +220,202 @@ void spin_unlock_irqrestore_wo_note(spinlock_t *lock,
irqstate_t flags)
up_irq_restore(flags);
}
+#ifdef CO
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354294685
##
sched/irq/irq_spinlock.c:
##
@@ -209,4 +220,202 @@ void spin_unlock_irqrestore_wo_note(spinlock_t *lock,
irqstate_t flags)
up_irq_restore(flags);
}
+#ifdef CO
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354283729
##
include/nuttx/spinlock.h:
##
@@ -32,6 +32,14 @@
#include
+#ifdef CONFIG_RW_SPINLOCK
+#include
+typedef atomic_int rwlock_t;
Review Comment:
It can't.
T
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354283729
##
include/nuttx/spinlock.h:
##
@@ -32,6 +32,14 @@
#include
+#ifdef CONFIG_RW_SPINLOCK
+#include
+typedef atomic_int rwlock_t;
Review Comment:
It can't.
T
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354294685
##
sched/irq/irq_spinlock.c:
##
@@ -209,4 +220,202 @@ void spin_unlock_irqrestore_wo_note(spinlock_t *lock,
irqstate_t flags)
up_irq_restore(flags);
}
+#ifdef CO
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354294685
##
sched/irq/irq_spinlock.c:
##
@@ -209,4 +220,202 @@ void spin_unlock_irqrestore_wo_note(spinlock_t *lock,
irqstate_t flags)
up_irq_restore(flags);
}
+#ifdef CO
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354294685
##
sched/irq/irq_spinlock.c:
##
@@ -209,4 +220,202 @@ void spin_unlock_irqrestore_wo_note(spinlock_t *lock,
irqstate_t flags)
up_irq_restore(flags);
}
+#ifdef CO
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354295219
##
sched/semaphore/spinlock.c:
##
@@ -36,6 +36,11 @@
# include
#endif
+#ifdef CONFIG_RW_SPINLOCK
+# include
+const static rwlock_t unlocked = RW_SP_UNLOCKED;
R
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354294685
##
sched/irq/irq_spinlock.c:
##
@@ -209,4 +220,202 @@ void spin_unlock_irqrestore_wo_note(spinlock_t *lock,
irqstate_t flags)
up_irq_restore(flags);
}
+#ifdef CO
TaiJuWu commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354283729
##
include/nuttx/spinlock.h:
##
@@ -32,6 +32,14 @@
#include
+#ifdef CONFIG_RW_SPINLOCK
+#include
+typedef atomic_int rwlock_t;
Review Comment:
It can't.
T
xiaoxiang781216 commented on code in PR #10776:
URL: https://github.com/apache/nuttx/pull/10776#discussion_r1354144604
##
sched/irq/irq_spinlock.c:
##
@@ -45,6 +45,17 @@ static volatile spinlock_t g_irq_spin = SP_UNLOCKED;
static volatile uint8_t g_irq_spin_count[CONFIG_SMP_N
51 matches
Mail list logo