Squashed commit of the following:

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

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

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
This commit is contained in:
Gregory Nutt
2017-10-03 15:35:24 -06:00
parent 83cdb0c552
commit 42a0796615
376 changed files with 1597 additions and 1314 deletions
+2 -2
View File
@@ -381,7 +381,7 @@ DMA_HANDLE efm32_dmachannel(void)
}
}
sem_post(&g_dmac.exclsem);
nxsem_post(&g_dmac.exclsem);
/* Since we have reserved a DMA descriptor by taking a count from chansem,
* it would be a serious logic failure if we could not find a free channel
@@ -432,7 +432,7 @@ void efm32_dmafree(DMA_HANDLE handle)
* thread that may be waiting for a channel.
*/
sem_post(&g_dmac.chansem);
nxsem_post(&g_dmac.chansem);
}
/****************************************************************************
+5 -5
View File
@@ -660,7 +660,7 @@ static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
static inline void efm32_i2c_sem_post(FAR struct efm32_i2c_priv_s *priv)
{
sem_post(&priv->sem_excl);
nxsem_post(&priv->sem_excl);
}
/****************************************************************************
@@ -681,7 +681,7 @@ static inline void efm32_i2c_sem_init(FAR struct efm32_i2c_priv_s *priv)
*/
nxsem_init(&priv->sem_isr, 0, 0);
sem_setprotocol(&priv->sem_isr, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->sem_isr, SEM_PRIO_NONE);
#endif
}
@@ -695,9 +695,9 @@ static inline void efm32_i2c_sem_init(FAR struct efm32_i2c_priv_s *priv)
static inline void efm32_i2c_sem_destroy(FAR struct efm32_i2c_priv_s *priv)
{
sem_destroy(&priv->sem_excl);
nxsem_destroy(&priv->sem_excl);
#ifndef CONFIG_I2C_POLLED
sem_destroy(&priv->sem_isr);
nxsem_destroy(&priv->sem_isr);
#endif
}
@@ -1254,7 +1254,7 @@ done:
if (priv->i2c_state == I2CSTATE_DONE)
{
#ifndef CONFIG_I2C_POLLED
sem_post(&priv->sem_isr);
nxsem_post(&priv->sem_isr);
#endif
/* Disable interrupt sources when done */
+5 -5
View File
@@ -510,7 +510,7 @@ static void spi_dmatxwait(struct efm32_spidev_s *priv)
#ifdef CONFIG_EFM32_SPI_DMA
static inline void spi_dmarxwakeup(struct efm32_spidev_s *priv)
{
(void)sem_post(&priv->rxdmasem);
(void)nxsem_post(&priv->rxdmasem);
}
#endif
@@ -525,7 +525,7 @@ static inline void spi_dmarxwakeup(struct efm32_spidev_s *priv)
#ifdef CONFIG_EFM32_SPI_DMA
static inline void spi_dmatxwakeup(struct efm32_spidev_s *priv)
{
(void)sem_post(&priv->txdmasem);
(void)nxsem_post(&priv->txdmasem);
}
#endif
@@ -759,7 +759,7 @@ static int spi_lock(struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
@@ -1646,8 +1646,8 @@ static int spi_portinitialize(struct efm32_spidev_s *priv)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->rxdmasem, SEM_PRIO_NONE);
sem_setprotocol(&priv->txdmasem, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->rxdmasem, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->txdmasem, SEM_PRIO_NONE);
#endif
/* Enable SPI */
+3 -3
View File
@@ -319,7 +319,7 @@ static inline void efm32_modifyreg(uint32_t addr, uint32_t clrbits,
/* Semaphores ******************************************************************/
static void efm32_takesem(sem_t *sem);
#define efm32_givesem(s) sem_post(s);
#define efm32_givesem(s) nxsem_post(s);
/* Byte stream access helper functions *****************************************/
@@ -5162,7 +5162,7 @@ static inline void efm32_sw_initialize(FAR struct efm32_usbhost_s *priv)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->pscsem, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->pscsem, SEM_PRIO_NONE);
/* Initialize the driver state data */
@@ -5187,7 +5187,7 @@ static inline void efm32_sw_initialize(FAR struct efm32_usbhost_s *priv)
*/
nxsem_init(&chan->waitsem, 0, 0);
sem_setprotocol(&chan->waitsem, SEM_PRIO_NONE);
nxsem_setprotocol(&chan->waitsem, SEM_PRIO_NONE);
}
}
+3 -3
View File
@@ -678,7 +678,7 @@ static int spi_interrupt(int irq, void *context, FAR void *arg, FAR void *arg)
{
/* Yes, wake up the waiting thread */
sem_post(&priv->waitsem);
nxsem_post(&priv->waitsem);
}
return OK;
@@ -725,7 +725,7 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
@@ -1123,7 +1123,7 @@ FAR struct spi_dev_s *imx_spibus_initialize(int port)
*/
nxsem_init(&priv->waitsem, 0, 0);
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
#endif
nxsem_init(&priv->exclsem, 0, 1);
+3 -3
View File
@@ -763,7 +763,7 @@ static int spi_interrupt(int irq, void *context, FAR void *arg)
{
/* Yes, wake up the waiting thread */
sem_post(&priv->waitsem);
nxsem_post(&priv->waitsem);
}
return OK;
@@ -810,7 +810,7 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
@@ -1309,7 +1309,7 @@ FAR struct spi_dev_s *imx_spibus_initialize(int port)
*/
nxsem_init(&priv->waitsem, 0, 0);
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
#endif
nxsem_init(&priv->exclsem, 0, 1);
+1 -1
View File
@@ -995,7 +995,7 @@ int up_putc(int ch)
if (locked)
{
sem_post(&g_putc_lock);
nxsem_post(&g_putc_lock);
}
return ch;
+5 -5
View File
@@ -323,7 +323,7 @@ static inline void kinetis_i2c_sem_init(FAR struct kinetis_i2cdev_s *priv)
*/
nxsem_init(&priv->wait, 0, 0);
sem_setprotocol(&priv->wait, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->wait, SEM_PRIO_NONE);
}
/************************************************************************************
@@ -336,8 +336,8 @@ static inline void kinetis_i2c_sem_init(FAR struct kinetis_i2cdev_s *priv)
static inline void kinetis_i2c_sem_destroy(FAR struct kinetis_i2cdev_s *priv)
{
sem_destroy(&priv->mutex);
sem_destroy(&priv->wait);
nxsem_destroy(&priv->mutex);
nxsem_destroy(&priv->wait);
}
/************************************************************************************
@@ -366,7 +366,7 @@ static inline void kinetis_i2c_sem_wait(FAR struct kinetis_i2cdev_s *priv)
static inline void kinetis_i2c_sem_post(struct kinetis_i2cdev_s *priv)
{
sem_post(&priv->mutex);
nxsem_post(&priv->mutex);
}
/************************************************************************************
@@ -392,7 +392,7 @@ static inline void kinetis_i2c_wait(struct kinetis_i2cdev_s *priv)
static inline void kinetis_i2c_endwait(struct kinetis_i2cdev_s *priv)
{
sem_post(&priv->wait);
nxsem_post(&priv->wait);
}
/************************************************************************************
+2 -2
View File
@@ -245,7 +245,7 @@ struct kinetis_sdhcregs_s
/* Low-level helpers ********************************************************/
static void kinetis_takesem(struct kinetis_dev_s *priv);
#define kinetis_givesem(priv) (sem_post(&priv->waitsem))
#define kinetis_givesem(priv) (nxsem_post(&priv->waitsem))
static void kinetis_configwaitints(struct kinetis_dev_s *priv, uint32_t waitints,
sdio_eventset_t waitevents, sdio_eventset_t wkupevents);
static void kinetis_configxfrints(struct kinetis_dev_s *priv, uint32_t xfrints);
@@ -2813,7 +2813,7 @@ FAR struct sdio_dev_s *sdhc_initialize(int slotno)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
/* Create a watchdog timer */
+1 -1
View File
@@ -599,7 +599,7 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
+1 -1
View File
@@ -251,7 +251,7 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
}
+2 -2
View File
@@ -298,7 +298,7 @@ static inline void lc823450_adc_sem_wait(FAR struct lc823450_adc_inst_s *inst)
static inline void lc823450_adc_sem_post(FAR struct lc823450_adc_inst_s *inst)
{
sem_post(&inst->sem_excl);
nxsem_post(&inst->sem_excl);
}
/****************************************************************************
@@ -315,7 +315,7 @@ static int lc823450_adc_isr(int irq, void *context, FAR void *arg)
ainfo("interrupt\n");
lc823450_adc_clearirq();
sem_post(&g_inst->sem_isr);
nxsem_post(&g_inst->sem_isr);
return OK;
}
#endif
+4 -4
View File
@@ -276,7 +276,7 @@ static inline void lc823450_i2c_sem_wait(FAR struct lc823450_i2c_priv_s *priv)
static inline void lc823450_i2c_sem_post(FAR struct lc823450_i2c_priv_s *priv)
{
sem_post(&priv->sem_excl);
nxsem_post(&priv->sem_excl);
}
/****************************************************************************
@@ -714,7 +714,7 @@ static int lc823450_i2c_poll(FAR struct lc823450_i2c_priv_s *priv)
priv->irqstate = IRQSTATE_DONE;
#ifndef CONFIG_I2C_POLLED
sem_post(&priv->sem_isr);
nxsem_post(&priv->sem_isr);
#endif
}
@@ -1184,9 +1184,9 @@ int lc823450_i2cbus_uninitialize(FAR struct i2c_master_s *dev)
/* Release unused resources */
sem_destroy(&priv->sem_excl);
nxsem_destroy(&priv->sem_excl);
#ifndef CONFIG_I2C_POLLED
sem_destroy(&priv->sem_isr);
nxsem_destroy(&priv->sem_isr);
#endif
return OK;
+3 -3
View File
@@ -154,7 +154,7 @@ static void mtd_semtake(FAR sem_t *sem)
static void mtd_semgive(FAR sem_t *sem)
{
sem_post(sem);
nxsem_post(sem);
}
/****************************************************************************
@@ -535,7 +535,7 @@ static FAR struct mtd_dev_s *lc823450_mtd_allocdev(uint32_t channel)
if (ret != OK)
{
finfo("ERROR: Failed to initialize media\n");
sem_destroy(&priv->sem);
nxsem_destroy(&priv->sem);
kmm_free(priv);
return NULL;
}
@@ -799,7 +799,7 @@ int lc823450_mtd_uninitialize(uint32_t devno)
ret = lc823450_sdc_finalize(ch);
DEBUGASSERT(ret == OK);
sem_destroy(&priv->sem);
nxsem_destroy(&priv->sem);
kmm_free(g_mtdmaster[ch]);
+1 -1
View File
@@ -150,7 +150,7 @@ static void _sdc_semtake(FAR sem_t *sem)
static void _sdc_semgive(FAR sem_t *sem)
{
sem_post(sem);
nxsem_post(sem);
}
/****************************************************************************
+1 -1
View File
@@ -121,7 +121,7 @@ static int _get_ch_from_cfg(struct SdDrCfg_s *cfg)
static void dma_callback(DMA_HANDLE hdma, void *arg, int result)
{
sem_t *waitsem = (sem_t *)arg;
sem_post(waitsem);
nxsem_post(waitsem);
}
#endif /* CONFIG_LC823450_SDC_DMA */
+2 -2
View File
@@ -1078,7 +1078,7 @@ static void uart_dma_callback(DMA_HANDLE hdma, void *arg, int result)
struct uart_dev_s *dev = (struct uart_dev_s *)arg;
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
sem_t *waitsem = &priv->txdma_wait;
sem_post(waitsem);
nxsem_post(waitsem);
uart_datasent(dev);
}
@@ -1214,7 +1214,7 @@ retry:
int i;
for (i = 0; i < buflen; i++)
up_serialout(priv, UART_USTF, buf[i]);
sem_post(&priv->txdma_wait);
nxsem_post(&priv->txdma_wait);
return buflen;
}
+2 -2
View File
@@ -165,7 +165,7 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
@@ -320,7 +320,7 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
static void spi_dma_callback(DMA_HANDLE hdma, void *arg, int result)
{
sem_t *waitsem = (sem_t *)arg;
sem_post(waitsem);
nxsem_post(waitsem);
}
#endif /* CONFIG_LC823450_SPI_DMA */
+1 -1
View File
@@ -193,7 +193,7 @@ cont:
if (tmp->usec <= 0)
{
dq_rem(pent, &hrt_timer_queue);
sem_post(&tmp->sem);
nxsem_post(&tmp->sem);
goto cont;
}
else
+3 -3
View File
@@ -540,7 +540,7 @@ static int lc823450_epdisable(struct usbdev_ep_s *ep)
g_usbdev.bufoffset = 0x180;
privep->disable = 1;
lc823450_dmastop(hdma);
sem_post(&dma_wait);
nxsem_post(&dma_wait);
return lc823450_epclearreq(ep);
}
@@ -1720,7 +1720,7 @@ void usbdev_msc_read_exit()
static void usbdev_dma_callback(DMA_HANDLE hd, void *arg, int result)
{
sem_t *waitsem = (sem_t *)arg;
sem_post(waitsem);
nxsem_post(waitsem);
}
/****************************************************************************
@@ -1892,7 +1892,7 @@ int usbdev_msc_epread(void *buf, int len)
void usbdev_msc_stop(void)
{
lc823450_dmastop(hdma);
sem_post(&dma_wait);
nxsem_post(&dma_wait);
}
#endif /* CONFIG_USBMSC */
+6 -6
View File
@@ -239,7 +239,7 @@ static void lpc11_i2c_stop(struct lpc11_i2cdev_s *priv)
priv->base + LPC11_I2C_CONSET_OFFSET);
}
sem_post(&priv->wait);
nxsem_post(&priv->wait);
}
/****************************************************************************
@@ -256,7 +256,7 @@ static void lpc11_i2c_timeout(int argc, uint32_t arg, ...)
irqstate_t flags = enter_critical_section();
priv->state = 0xff;
sem_post(&priv->wait);
nxsem_post(&priv->wait);
leave_critical_section(flags);
}
@@ -299,7 +299,7 @@ static int lpc11_i2c_transfer(FAR struct i2c_master_s *dev,
ret = lpc11_i2c_start(priv);
sem_post(&priv->mutex);
nxsem_post(&priv->mutex);
return ret;
}
@@ -571,7 +571,7 @@ struct i2c_master_s *lpc11_i2cbus_initialize(int port)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->wait, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->wait, SEM_PRIO_NONE);
/* Allocate a watchdog timer */
@@ -610,8 +610,8 @@ int lpc11_i2cbus_uninitialize(FAR struct i2c_master_s * dev)
/* Reset data structures */
sem_destroy(&priv->mutex);
sem_destroy(&priv->wait);
nxsem_destroy(&priv->mutex);
nxsem_destroy(&priv->wait);
/* Free the watchdog timer */
+1 -1
View File
@@ -202,7 +202,7 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
}
+1 -1
View File
@@ -350,7 +350,7 @@ static int ssp_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
}
+1 -1
View File
@@ -416,7 +416,7 @@ DMA_HANDLE lpc17_dmachannel(void)
/* Return what we found (or not) */
sem_post(&g_gpdma.exclsem);
nxsem_post(&g_gpdma.exclsem);
return (DMA_HANDLE)dmach;
}
+6 -6
View File
@@ -239,7 +239,7 @@ static void lpc17_i2c_stop(struct lpc17_i2cdev_s *priv)
priv->base + LPC17_I2C_CONSET_OFFSET);
}
sem_post(&priv->wait);
nxsem_post(&priv->wait);
}
/****************************************************************************
@@ -256,7 +256,7 @@ static void lpc17_i2c_timeout(int argc, uint32_t arg, ...)
irqstate_t flags = enter_critical_section();
priv->state = 0xff;
sem_post(&priv->wait);
nxsem_post(&priv->wait);
leave_critical_section(flags);
}
@@ -299,7 +299,7 @@ static int lpc17_i2c_transfer(FAR struct i2c_master_s *dev,
ret = lpc17_i2c_start(priv);
sem_post(&priv->mutex);
nxsem_post(&priv->mutex);
return ret;
}
@@ -576,7 +576,7 @@ struct i2c_master_s *lpc17_i2cbus_initialize(int port)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->wait, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->wait, SEM_PRIO_NONE);
/* Allocate a watchdog timer */
@@ -615,8 +615,8 @@ int lpc17_i2cbus_uninitialize(FAR struct i2c_master_s * dev)
/* Reset data structures */
sem_destroy(&priv->mutex);
sem_destroy(&priv->wait);
nxsem_destroy(&priv->mutex);
nxsem_destroy(&priv->wait);
/* Free the watchdog timer */
+2 -2
View File
@@ -304,7 +304,7 @@ struct lpc17_sampleregs_s
/* Low-level helpers ********************************************************/
static void lpc17_takesem(struct lpc17_dev_s *priv);
#define lpc17_givesem(priv) (sem_post(&priv->waitsem))
#define lpc17_givesem(priv) (nxsem_post(&priv->waitsem))
static inline void lpc17_setclock(uint32_t clkcr);
static void lpc17_configwaitints(struct lpc17_dev_s *priv, uint32_t waitmask,
sdio_eventset_t waitevents, sdio_eventset_t wkupevents);
@@ -2724,7 +2724,7 @@ FAR struct sdio_dev_s *sdio_initialize(int slotno)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
/* Create a watchdog timer */
+1 -1
View File
@@ -198,7 +198,7 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
}
+1 -1
View File
@@ -346,7 +346,7 @@ static int ssp_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
}
+6 -6
View File
@@ -284,7 +284,7 @@ static void lpc17_putreg(uint32_t val, uint32_t addr);
/* Semaphores ******************************************************************/
static void lpc17_takesem(sem_t *sem);
#define lpc17_givesem(s) sem_post(s);
#define lpc17_givesem(s) nxsem_post(s);
/* Byte stream access helper functions *****************************************/
@@ -2268,7 +2268,7 @@ static int lpc17_epalloc(struct usbhost_driver_s *drvr,
*/
nxsem_init(&ed->wdhsem, 0, 0);
sem_setprotocol(&ed->wdhsem, SEM_PRIO_NONE);
nxsem_setprotocol(&ed->wdhsem, SEM_PRIO_NONE);
/* Link the common tail TD to the ED's TD list */
@@ -2307,7 +2307,7 @@ static int lpc17_epalloc(struct usbhost_driver_s *drvr,
/* No.. destroy it and report the error */
uerr("ERROR: Failed to queue ED for transfer type: %d\n", ed->xfrtype);
sem_destroy(&ed->wdhsem);
nxsem_destroy(&ed->wdhsem);
lpc17_edfree(ed);
}
else
@@ -2385,7 +2385,7 @@ static int lpc17_epfree(struct usbhost_driver_s *drvr, usbhost_ep_t ep)
/* Destroy the semaphore */
sem_destroy(&ed->wdhsem);
nxsem_destroy(&ed->wdhsem);
/* Put the ED back into the free list */
@@ -3648,7 +3648,7 @@ struct usbhost_connection_s *lpc17_usbhost_initialize(int controller)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->pscsem, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->pscsem, SEM_PRIO_NONE);
#ifndef CONFIG_USBHOST_INT_DISABLE
priv->ininterval = MAX_PERINTERVAL;
@@ -3736,7 +3736,7 @@ struct usbhost_connection_s *lpc17_usbhost_initialize(int controller)
*/
nxsem_init(&EDCTRL->wdhsem, 0, 0);
sem_setprotocol(&EDCTRL->wdhsem, SEM_PRIO_NONE);
nxsem_setprotocol(&EDCTRL->wdhsem, SEM_PRIO_NONE);
/* Initialize user-configurable EDs */
+6 -6
View File
@@ -244,7 +244,7 @@ static void lpc2378_i2c_stop(struct lpc2378_i2cdev_s *priv)
priv->base + I2C_CONSET_OFFSET);
}
sem_post(&priv->wait);
nxsem_post(&priv->wait);
}
/****************************************************************************
@@ -261,7 +261,7 @@ static void lpc2378_i2c_timeout(int argc, uint32_t arg, ...)
irqstate_t flags = enter_critical_section();
priv->state = 0xff;
sem_post(&priv->wait);
nxsem_post(&priv->wait);
leave_critical_section(flags);
}
@@ -425,7 +425,7 @@ static int lpc2378_i2c_transfer(FAR struct i2c_master_s *dev,
ret = lpc2378_i2c_start(priv);
sem_post(&priv->mutex);
nxsem_post(&priv->mutex);
return ret;
}
@@ -587,7 +587,7 @@ struct i2c_master_s *lpc2378_i2cbus_initialize(int port)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->wait, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->wait, SEM_PRIO_NONE);
/* Allocate a watchdog timer */
@@ -626,8 +626,8 @@ int lpc2378_i2cbus_uninitialize(FAR struct i2c_master_s * dev)
/* Reset data structures */
sem_destroy(&priv->mutex);
sem_destroy(&priv->wait);
nxsem_destroy(&priv->mutex);
nxsem_destroy(&priv->wait);
/* Free the watchdog timer */
+1 -1
View File
@@ -205,7 +205,7 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
+4 -4
View File
@@ -430,7 +430,7 @@ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits,
/* Semaphores ******************************************************************/
static void lpc31_takesem(sem_t *sem);
#define lpc31_givesem(s) sem_post(s);
#define lpc31_givesem(s) nxsem_post(s);
/* Allocators ******************************************************************/
@@ -3938,7 +3938,7 @@ static int lpc31_epalloc(FAR struct usbhost_driver_s *drvr,
*/
nxsem_init(&epinfo->iocsem, 0, 0);
sem_setprotocol(&epinfo->iocsem, SEM_PRIO_NONE);
nxsem_setprotocol(&epinfo->iocsem, SEM_PRIO_NONE);
/* Success.. return an opaque reference to the endpoint information structure
* instance
@@ -4927,7 +4927,7 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller)
* priority inheritance enabled.
*/
sem_setprotocol(&g_ehci.pscsem, SEM_PRIO_NONE);
nxsem_setprotocol(&g_ehci.pscsem, SEM_PRIO_NONE);
/* Initialize EP0 */
@@ -4971,7 +4971,7 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller)
*/
nxsem_init(&rhport->ep0.iocsem, 0, 0);
sem_setprotocol(&rhport->iocsem, SEM_PRIO_NONE);
nxsem_setprotocol(&rhport->iocsem, SEM_PRIO_NONE);
/* Initialize the public port representation */
+5 -5
View File
@@ -219,7 +219,7 @@ static void i2c_progress(struct lpc31_i2cdev_s *priv)
/* FIXME: automatic retry? */
priv->state = I2C_STATE_DONE;
sem_post(&priv->wait);
nxsem_post(&priv->wait);
return;
}
@@ -388,7 +388,7 @@ out:
}
priv->state = I2C_STATE_DONE;
sem_post(&priv->wait);
nxsem_post(&priv->wait);
}
}
@@ -427,7 +427,7 @@ static void i2c_timeout(int argc, uint32_t arg, ...)
/* Mark the transfer as finished */
priv->state = I2C_STATE_DONE;
sem_post(&priv->wait);
nxsem_post(&priv->wait);
}
leave_critical_section(flags);
@@ -503,7 +503,7 @@ static int i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s *msgs
ret = count - priv->nmsg;
leave_critical_section(flags);
sem_post(&priv->mutex);
nxsem_post(&priv->mutex);
return ret;
}
@@ -558,7 +558,7 @@ struct i2c_master_s *lpc31_i2cbus_initialize(int port)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->wait, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->wait, SEM_PRIO_NONE);
/* Enable I2C system clocks */
+1 -1
View File
@@ -459,7 +459,7 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
}
+4 -4
View File
@@ -429,7 +429,7 @@ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits,
/* Semaphores ******************************************************************/
static void lpc43_takesem(sem_t *sem);
#define lpc43_givesem(s) sem_post(s);
#define lpc43_givesem(s) nxsem_post(s);
/* Allocators ******************************************************************/
@@ -3775,7 +3775,7 @@ static int lpc43_epalloc(FAR struct usbhost_driver_s *drvr,
*/
nxsem_init(&epinfo->iocsem, 0, 0);
sem_setprotocol(&epinfo->iocsem, SEM_PRIO_NONE);
nxsem_setprotocol(&epinfo->iocsem, SEM_PRIO_NONE);
/* Success.. return an opaque reference to the endpoint information structure
* instance
@@ -4758,7 +4758,7 @@ FAR struct usbhost_connection_s *lpc43_ehci_initialize(int controller)
* priority inheritance enabled.
*/
sem_setprotocol(&g_ehci.pscsem, SEM_PRIO_NONE);
nxsem_setprotocol(&g_ehci.pscsem, SEM_PRIO_NONE);
/* Initialize EP0 */
@@ -4802,7 +4802,7 @@ FAR struct usbhost_connection_s *lpc43_ehci_initialize(int controller)
*/
nxsem_init(&rhport->ep0.iocsem, 0, 0);
sem_setprotocol(&rhport->ep0.iocsem, SEM_PRIO_NONE);
nxsem_setprotocol(&rhport->ep0.iocsem, SEM_PRIO_NONE);
/* Initialize the public port representation */
+1 -1
View File
@@ -417,7 +417,7 @@ DMA_HANDLE lpc43_dmachannel(void)
/* Return what we found (or not) */
sem_post(&g_gpdma.exclsem);
nxsem_post(&g_gpdma.exclsem);
return (DMA_HANDLE)dmach;
}
+4 -4
View File
@@ -225,7 +225,7 @@ static void lpc43_i2c_stop(struct lpc43_i2cdev_s *priv)
priv->base + LPC43_I2C_CONSET_OFFSET);
}
sem_post(&priv->wait);
nxsem_post(&priv->wait);
}
/****************************************************************************
@@ -242,7 +242,7 @@ static void lpc43_i2c_timeout(int argc, uint32_t arg, ...)
irqstate_t flags = enter_critical_section();
priv->state = 0xff;
sem_post(&priv->wait);
nxsem_post(&priv->wait);
leave_critical_section(flags);
}
@@ -406,7 +406,7 @@ static int lpc43_i2c_transfer(FAR struct i2c_master_s *dev,
ret = lpc43_i2c_start(priv);
sem_post(&priv->mutex);
nxsem_post(&priv->mutex);
return ret;
}
@@ -533,7 +533,7 @@ struct i2c_master_s *lpc43_i2cbus_initialize(int port)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->wait, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->wait, SEM_PRIO_NONE);
/* Allocate a watchdog timer */
+1 -1
View File
@@ -192,7 +192,7 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
}
+1 -1
View File
@@ -288,7 +288,7 @@ static int ssp_lock(FAR struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&priv->exclsem);
(void)nxsem_post(&priv->exclsem);
}
return OK;
+1 -1
View File
@@ -129,7 +129,7 @@ struct sam_chan_s
/* Low-level helpers ********************************************************/
static void sam_takesem(struct sam_chan_s *chan);
#define sam_givesem(chan) (sem_post(&chan->exclsem))
#define sam_givesem(chan) (nxsem_post(&chan->exclsem))
#ifdef CONFIG_SAM34_TC_REGDEBUG
static void sam_regdump(struct sam_chan_s *chan, const char *msg);
+1 -1
View File
@@ -93,7 +93,7 @@ static void aes_lock(void)
static void aes_unlock(void)
{
sem_post(&lock);
nxsem_post(&lock);
}
static void aes_memcpy(void *out, const void *in, size_t size)
+2 -2
View File
@@ -288,7 +288,7 @@ static void sam_takechsem(void)
static inline void sam_givechsem(void)
{
(void)sem_post(&g_chsem);
(void)nxsem_post(&g_chsem);
}
/****************************************************************************
@@ -315,7 +315,7 @@ static void sam_takedsem(void)
static inline void sam_givedsem(void)
{
(void)sem_post(&g_dsem);
(void)nxsem_post(&g_dsem);
}
/****************************************************************************
+2 -2
View File
@@ -405,7 +405,7 @@ struct sam_xfrregs_s
/* Low-level helpers ********************************************************/
static void sam_takesem(struct sam_dev_s *priv);
#define sam_givesem(priv) (sem_post(&priv->waitsem))
#define sam_givesem(priv) (nxsem_post(&priv->waitsem))
static void sam_configwaitints(struct sam_dev_s *priv, uint32_t waitmask,
sdio_eventset_t waitevents);
@@ -2687,7 +2687,7 @@ FAR struct sdio_dev_s *sdio_initialize(int slotno)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
/* Create a watchdog timer */
+4 -4
View File
@@ -745,7 +745,7 @@ static void spi_dmatimeout(int argc, uint32_t arg)
/* Then wake up the waiting thread */
sem_post(&spics->dmawait);
nxsem_post(&spics->dmawait);
}
#endif
@@ -792,7 +792,7 @@ static void spi_rxcallback(DMA_HANDLE handle, void *arg, int result)
/* Then wake up the waiting thread */
sem_post(&spics->dmawait);
nxsem_post(&spics->dmawait);
}
#endif
@@ -893,7 +893,7 @@ static int spi_lock(struct spi_dev_s *dev, bool lock)
}
else
{
(void)sem_post(&spi->spisem);
(void)nxsem_post(&spi->spisem);
}
return OK;
@@ -1888,7 +1888,7 @@ struct spi_dev_s *sam_spibus_initialize(int port)
*/
nxsem_init(&spics->dmawait, 0, 0);
sem_setprotocol(&spics->dmawait, SEM_PRIO_NONE);
nxsem_setprotocol(&spics->dmawait, SEM_PRIO_NONE);
/* Create a watchdog time to catch DMA timeouts */
+4 -4
View File
@@ -141,7 +141,7 @@ struct twi_dev_s
/* Low-level helper functions */
static void twi_takesem(sem_t *sem);
#define twi_givesem(sem) (sem_post(sem))
#define twi_givesem(sem) (nxsem_post(sem))
#ifdef CONFIG_SAM34_TWI_REGDEBUG
static bool twi_checkreg(struct twi_dev_s *priv, bool wr,
@@ -974,7 +974,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
/* Allocate a watchdog timer */
@@ -1017,8 +1017,8 @@ int sam_i2cbus_uninitialize(FAR struct i2c_master_s * dev)
/* Reset data structures */
sem_destroy(&priv->exclsem);
sem_destroy(&priv->waitsem);
nxsem_destroy(&priv->exclsem);
nxsem_destroy(&priv->waitsem);
/* Free the watchdog timer */
+1 -1
View File
@@ -2174,7 +2174,7 @@ void sam_adc_lock(FAR struct sam_adc_s *priv)
void sam_adc_unlock(FAR struct sam_adc_s *priv)
{
ainfo("Unlocking\n");
sem_post(&priv->exclsem);
nxsem_post(&priv->exclsem);
}
/****************************************************************************
+1 -1
View File
@@ -199,7 +199,7 @@ static void can_dumpmbregs(FAR struct sam_can_s *priv, FAR const char *msg);
/* Semaphore helpers */
static void can_semtake(FAR struct sam_can_s *priv);
#define can_semgive(priv) sem_post(&priv->exclsem)
#define can_semgive(priv) nxsem_post(&priv->exclsem)
/* Mailboxes */
+2 -2
View File
@@ -501,7 +501,7 @@ static void sam_takechsem(struct sam_dmac_s *dmac)
static inline void sam_givechsem(struct sam_dmac_s *dmac)
{
(void)sem_post(&dmac->chsem);
(void)nxsem_post(&dmac->chsem);
}
/****************************************************************************
@@ -528,7 +528,7 @@ static void sam_takedsem(struct sam_dmac_s *dmac)
static inline void sam_givedsem(struct sam_dmac_s *dmac)
{
(void)sem_post(&dmac->dsem);
(void)nxsem_post(&dmac->dsem);
}
/****************************************************************************
+4 -4
View File
@@ -309,7 +309,7 @@ static int ehci_wait_usbsts(uint32_t maskbits, uint32_t donebits,
/* Semaphores ******************************************************************/
static void sam_takesem(sem_t *sem);
#define sam_givesem(s) sem_post(s);
#define sam_givesem(s) nxsem_post(s);
/* Allocators ******************************************************************/
@@ -3759,7 +3759,7 @@ static int sam_epalloc(FAR struct usbhost_driver_s *drvr,
*/
nxsem_init(&epinfo->iocsem, 0, 0);
sem_setprotocol(&epinfo->iocsem, SEM_PRIO_NONE);
nxsem_setprotocol(&epinfo->iocsem, SEM_PRIO_NONE);
/* Success.. return an opaque reference to the endpoint information structure
* instance
@@ -4798,7 +4798,7 @@ FAR struct usbhost_connection_s *sam_ehci_initialize(int controller)
* priority inheritance enabled.
*/
sem_setprotocol(&g_ehci.pscsem, SEM_PRIO_NONE);
nxsem_setprotocol(&g_ehci.pscsem, SEM_PRIO_NONE);
/* Initialize EP0 */
@@ -4842,7 +4842,7 @@ FAR struct usbhost_connection_s *sam_ehci_initialize(int controller)
*/
nxsem_init(&rhport->ep0.iocsem, 0, 0);
sem_setprotocol(&rhport->ep0.iocsem, SEM_PRIO_NONE);
nxsem_setprotocol(&rhport->ep0.iocsem, SEM_PRIO_NONE);
/* Initialize the public port representation */
+2 -2
View File
@@ -464,7 +464,7 @@ struct sam_dev_s
/* Low-level helpers ********************************************************/
static void sam_takesem(struct sam_dev_s *priv);
#define sam_givesem(priv) (sem_post(&priv->waitsem))
#define sam_givesem(priv) (nxsem_post(&priv->waitsem))
#ifdef CONFIG_SAMA5_HSMCI_REGDEBUG
static bool sam_checkreg(struct sam_dev_s *priv, bool wr,
@@ -3304,7 +3304,7 @@ FAR struct sdio_dev_s *sdio_initialize(int slotno)
* priority inheritance enabled.
*/
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
nxsem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
/* Create a watchdog timer */

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