mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
arch: support customized up_cpu_index() in AMP mode
Some app with same code runs on different cores in AMP mode, need the physical core on which the function is called. Signed-off-by: hujun5 <hujun5@xiaomi.com> Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
This commit is contained in:
@@ -193,7 +193,7 @@ irqstate_t write_lock_irqsave(rwlock_t *lock)
|
||||
|
||||
if (NULL == lock)
|
||||
{
|
||||
int me = up_cpu_index();
|
||||
int me = this_cpu();
|
||||
if (0 == g_irq_rwspin_count[me])
|
||||
{
|
||||
write_lock(&g_irq_rwspin);
|
||||
@@ -243,7 +243,7 @@ void write_unlock_irqrestore(rwlock_t *lock, irqstate_t flags)
|
||||
{
|
||||
if (NULL == lock)
|
||||
{
|
||||
int me = up_cpu_index();
|
||||
int me = this_cpu();
|
||||
DEBUGASSERT(0 < g_irq_rwspin_count[me]);
|
||||
g_irq_rwspin_count[me]--;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user