mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
nuttx/graphics and include: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section()
This commit is contained in:
+1
-1
Submodule Documentation updated: 0d2a964b20...7711e6eb46
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* nuttx/graphics/nxterm/nxterm_kbdin.c
|
* 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>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -46,22 +46,12 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include <nuttx/irq.h>
|
||||||
|
|
||||||
#include "nxterm.h"
|
#include "nxterm.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NXTERM_NXKBDIN
|
#ifdef CONFIG_NXTERM_NXKBDIN
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Function Prototypes
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* 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++)
|
for (i = 0; i < CONFIG_NXTERM_NPOLLWAITERS; i++)
|
||||||
{
|
{
|
||||||
flags = irqsave();
|
flags = enter_critical_section();
|
||||||
fds = priv->fds[i];
|
fds = priv->fds[i];
|
||||||
if (fds)
|
if (fds)
|
||||||
{
|
{
|
||||||
@@ -91,7 +81,8 @@ static void nxterm_pollnotify(FAR struct nxterm_state_s *priv, pollevent_t event
|
|||||||
sem_post(fds->sem);
|
sem_post(fds->sem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
irqrestore(flags);
|
|
||||||
|
leave_critical_section(flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* include/nuttx/net/net.h
|
* 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>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
#include <semaphore.h>
|
#include <semaphore.h>
|
||||||
|
|
||||||
#ifndef CONFIG_NET_NOINTS
|
#ifndef CONFIG_NET_NOINTS
|
||||||
# include <arch/irq.h>
|
# include <nuttx/irq.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -253,7 +253,7 @@ void net_initialize(void);
|
|||||||
#ifdef CONFIG_NET_NOINTS
|
#ifdef CONFIG_NET_NOINTS
|
||||||
net_lock_t net_lock(void);
|
net_lock_t net_lock(void);
|
||||||
#else
|
#else
|
||||||
# define net_lock() irqsave()
|
# define net_lock() enter_critical_section()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -267,7 +267,7 @@ net_lock_t net_lock(void);
|
|||||||
#ifdef CONFIG_NET_NOINTS
|
#ifdef CONFIG_NET_NOINTS
|
||||||
void net_unlock(net_lock_t flags);
|
void net_unlock(net_lock_t flags);
|
||||||
#else
|
#else
|
||||||
# define net_unlock(f) irqrestore(f)
|
# define net_unlock(f) leave_critical_section(f)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user