Squashed commit of the following:

libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
This commit is contained in:
Gregory Nutt
2017-10-03 12:51:15 -06:00
parent 2997a49e51
commit 83cdb0c552
328 changed files with 895 additions and 792 deletions
+2 -2
View File
@@ -274,8 +274,8 @@ void weak_function up_dmainitialize(void)
/* Initialize the channel list */
sem_init(&g_dmac.exclsem, 0, 1);
sem_init(&g_dmac.chansem, 0, EFM32_DMA_NCHANNELS);
nxsem_init(&g_dmac.exclsem, 0, 1);
nxsem_init(&g_dmac.chansem, 0, EFM32_DMA_NCHANNELS);
for (i = 0; i < EFM32_DMA_NCHANNELS; i++)
{
+2 -2
View File
@@ -673,14 +673,14 @@ static inline void efm32_i2c_sem_post(FAR struct efm32_i2c_priv_s *priv)
static inline void efm32_i2c_sem_init(FAR struct efm32_i2c_priv_s *priv)
{
sem_init(&priv->sem_excl, 0, 1);
nxsem_init(&priv->sem_excl, 0, 1);
#ifndef CONFIG_I2C_POLLED
/* This semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
*/
sem_init(&priv->sem_isr, 0, 0);
nxsem_init(&priv->sem_isr, 0, 0);
sem_setprotocol(&priv->sem_isr, SEM_PRIO_NONE);
#endif
}
+3 -3
View File
@@ -1605,7 +1605,7 @@ static int spi_portinitialize(struct efm32_spidev_s *priv)
/* Initialize the SPI semaphore that enforces mutually exclusive access */
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
#ifdef CONFIG_EFM32_SPI_DMA
/* Allocate two DMA channels... one for the RX and one for the TX side of
@@ -1639,8 +1639,8 @@ static int spi_portinitialize(struct efm32_spidev_s *priv)
/* Initialized semaphores used to wait for DMA completion */
(void)sem_init(&priv->rxdmasem, 0, 0);
(void)sem_init(&priv->txdmasem, 0, 0);
(void)nxsem_init(&priv->rxdmasem, 0, 0);
(void)nxsem_init(&priv->txdmasem, 0, 0);
/* These semaphores are used for signaling and, hence, should not have
* priority inheritance enabled.
+3 -3
View File
@@ -5155,8 +5155,8 @@ static inline void efm32_sw_initialize(FAR struct efm32_usbhost_s *priv)
/* Initialize semaphores */
sem_init(&priv->pscsem, 0, 0);
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->pscsem, 0, 0);
nxsem_init(&priv->exclsem, 0, 1);
/* The pscsem semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
@@ -5186,7 +5186,7 @@ static inline void efm32_sw_initialize(FAR struct efm32_usbhost_s *priv)
* have priority inheritance enabled.
*/
sem_init(&chan->waitsem, 0, 0);
nxsem_init(&chan->waitsem, 0, 0);
sem_setprotocol(&chan->waitsem, SEM_PRIO_NONE);
}
}
+2 -2
View File
@@ -1122,10 +1122,10 @@ FAR struct spi_dev_s *imx_spibus_initialize(int port)
* signaling and, hence, should not have priority inheritance enabled.
*/
sem_init(&priv->waitsem, 0, 0);
nxsem_init(&priv->waitsem, 0, 0);
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
#endif
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
/* Initialize control register: min frequency, ignore ready, master mode, mode=0, 8-bit */
+2 -2
View File
@@ -1308,10 +1308,10 @@ FAR struct spi_dev_s *imx_spibus_initialize(int port)
* signaling and, hence, should not have priority inheritance enabled.
*/
sem_init(&priv->waitsem, 0, 0);
nxsem_init(&priv->waitsem, 0, 0);
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
#endif
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
/* Initialize control register: min frequency, ignore ready, master mode, mode=0, 8-bit */
+2 -2
View File
@@ -316,13 +316,13 @@ static void kinetis_i2c_putreg(struct kinetis_i2cdev_s *priv, uint8_t value,
static inline void kinetis_i2c_sem_init(FAR struct kinetis_i2cdev_s *priv)
{
sem_init(&priv->mutex, 0, 1);
nxsem_init(&priv->mutex, 0, 1);
/* This semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
*/
sem_init(&priv->wait, 0, 0);
nxsem_init(&priv->wait, 0, 0);
sem_setprotocol(&priv->wait, SEM_PRIO_NONE);
}
+1 -1
View File
@@ -2807,7 +2807,7 @@ FAR struct sdio_dev_s *sdhc_initialize(int slotno)
/* Initialize the SDHC slot structure data structure */
/* Initialize semaphores */
sem_init(&priv->waitsem, 0, 0);
nxsem_init(&priv->waitsem, 0, 0);
/* The waitsem semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
+1 -1
View File
@@ -1234,7 +1234,7 @@ FAR struct spi_dev_s *kinetis_spibus_initialize(int port)
/* Initialize the SPI semaphore that enforces mutually exclusive access */
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
return &priv->spidev;
}
+1 -1
View File
@@ -689,7 +689,7 @@ FAR struct spi_dev_s *kl_spibus_initialize(int port)
/* Initialize the SPI semaphore that enforces mutually exclusive access */
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
return &priv->spidev;
}
+2 -2
View File
@@ -535,9 +535,9 @@ FAR struct adc_dev_s *lc823450_adcinitialize(void)
inst->nchannels = CONFIG_ADC_NCHANNELS;
inst->chanlist = lc823450_chanlist;
sem_init(&inst->sem_excl, 0, 1);
nxsem_init(&inst->sem_excl, 0, 1);
#ifndef CONFIG_ADC_POLLED
sem_init(&inst->sem_isr, 0, 0);
nxsem_init(&inst->sem_isr, 0, 0);
#endif
lc823450_adc_sem_wait(inst);
+1 -1
View File
@@ -344,7 +344,7 @@ void up_dmainitialize(void)
sq_init(&g_dma.phydmach[i].req_q);
}
sem_init(&g_dma.exclsem, 0, 1);
nxsem_init(&g_dma.exclsem, 0, 1);
if (irq_attach(LC823450_IRQ_DMAC, dma_interrupt, NULL) != 0)
{
+2 -2
View File
@@ -1114,9 +1114,9 @@ FAR struct i2c_master_s *lc823450_i2cbus_initialize(int port)
if ((volatile int)priv->refs++ == 0)
{
sem_init(&priv->sem_excl, 0, 1);
nxsem_init(&priv->sem_excl, 0, 1);
#ifndef CONFIG_I2C_POLLED
sem_init(&priv->sem_isr, 0, 0);
nxsem_init(&priv->sem_isr, 0, 0);
#endif
(void)lc823450_i2c_init(priv, port);
}
+1 -1
View File
@@ -516,7 +516,7 @@ static FAR struct mtd_dev_s *lc823450_mtd_allocdev(uint32_t channel)
return NULL;
}
sem_init(&priv->sem, 0, 1);
nxsem_init(&priv->sem, 0, 1);
priv->mtd.erase = lc823450_erase;
priv->mtd.bread = lc823450_bread;
+1 -1
View File
@@ -644,7 +644,7 @@ int lc823450_sdc_locked(void)
for (i = 0; i < 2; i++)
{
(void)sem_getvalue(&_sdc_sem[i], &val);
(void)nxsem_getvalue(&_sdc_sem[i], &val);
if (1 != val)
{
ret = 1;
+2 -2
View File
@@ -289,9 +289,9 @@ SINT_T sddep_os_init(struct SdDrCfg_s *cfg)
#ifdef CONFIG_LC823450_SDC_DMA
_hrdma[ch] = lc823450_dmachannel(DMA_CHANNEL_VIRTUAL);
sem_init(&_sem_rwait[ch], 0, 0);
nxsem_init(&_sem_rwait[ch], 0, 0);
_hwdma[ch] = lc823450_dmachannel(DMA_CHANNEL_VIRTUAL);
sem_init(&_sem_wwait[ch], 0, 0);
nxsem_init(&_sem_wwait[ch], 0, 0);
#endif /* CONFIG_LC823450_SDC_DMA */
return 0;
}
+2 -2
View File
@@ -1317,12 +1317,12 @@ void up_serialinit(void)
#ifdef TTYS1_DEV
(void)uart_register("/dev/ttyS1", &TTYS1_DEV);
#ifdef CONFIG_HSUART
sem_init(&g_uart1priv.txdma_wait, 0, 1);
nxsem_init(&g_uart1priv.txdma_wait, 0, 1);
g_uart1priv.htxdma = lc823450_dmachannel(DMA_CHANNEL_UART1TX);
lc823450_dmarequest(g_uart1priv.htxdma, DMA_REQUEST_UART1TX);
sem_init(&g_uart1priv.rxdma_wait, 0, 0);
nxsem_init(&g_uart1priv.rxdma_wait, 0, 0);
g_uart1priv.hrxdma = lc823450_dmachannel(DMA_CHANNEL_UART1RX);
lc823450_dmarequest(g_uart1priv.hrxdma, DMA_REQUEST_UART1RX);
+2 -2
View File
@@ -537,7 +537,7 @@ FAR struct spi_dev_s *lc823450_spibus_initialize(int port)
modifyreg32(MRSTCNTAPB, 0, MRSTCNTAPB_PORT5_RSTB);
#ifndef CONFIG_SPI_OWNBUS
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
#endif
/* Initialize SPI mode. It must be done before starting SPI transfer */
@@ -556,7 +556,7 @@ FAR struct spi_dev_s *lc823450_spibus_initialize(int port)
lc823450_spiinitialize();
#ifdef CONFIG_LC823450_SPI_DMA
sem_init(&priv->dma_wait, 0, 0);
nxsem_init(&priv->dma_wait, 0, 0);
priv->hdma = lc823450_dmachannel(DMA_CHANNEL_SIOTX);
lc823450_dmarequest(priv->hdma, DMA_REQUEST_SIOTX);
+1 -1
View File
@@ -387,7 +387,7 @@ int up_hrttimer_usleep(unsigned int usec)
{
struct hrt_s hrt;
sem_init(&hrt.sem, 0, 0);
nxsem_init(&hrt.sem, 0, 0);
hrt.usec = usec;
hrt_usleep_add(&hrt);
+3 -3
View File
@@ -1430,7 +1430,7 @@ void up_usbinitialize(void)
return;
}
sem_init(&dma_wait, 0, 0);
nxsem_init(&dma_wait, 0, 0);
hdma = lc823450_dmachannel(DMA_CHANNEL_USBDEV);
lc823450_dmarequest(hdma, DMA_REQUEST_USBDEV);
@@ -1697,7 +1697,7 @@ void usbdev_msc_read_enter()
privep->epcmd &= ~USB_EPCMD_EMPTY_EN;
epcmd_write(CONFIG_USBMSC_EPBULKIN, (privep->epcmd));
lc823450_dmareauest_dir(hdma, DMA_REQUEST_USBDEV, 1);
sem_init(&dma_wait, 0, 0);
nxsem_init(&dma_wait, 0, 0);
}
/****************************************************************************
@@ -1800,7 +1800,7 @@ void usbdev_msc_write_enter0(void)
privep->epcmd &= ~USB_EPCMD_READY_EN;
epcmd_write(CONFIG_USBMSC_EPBULKOUT, (privep->epcmd));
lc823450_dmareauest_dir(hdma, DMA_REQUEST_USBDEV, 0);
sem_init(&dma_wait, 0, 0);
nxsem_init(&dma_wait, 0, 0);
}
/****************************************************************************
+2 -2
View File
@@ -564,8 +564,8 @@ struct i2c_master_s *lpc11_i2cbus_initialize(int port)
/* Initialize semaphores */
sem_init(&priv->mutex, 0, 1);
sem_init(&priv->wait, 0, 0);
nxsem_init(&priv->mutex, 0, 1);
nxsem_init(&priv->wait, 0, 0);
/* The wait semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
+1 -1
View File
@@ -579,7 +579,7 @@ FAR struct spi_dev_s *lpc11_spibus_initialize(int port)
/* Initialize the SPI semaphore that enforces mutually exclusive access */
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
return &priv->spidev;
}
+1 -1
View File
@@ -993,7 +993,7 @@ FAR struct spi_dev_s *lpc11_sspbus_initialize(int port)
/* Initialize the SPI semaphore that enforces mutually exclusive access */
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
/* Enable the SPI */
+1 -1
View File
@@ -305,7 +305,7 @@ void weak_function up_dmainitialize(void)
/* Initialize the DMA state structure */
sem_init(&g_gpdma.exclsem, 0, 1);
nxsem_init(&g_gpdma.exclsem, 0, 1);
for (i = 0; i < LPC17_NDMACH; i++)
{
+2 -2
View File
@@ -569,8 +569,8 @@ struct i2c_master_s *lpc17_i2cbus_initialize(int port)
/* Initialize semaphores */
sem_init(&priv->mutex, 0, 1);
sem_init(&priv->wait, 0, 0);
nxsem_init(&priv->mutex, 0, 1);
nxsem_init(&priv->wait, 0, 0);
/* The wait semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
+1 -1
View File
@@ -2718,7 +2718,7 @@ FAR struct sdio_dev_s *sdio_initialize(int slotno)
/* Initialize the SD card slot structure */
/* Initialize semaphores */
sem_init(&priv->waitsem, 0, 0);
nxsem_init(&priv->waitsem, 0, 0);
/* The waitsem semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
+1 -1
View File
@@ -570,7 +570,7 @@ FAR struct spi_dev_s *lpc17_spibus_initialize(int port)
/* Initialize the SPI semaphore that enforces mutually exclusive access */
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
return &priv->spidev;
}
+1 -1
View File
@@ -982,7 +982,7 @@ FAR struct spi_dev_s *lpc17_sspbus_initialize(int port)
/* Initialize the SPI semaphore that enforces mutually exclusive access */
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
/* Enable the SPI */
+4 -4
View File
@@ -2267,7 +2267,7 @@ static int lpc17_epalloc(struct usbhost_driver_s *drvr,
* should not have priority inheritance enabled.
*/
sem_init(&ed->wdhsem, 0, 0);
nxsem_init(&ed->wdhsem, 0, 0);
sem_setprotocol(&ed->wdhsem, SEM_PRIO_NONE);
/* Link the common tail TD to the ED's TD list */
@@ -3641,8 +3641,8 @@ struct usbhost_connection_s *lpc17_usbhost_initialize(int controller)
/* Initialize semaphores */
sem_init(&priv->pscsem, 0, 0);
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->pscsem, 0, 0);
nxsem_init(&priv->exclsem, 0, 1);
/* The pscsem semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
@@ -3735,7 +3735,7 @@ struct usbhost_connection_s *lpc17_usbhost_initialize(int controller)
* not have priority inheritance enabled.
*/
sem_init(&EDCTRL->wdhsem, 0, 0);
nxsem_init(&EDCTRL->wdhsem, 0, 0);
sem_setprotocol(&EDCTRL->wdhsem, SEM_PRIO_NONE);
/* Initialize user-configurable EDs */
+2 -2
View File
@@ -580,8 +580,8 @@ struct i2c_master_s *lpc2378_i2cbus_initialize(int port)
/* Initialize semaphores */
sem_init(&priv->mutex, 0, 1);
sem_init(&priv->wait, 0, 0);
nxsem_init(&priv->mutex, 0, 1);
nxsem_init(&priv->wait, 0, 0);
/* The wait semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
+1 -1
View File
@@ -582,7 +582,7 @@ FAR struct spi_dev_s *lpc23_spibus_initialize(int port)
/* Initialize the SPI semaphore that enforces mutually exclusive access */
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
return &priv->spidev;
}
+5 -5
View File
@@ -3937,7 +3937,7 @@ static int lpc31_epalloc(FAR struct usbhost_driver_s *drvr,
* priority inheritance enabled.
*/
sem_init(&epinfo->iocsem, 0, 0);
nxsem_init(&epinfo->iocsem, 0, 0);
sem_setprotocol(&epinfo->iocsem, SEM_PRIO_NONE);
/* Success.. return an opaque reference to the endpoint information structure
@@ -4920,8 +4920,8 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller)
/* Initialize the EHCI state data structure */
sem_init(&g_ehci.exclsem, 0, 1);
sem_init(&g_ehci.pscsem, 0, 0);
nxsem_init(&g_ehci.exclsem, 0, 1);
nxsem_init(&g_ehci.pscsem, 0, 0);
/* The pscsem semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
@@ -4931,7 +4931,7 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller)
/* Initialize EP0 */
sem_init(&g_ehci.ep0.iocsem, 0, 1);
nxsem_init(&g_ehci.ep0.iocsem, 0, 1);
/* Initialize the root hub port structures */
@@ -4970,7 +4970,7 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller)
* should not have priority inheritance enabled.
*/
sem_init(&rhport->ep0.iocsem, 0, 0);
nxsem_init(&rhport->ep0.iocsem, 0, 0);
sem_setprotocol(&rhport->iocsem, SEM_PRIO_NONE);
/* Initialize the public port representation */
+2 -2
View File
@@ -551,8 +551,8 @@ struct i2c_master_s *lpc31_i2cbus_initialize(int port)
/* Initialize semaphores */
sem_init(&priv->mutex, 0, 1);
sem_init(&priv->wait, 0, 0);
nxsem_init(&priv->mutex, 0, 1);
nxsem_init(&priv->wait, 0, 0);
/* The wait semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
+1 -1
View File
@@ -941,7 +941,7 @@ FAR struct spi_dev_s *lpc31_spibus_initialize(int port)
/* Initialize the SPI semaphore that enforces mutually exclusive access */
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
/* Reset the SPI block */
+5 -5
View File
@@ -3774,7 +3774,7 @@ static int lpc43_epalloc(FAR struct usbhost_driver_s *drvr,
* should not have priority inheritance enabled.
*/
sem_init(&epinfo->iocsem, 0, 0);
nxsem_init(&epinfo->iocsem, 0, 0);
sem_setprotocol(&epinfo->iocsem, SEM_PRIO_NONE);
/* Success.. return an opaque reference to the endpoint information structure
@@ -4751,8 +4751,8 @@ FAR struct usbhost_connection_s *lpc43_ehci_initialize(int controller)
/* Initialize the EHCI state data structure */
sem_init(&g_ehci.exclsem, 0, 1);
sem_init(&g_ehci.pscsem, 0, 0);
nxsem_init(&g_ehci.exclsem, 0, 1);
nxsem_init(&g_ehci.pscsem, 0, 0);
/* The pscsem semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
@@ -4762,7 +4762,7 @@ FAR struct usbhost_connection_s *lpc43_ehci_initialize(int controller)
/* Initialize EP0 */
sem_init(&g_ehci.ep0.iocsem, 0, 1);
nxsem_init(&g_ehci.ep0.iocsem, 0, 1);
/* Initialize the root hub port structures */
@@ -4801,7 +4801,7 @@ FAR struct usbhost_connection_s *lpc43_ehci_initialize(int controller)
* not have priority inheritance enabled.
*/
sem_init(&rhport->ep0.iocsem, 0, 0);
nxsem_init(&rhport->ep0.iocsem, 0, 0);
sem_setprotocol(&rhport->ep0.iocsem, SEM_PRIO_NONE);
/* Initialize the public port representation */
+1 -1
View File
@@ -305,7 +305,7 @@ void weak_function up_dmainitialize(void)
/* Initialize the DMA state structure */
sem_init(&g_gpdma.exclsem, 0, 1);
nxsem_init(&g_gpdma.exclsem, 0, 1);
for (i = 0; i < LPC43_NDMACH; i++)
{
+2 -2
View File
@@ -526,8 +526,8 @@ struct i2c_master_s *lpc43_i2cbus_initialize(int port)
/* Initialize semaphores */
sem_init(&priv->mutex, 0, 1);
sem_init(&priv->wait, 0, 0);
nxsem_init(&priv->mutex, 0, 1);
nxsem_init(&priv->wait, 0, 0);
/* The wait semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
+1 -1
View File
@@ -540,7 +540,7 @@ static FAR struct spi_dev_s *lpc43_spiport_initialize(int port)
/* Initialize the SPI semaphore that enforces mutually exclusive access */
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
return &priv->spidev;
}
#endif /* CONFIG_LPC43_SPI */
+1 -1
View File
@@ -827,7 +827,7 @@ FAR struct spi_dev_s *lpc43_sspbus_initialize(int port)
/* Initialize the SPI semaphore that enforces mutually exclusive access */
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
/* Enable the SPI */
+1 -1
View File
@@ -748,7 +748,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel)
tmrerr("ERROR: Initializing TC%d\n", chconfig->chan);
memset(chan, 0, sizeof(struct sam_chan_s));
sem_init(&chan->exclsem, 0, 1);
nxsem_init(&chan->exclsem, 0, 1);
chan->base = chconfig->base;
chan->pid = chconfig->pid;
chan->irq = chconfig->irq;
+1 -1
View File
@@ -225,7 +225,7 @@ int aes_cypher(void *out, const void *in, uint32_t size, const void *iv,
int up_aesinitialize()
{
sem_init(&lock, 0, 1);
nxsem_init(&lock, 0, 1);
sam_aes_enableclk();
putreg32(AES_CR_SWRST, SAM_AES_CR);
return OK;
+2 -2
View File
@@ -1382,8 +1382,8 @@ void weak_function up_dmainitialize(void)
/* Initialize semaphores */
sem_init(&g_chsem, 0, 1);
sem_init(&g_dsem, 0, CONFIG_SAM34_NLLDESC);
nxsem_init(&g_chsem, 0, 1);
nxsem_init(&g_dsem, 0, CONFIG_SAM34_NLLDESC);
}
/****************************************************************************
+1 -1
View File
@@ -2681,7 +2681,7 @@ FAR struct sdio_dev_s *sdio_initialize(int slotno)
/* Initialize the HSMCI slot structure */
/* Initialize semaphores */
sem_init(&priv->waitsem, 0, 0);
nxsem_init(&priv->waitsem, 0, 0);
/* The waitsem semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
+2 -2
View File
@@ -1878,7 +1878,7 @@ struct spi_dev_s *sam_spibus_initialize(int port)
* access to the SPI registers.
*/
sem_init(&spi->spisem, 0, 1);
nxsem_init(&spi->spisem, 0, 1);
spi->initialized = true;
#ifdef CONFIG_SAM34_SPI_DMA
@@ -1887,7 +1887,7 @@ struct spi_dev_s *sam_spibus_initialize(int port)
* signaling and, hence, should not have priority inheritance enabled.
*/
sem_init(&spics->dmawait, 0, 0);
nxsem_init(&spics->dmawait, 0, 0);
sem_setprotocol(&spics->dmawait, SEM_PRIO_NONE);
/* Create a watchdog time to catch DMA timeouts */
+2 -2
View File
@@ -967,8 +967,8 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus)
/* Initialize semaphores */
sem_init(&priv->exclsem, 0, 1);
sem_init(&priv->waitsem, 0, 0);
nxsem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->waitsem, 0, 0);
/* The waitsem semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
+1 -1
View File
@@ -2025,7 +2025,7 @@ struct adc_dev_s *sam_adc_initialize(void)
/* Initialize the private ADC device data structure */
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
priv->cb = NULL;
priv->dev = &g_adcdev;
+1 -1
View File
@@ -1947,7 +1947,7 @@ FAR struct can_dev_s *sam_caninitialize(int port)
priv->freemb = CAN_ALL_MAILBOXES;
priv->initialized = true;
sem_init(&priv->exclsem, 0, 1);
nxsem_init(&priv->exclsem, 0, 1);
dev->cd_ops = &g_canops;
dev->cd_priv = (FAR void *)priv;
+2 -2
View File
@@ -1879,8 +1879,8 @@ void sam_dmainitialize(struct sam_dmac_s *dmac)
/* Initialize semaphores */
sem_init(&dmac->chsem, 0, 1);
sem_init(&dmac->dsem, 0, SAM_NDMACHAN);
nxsem_init(&dmac->chsem, 0, 1);
nxsem_init(&dmac->dsem, 0, SAM_NDMACHAN);
}
/****************************************************************************
+5 -5
View File
@@ -3758,7 +3758,7 @@ static int sam_epalloc(FAR struct usbhost_driver_s *drvr,
* should not have priority inheritance enabled.
*/
sem_init(&epinfo->iocsem, 0, 0);
nxsem_init(&epinfo->iocsem, 0, 0);
sem_setprotocol(&epinfo->iocsem, SEM_PRIO_NONE);
/* Success.. return an opaque reference to the endpoint information structure
@@ -4791,8 +4791,8 @@ FAR struct usbhost_connection_s *sam_ehci_initialize(int controller)
/* Initialize the EHCI state data structure */
sem_init(&g_ehci.exclsem, 0, 1);
sem_init(&g_ehci.pscsem, 0, 0);
nxsem_init(&g_ehci.exclsem, 0, 1);
nxsem_init(&g_ehci.pscsem, 0, 0);
/* The pscsem semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
@@ -4802,7 +4802,7 @@ FAR struct usbhost_connection_s *sam_ehci_initialize(int controller)
/* Initialize EP0 */
sem_init(&g_ehci.ep0.iocsem, 0, 1);
nxsem_init(&g_ehci.ep0.iocsem, 0, 1);
/* Initialize the root hub port structures */
@@ -4841,7 +4841,7 @@ FAR struct usbhost_connection_s *sam_ehci_initialize(int controller)
* should not have priority inheritance enabled.
*/
sem_init(&rhport->ep0.iocsem, 0, 0);
nxsem_init(&rhport->ep0.iocsem, 0, 0);
sem_setprotocol(&rhport->ep0.iocsem, SEM_PRIO_NONE);
/* Initialize the public port representation */
+1 -1
View File
@@ -3298,7 +3298,7 @@ FAR struct sdio_dev_s *sdio_initialize(int slotno)
/* Initialize the HSMCI slot structure */
/* Initialize semaphores */
sem_init(&priv->waitsem, 0, 0);
nxsem_init(&priv->waitsem, 0, 0);
/* The waitsem semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.

Some files were not shown because too many files have changed in this diff Show More