#include <errno.h>
#include <debug.h>
-#include <tinyara/fs/fs.h>
#include <tinyara/arch.h>
+#include <tinyara/semaphore.h>
+#include <tinyara/fs/fs.h>
#include <tinyara/analog/dac.h>
#include <arch/irq.h>
dev->ad_ocount = 0;
+ /* Initialize semaphores */
sem_init(&dev->ad_xmit.af_sem, 0, 0);
sem_init(&dev->ad_closesem, 0, 1);
+ /*
+ * The transmit semaphore is used for signaling and, hence, should
+ * not have priority inheritance enabled.
+ */
+ sem_setprotocol(&dev->ad_xmit.af_sem, SEM_PRIO_NONE);
+
dev->ad_ops->ao_reset(dev);
return register_driver(path, &dac_fops, 0555, dev);
#include <errno.h>
#include <debug.h>
-#include <tinyara/fs/fs.h>
#include <tinyara/arch.h>
+#include <tinyara/semaphore.h>
+#include <tinyara/fs/fs.h>
#include <tinyara/can.h>
#include <arch/irq.h>
dev->cd_ocount = 0;
+ /* Initialize semaphores */
sem_init(&dev->cd_xmit.tx_sem, 0, 0);
sem_init(&dev->cd_recv.rx_sem, 0, 0);
sem_init(&dev->cd_closesem, 0, 1);
for (i = 0; i < CONFIG_CAN_NPENDINGRTR; i++) {
+ /*
+ * Initialize wait semaphores. These semaphores are used for
+ * signaling and should not have priority inheritance enabled.
+ */
sem_init(&dev->cd_rtr[i].cr_sem, 0, 0);
+ sem_setprotocol(&dev->cd_rtr[i].cr_sem. SEM_PRIO_NONE);
dev->cd_rtr[i].cr_msg = NULL;
dev->cd_npendrtr--;
}
#include <assert.h>
#include <debug.h>
-#include <tinyara/kmalloc.h>
-#include <tinyara/fs/fs.h>
#ifdef CONFIG_DEBUG
#include <tinyara/arch.h>
#endif
+#include <tinyara/kmalloc.h>
+#include <tinyara/semaphore.h>
+#include <tinyara/fs/fs.h>
+#include <tinyara/fs/ioctl.h>
#include "pipe_common.h"
sem_init(&dev->d_bfsem, 0, 1);
sem_init(&dev->d_rdsem, 0, 0);
sem_init(&dev->d_wrsem, 0, 0);
+
+ /*
+ * The read/write wait semaphores are used for signaling and,
+ * hence, should not have priority inheritance enabled.
+ */
+ sem_setprotocol(&dev->d_rdsem, SEM_PRIO_NONE);
+ sem_setprotocol(&dev->d_wrsem, SEM_PRIO_NONE);
}
return dev;
/****************************************************************************
* drivers/pwm.c
*
- * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
#include <errno.h>
#include <debug.h>
+#include <tinyara/arch.h>
#include <tinyara/kmalloc.h>
+#include <tinyara/semaphore.h>
#include <tinyara/fs/fs.h>
-#include <tinyara/arch.h>
#include <tinyara/pwm.h>
#include <arch/irq.h>
sem_init(&upper->exclsem, 0, 1);
#ifdef CONFIG_PWM_PULSECOUNT
sem_init(&upper->waitsem, 0, 0);
+
+ /*
+ * The wait semaphore is used for signaling and, hence, should not
+ * have priority inheritance enabled.
+ */
+ sem_setprotocol(&upper->waitsem, SEM_PRIO_NONE);
#endif
+
upper->dev = dev;
/* Register the PWM device */
#include <string.h>
#include "uart.h"
+#include <tinyara/semaphore.h>
#include <tinyara/sercomm/sercomm.h>
/* stubs to make serial driver happy */
sem_init(&dev->pollsem, 0, 1);
#endif
+ sem_setprotocol(&dev->xmitsem, SEM_PRIO_NONE);
+ sem_setprotocol(&dev->recvsem, SEM_PRIO_NONE);
+
dbg("Registering %s\n", path);
return register_driver(path, &g_sercom_console_ops, 0666, NULL);
}
/****************************************************************************
* drivers/syslog/ramlog.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
#include <assert.h>
#include <debug.h>
-#include <tinyara/fs/fs.h>
+#include <tinyara/arch.h>
#include <tinyara/kmalloc.h>
+#include <tinyara/semaphore.h>
#include <tinyara/fs/fs.h>
-#include <tinyara/arch.h>
#include <tinyara/syslog/ramlog.h>
#include <arch/irq.h>
sem_init(&priv->rl_exclsem, 0, 1);
#ifndef CONFIG_RAMLOG_NONBLOCKING
sem_init(&priv->rl_waitsem, 0, 0);
+
+ /*
+ * The rl_waitsem semaphore is used for signaling and, hence,
+ * should not have priority inheritance enabled.
+ */
+ sem_setprotocol(&priv->rl_waitsem, SEM_PRIO_NONE);
#endif
priv->rl_bufsize = buflen;
priv->rl_buffer = buffer;
#include <tinyara/kmalloc.h>
#include <tinyara/kthread.h>
#include <tinyara/arch.h>
+#include <tinyara/semaphore.h>
#include <tinyara/fs/fs.h>
#include <tinyara/usb/usb.h>
#include <tinyara/usb/storage.h>
priv = &alloc->dev;
memset(priv, 0, sizeof(struct usbmsc_dev_s));
+ /* Initialize semaphores */
sem_init(&priv->thsynch, 0, 0);
sem_init(&priv->thlock, 0, 1);
sem_init(&priv->thwaitsem, 0, 0);
+
+ /*
+ * The thsynch and thwaitsem semaphores are used for signaling and,
+ * hence, should not have priority inheritance enabled.
+ */
+ sem_setprotocol(&priv->thsynch, SEM_PRIO_NONE);
+ sem_setprotocol(&priv->thwaitsem, SEM_PRIO_NONE);
+
sq_init(&priv->wrreqlist);
priv->nluns = nluns;
#include <tinyara/fs/fs.h>
#include <tinyara/arch.h>
#include <tinyara/wqueue.h>
+#include <tinyara/semaphore.h>
#include <tinyara/usb/usb.h>
#include <tinyara/usb/usbhost.h>
sem_init(&priv->exclsem, 0, 1);
sem_init(&priv->waitsem, 0, 0);
+ /*
+ * The waitsem semaphore is used for signaling and,
+ * hence, should not have priority inheritance enabled.
+ */
+ sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
+
/* Return the instance of the USB keyboard class driver */
return &priv->usbclass;
sem_init(&g_exclsem, 0, 1);
sem_init(&g_syncsem, 0, 0);
+ /*
+ * The g_syncsem semaphore is used for signaling and, hence, should
+ * not have priority inheritance enabled.
+ */
+ sem_setprotocol(&g_syncsem, SEM_PRIO_NONE);
+
/* Advertise our availability to support (certain) devices */
return usbhost_registerclass(&g_hidkbd);
#include <tinyara/kthread.h>
#include <tinyara/fs/fs.h>
#include <tinyara/wqueue.h>
+#include <tinyara/semaphore.h>
#include <tinyara/usb/usb.h>
#include <tinyara/usb/usbhost.h>
sem_init(&priv->exclsem, 0, 1);
sem_init(&priv->waitsem, 0, 0);
+ /*
+ * The waitsem semaphore is used for signaling and,
+ * hence, should not have priority inheritance enabled.
+ */
+ sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
+
/* Return the instance of the USB mouse class driver */
return &priv->usbclass;
sem_init(&g_exclsem, 0, 1);
sem_init(&g_syncsem, 0, 0);
+ /*
+ * The g_syncsem semaphore is used for signaling and, hence, should
+ * not have priority inheritance enabled.
+ */
+ sem_setprotocol(&g_syncsem, SEM_PRIO_NONE);
+
/* Advertise our availability to support (certain) mouse devices */
return usbhost_registerclass(&g_hidmouse);