mirror of
https://github.com/apache/nuttx.git
synced 2025-12-20 04:09:12 +08:00
nuttx/net: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section()
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <nuttx/net/net.h>
|
||||
#include <arch/irq.h>
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
#include "arp/arp.h"
|
||||
|
||||
@@ -104,10 +104,10 @@ void arp_wait_setup(in_addr_t ipaddr, FAR struct arp_notify_s *notify)
|
||||
|
||||
/* Add the wait structure to the list with interrupts disabled */
|
||||
|
||||
flags = irqsave();
|
||||
flags = enter_critical_section();
|
||||
notify->nt_flink = g_arp_waiters;
|
||||
g_arp_waiters = notify;
|
||||
irqrestore(flags);
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -134,7 +134,7 @@ int arp_wait_cancel(FAR struct arp_notify_s *notify)
|
||||
* head of the list).
|
||||
*/
|
||||
|
||||
flags = irqsave();
|
||||
flags = enter_critical_section();
|
||||
for (prev = NULL, curr = g_arp_waiters;
|
||||
curr && curr != notify;
|
||||
prev = curr, curr = curr->nt_flink);
|
||||
@@ -154,7 +154,7 @@ int arp_wait_cancel(FAR struct arp_notify_s *notify)
|
||||
ret = OK;
|
||||
}
|
||||
|
||||
irqrestore(flags);
|
||||
leave_critical_section(flags);
|
||||
(void)sem_destroy(¬ify->nt_sem);
|
||||
return ret;
|
||||
}
|
||||
@@ -184,7 +184,7 @@ int arp_wait(FAR struct arp_notify_s *notify, FAR struct timespec *timeout)
|
||||
* enabled while we wait.
|
||||
*/
|
||||
|
||||
flags = irqsave();
|
||||
flags = enter_critical_section();
|
||||
DEBUGVERIFY(clock_gettime(CLOCK_REALTIME, &abstime));
|
||||
|
||||
abstime.tv_sec += timeout->tv_sec;
|
||||
@@ -220,7 +220,7 @@ int arp_wait(FAR struct arp_notify_s *notify, FAR struct timespec *timeout)
|
||||
|
||||
/* Re-enable interrupts and return the result of the wait */
|
||||
|
||||
irqrestore(flags);
|
||||
leave_critical_section(flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user