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

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

commit 77c74bf6287f1fb7f3dd0a169669029737840823
Author: wangzhi16 <[email protected]>
AuthorDate: Wed Mar 4 09:51:27 2026 +0800

    irq: add irq_save/irq_restore wrapper and replace up_irq_save calls
    
    Add irq_save()/irq_restore() as architecture-independent wrapper APIs
    in include/nuttx/irq.h. These wrappers call the arch-level
    up_irq_save()/up_irq_restore() and provide a single instrumentation
    point for future IRQ disabled duration monitoring.
    
    Replace all up_irq_save/up_irq_restore call sites in upper-layer code
    (include/, sched/, drivers/, mm/, libs/, boards/) with the new
    irq_save/irq_restore APIs.
    
    Arch-layer code (arch/) is intentionally left unchanged, as those are
    low-level hardware operations that should not be instrumented.
    
    Assisted-By: mimo-v2.6-pro
    Co-authored-by: ouyangxiangzhen <[email protected]>
    Signed-off-by: wangzhi16 <[email protected]>
    Signed-off-by: ouyangxiangzhen <[email protected]>
---
 boards/arm/sama5/sama5d3x-ek/src/nor_main.c        |  2 +-
 boards/arm/sama5/sama5d4-ek/src/dram_main.c        |  2 +-
 .../stm32l4/nucleo-l476rg/src/stm32_ajoystick.c    |  4 +-
 boards/z80/ez80/makerlisp/src/sd_main.c            |  2 +-
 boards/z80/ez80/z20x/src/sd_main.c                 |  2 +-
 boards/z80/z80/z80sim/src/z80_irq.c                |  2 +-
 drivers/power/pm/pm_idle.c                         |  8 +--
 drivers/sensors/hyt271_uorb.c                      |  4 +-
 drivers/serial/uart_pl011.c                        |  6 +-
 drivers/syslog/ramlog.c                            |  6 +-
 include/nuttx/hwspinlock/hwspinlock.h              |  8 +--
 include/nuttx/seqlock.h                            |  4 +-
 include/nuttx/spinlock.h                           | 82 +++++++++++-----------
 include/nuttx/timers/oneshot.h                     |  8 +--
 include/nuttx/wdog.h                               |  4 +-
 mm/tlsf/mm_tlsf.c                                  |  4 +-
 sched/irq/irq_unexpectedisr.c                      |  2 +-
 sched/paging/pg_worker.c                           |  2 +-
 18 files changed, 76 insertions(+), 76 deletions(-)

diff --git a/boards/arm/sama5/sama5d3x-ek/src/nor_main.c 
b/boards/arm/sama5/sama5d3x-ek/src/nor_main.c
index ccee832112b..e4c1730920e 100644
--- a/boards/arm/sama5/sama5d3x-ek/src/nor_main.c
+++ b/boards/arm/sama5/sama5d3x-ek/src/nor_main.c
@@ -128,7 +128,7 @@ int nor_main(int argc, char *argv[])
    * will hang when the interrupts are disabled!
    */
 
-  up_irq_save();
+  irq_save();
 
   /* Disable MATRIX write protection */
 
diff --git a/boards/arm/sama5/sama5d4-ek/src/dram_main.c 
b/boards/arm/sama5/sama5d4-ek/src/dram_main.c
index 3d812500f62..50f82a31485 100644
--- a/boards/arm/sama5/sama5d4-ek/src/dram_main.c
+++ b/boards/arm/sama5/sama5d4-ek/src/dram_main.c
@@ -140,7 +140,7 @@ int dram_main(int argc, char *argv[])
    * hang when the interrupts are disabled!
    */
 
-  up_irq_save();
+  irq_save();
 
   /* Disable the caches and the MMU.  Disabling the MMU should be safe here
    * because there is a 1-to-1 identity mapping between the physical and
diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_ajoystick.c 
b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_ajoystick.c
index 86425c8a170..1b80af4d6a4 100644
--- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_ajoystick.c
+++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_ajoystick.c
@@ -394,13 +394,13 @@ static void ajoy_disable(void)
 
   /* Disable each joystick interrupt */
 
-  flags = up_irq_save();
+  flags = irq_save();
   for (i = 0; i < AJOY_NGPIOS; i++)
     {
       stm32_gpiosetevent(g_joygpio[i], false, false, false, NULL, NULL);
     }
 
