nuttx/binfmt: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section()

This commit is contained in:
Gregory Nutt 2016-02-14 08:46:08 -06:00
parent 884d9355c6
commit f45db0313d
2 changed files with 12 additions and 10 deletions

View File

@ -1,7 +1,7 @@
/****************************************************************************
* binfmt/binfmt_execsymtab.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -41,6 +41,7 @@
#include <assert.h>
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/binfmt/symtab.h>
@ -116,10 +117,10 @@ void exec_getsymtab(FAR const struct symtab_s **symtab, FAR int *nsymbols)
* size are returned as a single atomic operation.
*/
flags = irqsave();
flags = enter_critical_section();
*symtab = g_exec_symtab;
*nsymbols = g_exec_nsymbols;
irqrestore(flags);
leave_critical_section(flags);
}
/****************************************************************************
@ -147,10 +148,10 @@ void exec_setsymtab(FAR const struct symtab_s *symtab, int nsymbols)
* size are set as a single atomic operation.
*/
flags = irqsave();
flags = enter_critical_section();
g_exec_symtab = symtab;
g_exec_nsymbols = nsymbols;
irqrestore(flags);
leave_critical_section(flags);
}
#endif /* CONFIG_LIBC_EXECFUNCS */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* binfmt/binfmt_schedunload.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -43,6 +43,7 @@
#include <debug.h>
#include <errno.h>
#include <nuttx/irq.h>
#include <nuttx/kmalloc.h>
#include <nuttx/binfmt/binfmt.h>
@ -105,10 +106,10 @@ static void unload_list_add(pid_t pid, FAR struct binary_s *bin)
* interrupts.
*/
flags = irqsave();
flags = enter_critical_section();
bin->flink = g_unloadhead;
g_unloadhead = bin;
irqrestore(flags);
leave_critical_section(flags);
}
/****************************************************************************
@ -313,13 +314,13 @@ int schedule_unload(pid_t pid, FAR struct binary_s *bin)
/* Emergency removal from the list */
flags = irqsave();
flags = enter_critical_section();
if (unload_list_remove(pid) != bin)
{
blldbg("ERROR: Failed to remove structure\n");
}
irqrestore(flags);
leave_critical_section(flags);
goto errout;
}