diff --git a/libc/syslog/lib_setlogmask.c b/libc/syslog/lib_setlogmask.c index f51572e408..2179b7b6a9 100644 --- a/libc/syslog/lib_setlogmask.c +++ b/libc/syslog/lib_setlogmask.c @@ -1,7 +1,7 @@ /**************************************************************************** * lib/syslog/lib_setlogmask.c * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ #include #include -#include +#include #include "syslog/syslog.h" @@ -97,11 +97,11 @@ int setlogmask(int mask) * as interrupts. */ - flags = irqsave(); + flags = enter_critical_section(); oldmask = g_syslog_mask; g_syslog_mask = (uint8_t)mask; - irqrestore(flags); + leave_critical_section(flags); return oldmask; } diff --git a/libc/unistd/lib_gethostname.c b/libc/unistd/lib_gethostname.c index ec12b5afe5..c21b9157b3 100644 --- a/libc/unistd/lib_gethostname.c +++ b/libc/unistd/lib_gethostname.c @@ -2,7 +2,7 @@ * libc/unistd/lib_gethostname.c * * Copyright (C) 2015 Stavros Polymenis. All rights reserved. - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2016 Gregory Nutt. All rights reserved. * Author: Stavros Polymenis * Gregory Nutt * @@ -45,7 +45,7 @@ #include #include -#include +#include /* This file is only compiled if network support is enabled */ @@ -119,9 +119,9 @@ int gethostname(FAR char *name, size_t namelen) * that it could change while we are copying it. */ - flags = irqsave(); + flags = enter_critical_section(); strncpy(name, g_hostname, namelen); - irqrestore(flags); + leave_critical_section(flags); return 0; diff --git a/libc/unistd/lib_sethostname.c b/libc/unistd/lib_sethostname.c index 2546e0fce9..8d51c74971 100644 --- a/libc/unistd/lib_sethostname.c +++ b/libc/unistd/lib_sethostname.c @@ -2,7 +2,9 @@ * libc/unistd/lib_gethostname.c * * Copyright (C) 2015 Stavros Polymenis. All rights reserved. + * Copyright (C) 2015, 2016 Gregory Nutt. All rights reserved. * Author: Stavros Polymenis + * Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,7 +44,7 @@ #include #include -#include +#include /* This file is only compiled if network support is enabled */ @@ -118,10 +120,10 @@ int sethostname(FAR const char *name, size_t size) * are setting it. */ - flags = irqsave(); + flags = enter_critical_section(); strncpy(g_hostname, name, MIN(HOST_NAME_MAX, size)); g_hostname[HOST_NAME_MAX] = '\0'; - irqrestore(flags); + leave_critical_section(flags); return 0; } diff --git a/mm/mm_gran/mm_grancritical.c b/mm/mm_gran/mm_grancritical.c index ae16a39844..a105f03a07 100644 --- a/mm/mm_gran/mm_grancritical.c +++ b/mm/mm_gran/mm_grancritical.c @@ -1,7 +1,7 @@ /**************************************************************************** * mm/mm_gran/mm_grancritical.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include "mm_gran/mm_gran.h" @@ -83,7 +83,7 @@ void gran_enter_critical(FAR struct gran_s *priv) { #ifdef CONFIG_GRAN_INTR - priv->irqstate = irqsave(); + priv->irqstate = enter_critical_section(); #else int ret; @@ -104,7 +104,7 @@ void gran_enter_critical(FAR struct gran_s *priv) void gran_leave_critical(FAR struct gran_s *priv) { #ifdef CONFIG_GRAN_INTR - irqrestore(priv->irqstate); + leave_critical_section(priv->irqstate); #else sem_post(&priv->exclsem); #endif