-  up_irq_restore(flags);
+  irq_restore(flags);
 
   /* Nullify the handler and argument */
 
diff --git a/boards/z80/ez80/makerlisp/src/sd_main.c 
b/boards/z80/ez80/makerlisp/src/sd_main.c
index 25f57661403..ceb6bc6121a 100644
--- a/boards/z80/ez80/makerlisp/src/sd_main.c
+++ b/boards/z80/ez80/makerlisp/src/sd_main.c
@@ -140,7 +140,7 @@ int sd_main(int argc, char *argv[])
 
   /* Interrupts must be disabled through the following. */
 
-  up_irq_save();
+  irq_save();
 
   /* Then jump into SRAM via the reset vector at 0x040000 */
 
diff --git a/boards/z80/ez80/z20x/src/sd_main.c 
b/boards/z80/ez80/z20x/src/sd_main.c
index 086bd711568..8703dd72bce 100644
--- a/boards/z80/ez80/z20x/src/sd_main.c
+++ b/boards/z80/ez80/z20x/src/sd_main.c
@@ -135,7 +135,7 @@ int sd_main(int argc, char *argv[])
 
   /* Interrupts must be disabled through the following. */
 
-  up_irq_save();
+  irq_save();
 
   /* Then jump into SRAM via the reset vector at 0x040000 */
 
diff --git a/boards/z80/z80/z80sim/src/z80_irq.c 
b/boards/z80/z80/z80sim/src/z80_irq.c
index 30e3c76f77d..a28b4d55677 100644
--- a/boards/z80/z80/z80sim/src/z80_irq.c
+++ b/boards/z80/z80/z80sim/src/z80_irq.c
@@ -61,6 +61,6 @@ void up_irqinitialize(void)
 #ifndef CONFIG_SUPPRESS_INTERRUPTS
   /* And finally, enable interrupts (including the timer) */
 
-  up_irq_restore(Z80_C_FLAG);
+  irq_restore(Z80_C_FLAG);
 #endif
 }
diff --git a/drivers/power/pm/pm_idle.c b/drivers/power/pm/pm_idle.c
index 7c5ba1a0bce..8ffe82afd4f 100644
--- a/drivers/power/pm/pm_idle.c
+++ b/drivers/power/pm/pm_idle.c
@@ -151,7 +151,7 @@ void pm_idle(pm_idle_handler_t handler)
    * be delayed after WFI until next sched unlock. which is not acceptable.
    */
 
-  flags = up_irq_save();
+  flags = irq_save();
   sched_lock();
 
   oldstate = pm_querystate(domain);
@@ -205,7 +205,7 @@ void pm_idle(pm_idle_handler_t handler)
    * execution will be better decrease scheduler context switch times.
    */
 
-  up_irq_restore(flags);
+  irq_restore(flags);
   sched_unlock();
 }
 
@@ -236,7 +236,7 @@ void pm_idle(pm_idle_handler_t handler)
    * be delayed after WFI until next sched unlock. which is not acceptable.
    */
 
-  flags = up_irq_save();
+  flags = irq_save();
   sched_lock();
 
   newstate = pm_checkstate(PM_IDLE_DOMAIN);
@@ -254,7 +254,7 @@ void pm_idle(pm_idle_handler_t handler)
    * will be better decrease scheduler context switch times.
    */
 
-  up_irq_restore(flags);
+  irq_restore(flags);
   sched_unlock();
 }
 
diff --git a/drivers/sensors/hyt271_uorb.c b/drivers/sensors/hyt271_uorb.c
index 207a7566d91..8080c7cca8e 100644
--- a/drivers/sensors/hyt271_uorb.c
+++ b/drivers/sensors/hyt271_uorb.c
@@ -454,7 +454,7 @@ static int hyt271_change_addr(FAR struct hyt271_dev_s *dev, 
uint8_t addr)
    * others.
    */
 
-  irq_flags = up_irq_save();
+  irq_flags = irq_save();
 
   /* Power on reset the bus.
    * Entering in command mode must be done within the next 10 ms after power
@@ -472,7 +472,7 @@ static int hyt271_change_addr(FAR struct hyt271_dev_s *dev, 
uint8_t addr)
 
   /* The chip should be in command mode now */
 
