nuttx/graphics and include: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section()

This commit is contained in:
Gregory Nutt 2016-02-14 15:09:28 -06:00
parent 046e39e2c6
commit 88c17bb4f2
3 changed files with 11 additions and 20 deletions

@ -1 +1 @@
Subproject commit 0d2a964b20c73ca7c67f6602345f903055c02623
Subproject commit 7711e6eb4606b41a45858ac240e619167c5488d5

View File

@ -1,7 +1,7 @@
/****************************************************************************
* nuttx/graphics/nxterm/nxterm_kbdin.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -46,22 +46,12 @@
#include <errno.h>
#include <debug.h>
#include <nuttx/irq.h>
#include "nxterm.h"
#ifdef CONFIG_NXTERM_NXKBDIN
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -81,7 +71,7 @@ static void nxterm_pollnotify(FAR struct nxterm_state_s *priv, pollevent_t event
for (i = 0; i < CONFIG_NXTERM_NPOLLWAITERS; i++)
{
flags = irqsave();
flags = enter_critical_section();
fds = priv->fds[i];
if (fds)
{
@ -91,7 +81,8 @@ static void nxterm_pollnotify(FAR struct nxterm_state_s *priv, pollevent_t event
sem_post(fds->sem);
}
}
irqrestore(flags);
leave_critical_section(flags);
}
}
#else

View File

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/net/net.h
*
* Copyright (C) 2007, 2009-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009-2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -50,7 +50,7 @@
#include <semaphore.h>
#ifndef CONFIG_NET_NOINTS
# include <arch/irq.h>
# include <nuttx/irq.h>
#endif
/****************************************************************************
@ -253,7 +253,7 @@ void net_initialize(void);
#ifdef CONFIG_NET_NOINTS
net_lock_t net_lock(void);
#else
# define net_lock() irqsave()
# define net_lock() enter_critical_section()
#endif
/****************************************************************************
@ -267,7 +267,7 @@ net_lock_t net_lock(void);
#ifdef CONFIG_NET_NOINTS
void net_unlock(net_lock_t flags);
#else
# define net_unlock(f) irqrestore(f)
# define net_unlock(f) leave_critical_section(f)
#endif
/****************************************************************************