-  up_irq_restore(irq_flags);
+  irq_restore(irq_flags);
 
   if (ret < 0)
     {
diff --git a/drivers/serial/uart_pl011.c b/drivers/serial/uart_pl011.c
index 0890cf2256b..d5e47cd16e6 100644
--- a/drivers/serial/uart_pl011.c
+++ b/drivers/serial/uart_pl011.c
@@ -960,7 +960,7 @@ static int pl011_setup(FAR struct uart_dev_s *dev)
   pl011_platform_setup((uint32_t)config->uart);
 #endif
 
-  i_flags = up_irq_save();
+  i_flags = irq_save();
 
   /* If working in SBSA mode, we assume that UART is already configured,
    * or does not require configuration at all (if UART is emulated by
@@ -980,7 +980,7 @@ static int pl011_setup(FAR struct uart_dev_s *dev)
                                data->baud_rate);
       if (ret != 0)
         {
-          up_irq_restore(i_flags);
+          irq_restore(i_flags);
           return ret;
         }
 
@@ -1008,7 +1008,7 @@ static int pl011_setup(FAR struct uart_dev_s *dev)
       config->uart->cr  |= PL011_CR_RXE | PL011_CR_TXE;
     }
 
-  up_irq_restore(i_flags);
+  irq_restore(i_flags);
   pl011_enable(sport);
 
   return 0;
diff --git a/drivers/syslog/ramlog.c b/drivers/syslog/ramlog.c
index 4a2a40291cc..22ecdc01ec0 100644
--- a/drivers/syslog/ramlog.c
+++ b/drivers/syslog/ramlog.c
@@ -381,7 +381,7 @@ static ssize_t ramlog_addbuf(FAR struct ramlog_dev_s *priv,
     }
   else
     {
-      flags = up_irq_save();
+      flags = irq_save();
     }
 
   if (ramlog_ratelimit(priv))
@@ -392,7 +392,7 @@ static ssize_t ramlog_addbuf(FAR struct ramlog_dev_s *priv,
         }
       else
         {
-          up_irq_restore(flags);
+          irq_restore(flags);
         }
 
       return len;
@@ -457,7 +457,7 @@ static ssize_t ramlog_addbuf(FAR struct ramlog_dev_s *priv,
     }
   else
     {
-      up_irq_restore(flags);
+      irq_restore(flags);
     }
 
   return len;
diff --git a/include/nuttx/hwspinlock/hwspinlock.h 
b/include/nuttx/hwspinlock/hwspinlock.h
index 259248d5d54..ff959a51ef1 100644
--- a/include/nuttx/hwspinlock/hwspinlock.h
+++ b/include/nuttx/hwspinlock/hwspinlock.h
@@ -68,13 +68,13 @@ static inline bool hwspin_trylock(FAR struct 
hwspinlock_dev_s *dev)
 static inline bool hwspin_trylock_irqsave(FAR struct hwspinlock_dev_s *dev,
                                           FAR irqstate_t *flags)
 {
-  *flags = up_irq_save();
+  *flags = irq_save();
   if (hwspin_trylock(dev))
     {
       return true;
     }
 
-  up_irq_restore(*flags);
+  irq_restore(*flags);
   return false;
 }
 
@@ -92,7 +92,7 @@ static inline void hwspin_lock(FAR struct hwspinlock_dev_s 
*dev)
 static inline irqstate_t
 hwspin_lock_irqsave(FAR struct hwspinlock_dev_s *dev)
 {
-  irqstate_t flags = up_irq_save();
+  irqstate_t flags = irq_save();
   hwspin_lock(dev);
   return flags;
 }
@@ -106,7 +106,7 @@ static inline void hwspin_unlock_restore(FAR struct 
hwspinlock_dev_s *dev,
                                          irqstate_t flags)
 {
   hwspin_unlock(dev);
-  up_irq_restore(flags);
+  irq_restore(flags);
 }
 
 #ifdef __cplusplus
diff --git a/include/nuttx/seqlock.h b/include/nuttx/seqlock.h
index 6761956ea55..633bc4671f3 100644
--- a/include/nuttx/seqlock.h
+++ b/include/nuttx/seqlock.h
@@ -149,7 +149,7 @@ uint32_t read_seqretry(FAR const seqcount_t *s, uint32_t 
start)
 static inline_function
 irqstate_t write_seqlock_irqsave(FAR seqcount_t *s)
 {
-  irqstate_t flags = up_irq_save();
+  irqstate_t flags = irq_save();
 
 #ifdef CONFIG_SMP
   for (; ; )
@@ -199,7 +199,7 @@ void write_sequnlock_irqrestore(FAR seqcount_t *s, 
irqstate_t flags)
 #ifdef CONFIG_SMP
   atomic_set_release((FAR atomic_t *)&s->sequence, s->sequence + 1u);
 #endif
-  up_irq_restore(flags);
+  irq_restore(flags);
 }
 
 #if defined(__cplusplus)
diff --git a/include/nuttx/spinlock.h b/include/nuttx/spinlock.h
index e242f287bef..c8a930258a4 100644
--- a/include/nuttx/spinlock.h
+++ b/include/nuttx/spinlock.h
@@ -466,14 +466,14 @@ static inline_function
 irqstate_t spin_lock_irqsave_notrace(FAR volatile spinlock_t *lock)
 {
   irqstate_t flags;
-  flags = up_irq_save();
+  flags = irq_save();
 
   spin_lock_notrace(lock);
 
   return flags;
 }
 #else
-#  define spin_lock_irqsave_notrace(l) ((void)(l), up_irq_save())
+#  define spin_lock_irqsave_notrace(l) ((void)(l), irq_save())
 #endif
 
 /****************************************************************************
@@ -489,7 +489,7 @@ irqstate_t spin_lock_irqsave_notrace(FAR volatile 
spinlock_t *lock)
  *     with kernel APIs which suspend a caller thread. (e.g. nxsem_wait)
  *
  *   If SMP is not enabled:
- *     This function is equivalent to up_irq_save().
+ *     This function is equivalent to irq_save().
  *
  * Input Parameters:
  *   lock - Caller specific spinlock. not NULL.
@@ -537,7 +537,7 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
   return flags;
 }
 #else
-#  define spin_lock_irqsave(l) ((void)(l), up_irq_save())
+#  define spin_lock_irqsave(l) ((void)(l), irq_save())
 #endif
 
 /****************************************************************************
@@ -553,7 +553,7 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
  *     with kernel APIs which suspend a caller thread. (e.g. nxsem_wait)
  *
  *   If SMP is not enabled:
- *     This function is equivalent to up_irq_save() + sched_lock().
+ *     This function is equivalent to irq_save() + sched_lock().
  *
  * Input Parameters:
  *   lock - Caller specific spinlock. not NULL.
@@ -690,7 +690,7 @@ uint16_t rspin_lock_count(FAR volatile rspinlock_t *lock)
  *     Will take spinlock each cpu first call.
  *
  *   If SPINLOCK is not enabled:
- *     Equivalent to up_irq_save() + sched_lock().
+ *     Equivalent to irq_save() + sched_lock().
  *     Will only sched_lock once when first called.
  *
  * Input Parameters:
@@ -762,12 +762,12 @@ void rspin_lock(FAR rspinlock_t *lock);
 static inline_function
 irqstate_t rspin_lock_irqsave(FAR rspinlock_t *lock)
 {
-  irqstate_t flags = up_irq_save();
+  irqstate_t flags = irq_save();
   rspin_lock(lock);
   return flags;
 }
 #else
-#  define rspin_lock_irqsave(l) ((void)(l), up_irq_save())
+#  define rspin_lock_irqsave(l) ((void)(l), irq_save())
 #endif
 
 static inline_function
@@ -792,7 +792,7 @@ irqstate_t rspin_lock_irqsave_nopreempt(FAR rspinlock_t 
*lock)
  *     Will take spinlock each cpu first call.
  *
  *   If SPINLOCK is not enabled:
- *     Equivalent to up_irq_save() + sched_lock().
+ *     Equivalent to irq_save() + sched_lock().
  *     Will only sched_lock once when first called.
  *
  * Input Parameters:
@@ -853,15 +853,15 @@ bool rspin_trylock(FAR rspinlock_t *lock);
 
 #  define rspin_trylock_irqsave(l, f) \
     ({ \
-      (f) = up_irq_save(); \
+      (f) = irq_save(); \
       rspin_trylock(l) ? \
-      true : ({ up_irq_restore(f); false; }); \
+      true : ({ irq_restore(f); false; }); \
     })
 #else
 #  define rspin_trylock_irqsave(l, f) \
     ({ \
       (void)(l); \
-      (f) = up_irq_save(); \
+      (f) = irq_save(); \
       true; \
     })
 #endif
@@ -898,15 +898,15 @@ bool rspin_trylock(FAR rspinlock_t *lock);
 #ifdef CONFIG_SPINLOCK
 #  define spin_trylock_irqsave_notrace(l, f) \
 ({ \
-  f = up_irq_save(); \
+  f = irq_save(); \
   spin_trylock_notrace(l) ? \
-  true : ({ up_irq_restore(f); false; }); \
+  true : ({ irq_restore(f); false; }); \
 })
 #else
 #  define spin_trylock_irqsave_notrace(l, f) \
 ({ \
   (void)(l); \
-  f = up_irq_save(); \
+  f = irq_save(); \
   true; \
 })
 #endif /* CONFIG_SPINLOCK */
@@ -934,15 +934,15 @@ bool rspin_trylock(FAR rspinlock_t *lock);
 #ifdef CONFIG_SPINLOCK
 #  define spin_trylock_irqsave(l, f) \
 ({ \
-  f = up_irq_save(); \
+  f = irq_save(); \
   spin_trylock(l) ? \
-  true : ({ up_irq_restore(f); false; }); \
+  true : ({ irq_restore(f); false; }); \
 })
 #else
 #  define spin_trylock_irqsave(l, f) \
 ({ \
   (void)(l); \
-  f = up_irq_save(); \
+  f = irq_save(); \
   true; \
 })
 #endif /* CONFIG_SPINLOCK */
@@ -986,10 +986,10 @@ void spin_unlock_irqrestore_notrace(FAR volatile 
spinlock_t *lock,
 {
   spin_unlock_notrace(lock);
 
-  up_irq_restore(flags);
+  irq_restore(flags);
 }
 #else
-#  define spin_unlock_irqrestore_notrace(l, f) ((void)(l), up_irq_restore(f))
+#  define spin_unlock_irqrestore_notrace(l, f) ((void)(l), irq_restore(f))
 #endif
 
 /****************************************************************************
@@ -1001,7 +1001,7 @@ void spin_unlock_irqrestore_notrace(FAR volatile 
spinlock_t *lock,
  *     to the previous call to spin_lock_irqsave(lock).
  *
  *   If SMP is not enabled:
- *     This function is equivalent to up_irq_restore().
+ *     This function is equivalent to irq_restore().
  *
  * Input Parameters:
  *   lock - Caller specific spinlock. not NULL
@@ -1031,7 +1031,7 @@ void spin_unlock_irqrestore(FAR volatile spinlock_t 
*lock, irqstate_t flags)
   spinlock_mark_unlocked(&lock->info);
 }
 #else
-#  define spin_unlock_irqrestore(l, f) ((void)(l), up_irq_restore(f))
+#  define spin_unlock_irqrestore(l, f) ((void)(l), irq_restore(f))
 #endif
 
 /****************************************************************************
@@ -1044,7 +1044,7 @@ void spin_unlock_irqrestore(FAR volatile spinlock_t 
*lock, irqstate_t flags)
  *     spin_unlock_irqrestore_nopreempt(lock).
  *
  *   If SMP is not enabled:
- *     This function is equivalent to up_irq_restore() + sched_unlock().
+ *     This function is equivalent to irq_restore() + sched_unlock().
  *
  * Input Parameters:
  *   lock - Caller specific spinlock. not NULL
@@ -1078,7 +1078,7 @@ void spin_unlock_irqrestore_nopreempt(FAR volatile 
spinlock_t *lock,
  *     Will release spinlock each cpu last call.
  *
  *   If SPINLOCK is not enabled:
- *     Equivalent to sched_unlock() + up_irq_restore().
+ *     Equivalent to sched_unlock() + irq_restore().
  *     Will only sched_unlock once when last called.
  *
  * Input Parameters:
@@ -1123,13 +1123,13 @@ void rspin_unlock_irqrestore(FAR rspinlock_t *lock, 
irqstate_t flags)
 {
   if (rspin_unlock(lock))
     {
-      up_irq_restore(flags);
+      irq_restore(flags);
     }
 
-  /* If not last rspinlock restore,  up_irq_restore should not required */
+  /* If not last rspinlock restore,  irq_restore should not required */
 }
 #else
-#  define rspin_unlock_irqrestore(l, f) ((void)(l), up_irq_restore(f))
+#  define rspin_unlock_irqrestore(l, f) ((void)(l), irq_restore(f))
 #endif
 
 static inline_function
@@ -1462,7 +1462,7 @@ static inline_function void write_unlock(FAR volatile 
rwlock_t *lock)
  *     with kernel APIs which suspend a caller thread. (e.g. nxsem_wait)
  *
  *   If SMP is not enabled:
- *     This function is equivalent to up_irq_save().
+ *     This function is equivalent to irq_save().
  *
  * Input Parameters:
  *   lock - Caller specific spinlock, not NULL.
@@ -1477,14 +1477,14 @@ static inline_function void write_unlock(FAR volatile 
rwlock_t *lock)
 static inline_function irqstate_t read_lock_irqsave(FAR rwlock_t *lock)
 {
   irqstate_t ret;
-  ret = up_irq_save();
+  ret = irq_save();
 
   read_lock(lock);
 
   return ret;
 }
 #else
-#  define read_lock_irqsave(l) ((void)(l), up_irq_save())
+#  define read_lock_irqsave(l) ((void)(l), irq_save())
 #endif
 
 /****************************************************************************
@@ -1497,7 +1497,7 @@ static inline_function irqstate_t read_lock_irqsave(FAR 
rwlock_t *lock)
  *     read_lock_irqsave(lock).
  *
  *   If SMP is not enabled:
- *     This function is equivalent to up_irq_restore().
+ *     This function is equivalent to irq_restore().
  *
  * Input Parameters:
  *   lock - Caller specific spinlock, not NULL.
@@ -1515,10 +1515,10 @@ static inline_function
 void read_unlock_irqrestore(rwlock_t *lock, irqstate_t flags)
 {
   read_unlock(lock);
-  up_irq_restore(flags);
+  irq_restore(flags);
 }
 #else
-#  define read_unlock_irqrestore(l, f) ((void)(l), up_irq_restore(f))
+#  define read_unlock_irqrestore(l, f) ((void)(l), irq_restore(f))
 #endif
 
 /****************************************************************************
@@ -1535,7 +1535,7 @@ void read_unlock_irqrestore(rwlock_t *lock, irqstate_t 
flags)
  *     with kernel APIs which suspend a caller thread. (e.g. nxsem_wait)
  *
  *   If SMP is not enabled:
- *     This function is equivalent to up_irq_save().
+ *     This function is equivalent to irq_save().
  *
  * Input Parameters:
  *   lock - Caller specific spinlock, not NULL.
@@ -1550,14 +1550,14 @@ void read_unlock_irqrestore(rwlock_t *lock, irqstate_t 
flags)
 static inline_function irqstate_t write_lock_irqsave(rwlock_t *lock)
 {
   irqstate_t ret;
-  ret = up_irq_save();
+  ret = irq_save();
 
   write_lock(lock);
 
   return ret;
 }
 #else
-#  define write_lock_irqsave(l) ((void)(l), up_irq_save())
+#  define write_lock_irqsave(l) ((void)(l), irq_save())
 #endif
 
 /****************************************************************************
@@ -1570,7 +1570,7 @@ static inline_function irqstate_t 
write_lock_irqsave(rwlock_t *lock)
  *     write_lock_irqsave(lock).
  *
  *   If SMP is not enabled:
- *     This function is equivalent to up_irq_restore().
+ *     This function is equivalent to irq_restore().
  *
  * Input Parameters:
  *   lock - Caller specific spinlock, not NULL.
@@ -1589,10 +1589,10 @@ void write_unlock_irqrestore(rwlock_t *lock, irqstate_t 
flags)
 {
   write_unlock(lock);
 
-  up_irq_restore(flags);
+  irq_restore(flags);
 }
 #else
-#  define write_unlock_irqrestore(l, f) ((void)(l), up_irq_restore(f))
+#  define write_unlock_irqrestore(l, f) ((void)(l), irq_restore(f))
 #endif
 
 #endif /* CONFIG_RW_SPINLOCK */
@@ -1614,7 +1614,7 @@ void write_unlock_irqrestore(rwlock_t *lock, irqstate_t 
flags)
 static inline_function
 irqstate_t irq_save_nopreempt(void)
 {
-  irqstate_t flags = up_irq_save();
+  irqstate_t flags = irq_save();
   sched_lock();
 
   return flags;
@@ -1638,7 +1638,7 @@ static inline_function
 void irq_restore_nopreempt(irqstate_t flags)
 {
   sched_unlock();
-  up_irq_restore(flags);
+  irq_restore(flags);
 }
 
 #if defined(__cplusplus)
diff --git a/include/nuttx/timers/oneshot.h b/include/nuttx/timers/oneshot.h
index 879190dc13a..d332017f5ae 100644
--- a/include/nuttx/timers/oneshot.h
+++ b/include/nuttx/timers/oneshot.h
@@ -519,10 +519,10 @@ int oneshot_start_absolute(FAR struct oneshot_lowerhalf_s 
*lower,
     {
       /* IRQ should be disable or the timer will be fired too late. */
 
-      irqstate_t flags = up_irq_save();
+      irqstate_t flags = irq_save();
       clkcnt_t   delay = expected - lower->ops->current(lower);
       lower->ops->start(lower, delay);
-      up_irq_restore(flags);
+      irq_restore(flags);
     }
 #else
   struct timespec curr =
@@ -656,10 +656,10 @@ int oneshot_tick_absolute(FAR struct oneshot_lowerhalf_s 
*lower,
     {
       /* IRQ should be disable or the timer will be fired too late. */
 
-      irqstate_t flags = up_irq_save();
+      irqstate_t flags = irq_save();
       clkcnt_t   delay = expected - lower->ops->current(lower);
       lower->ops->start(lower, delay);
-      up_irq_restore(flags);
+      irq_restore(flags);
     }
 #else
   struct timespec ts;
diff --git a/include/nuttx/wdog.h b/include/nuttx/wdog.h
index 210e765777f..28a0c237cc7 100644
--- a/include/nuttx/wdog.h
+++ b/include/nuttx/wdog.h
@@ -279,10 +279,10 @@ int wd_start_realtime(FAR struct wdog_s *wdog,
   clock_t ticks;
   int ret;
 
-  flags = up_irq_save();
+  flags = irq_save();
   clock_abstime2ticks(CLOCK_REALTIME, realtime, &ticks);
   ret = wd_start(wdog, ticks, wdentry, arg);
-  up_irq_restore(flags);
+  irq_restore(flags);
 
   return ret;
 #else
diff --git a/mm/tlsf/mm_tlsf.c b/mm/tlsf/mm_tlsf.c
index 6b5c5da23d3..bf50345a550 100644
--- a/mm/tlsf/mm_tlsf.c
+++ b/mm/tlsf/mm_tlsf.c
@@ -199,7 +199,7 @@ static void mm_delayfree(struct mm_heap_s *heap, void *mem, 
bool delay);
 static irqstate_t mm_lock_irq(FAR struct mm_heap_s *heap)
 {
   UNUSED(heap);
-  return up_irq_save();
+  return irq_save();
 }
 
 /****************************************************************************
@@ -213,7 +213,7 @@ static irqstate_t mm_lock_irq(FAR struct mm_heap_s *heap)
 static void mm_unlock_irq(FAR struct mm_heap_s *heap, irqstate_t state)
 {
   UNUSED(heap);
-  up_irq_restore(state);
+  irq_restore(state);
 }
 
 #endif
diff --git a/sched/irq/irq_unexpectedisr.c b/sched/irq/irq_unexpectedisr.c
index 4060ebb3fe4..9b889280357 100644
--- a/sched/irq/irq_unexpectedisr.c
+++ b/sched/irq/irq_unexpectedisr.c
@@ -51,7 +51,7 @@ int irq_unexpected_isr(int irq, FAR void *context, FAR void 
*arg)
   UNUSED(context);
   UNUSED(arg);
 
-  up_irq_save();
+  irq_save();
   _err("ERROR irq: %d\n", irq);
   PANIC();
   return OK; /* Won't get here */
diff --git a/sched/paging/pg_worker.c b/sched/paging/pg_worker.c
index 589faa7a331..25a5e98d76c 100644
--- a/sched/paging/pg_worker.c
+++ b/sched/paging/pg_worker.c
@@ -543,7 +543,7 @@ int pg_worker(int argc, FAR char *argv[])
    */
 
   pginfo("Started\n");
-  up_irq_save();
+  irq_save();
   for (; ; )
     {
       /* Wait awhile.  We will wait here until either the configurable

Reply via email to