mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
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:
@@ -181,7 +181,7 @@ static void stmpe811_notify(FAR struct stmpe811_dev_s *priv)
|
||||
* is no longer available.
|
||||
*/
|
||||
|
||||
sem_post(&priv->waitsem);
|
||||
nxsem_post(&priv->waitsem);
|
||||
}
|
||||
|
||||
/* If there are threads waiting on poll() for STMPE811 data to become available,
|
||||
@@ -198,7 +198,7 @@ static void stmpe811_notify(FAR struct stmpe811_dev_s *priv)
|
||||
{
|
||||
fds->revents |= POLLIN;
|
||||
iinfo("Report events: %02x\n", fds->revents);
|
||||
sem_post(fds->sem);
|
||||
nxsem_post(fds->sem);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -289,7 +289,7 @@ static inline int stmpe811_waitsample(FAR struct stmpe811_dev_s *priv,
|
||||
* run, but they cannot run yet because pre-emption is disabled.
|
||||
*/
|
||||
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
|
||||
/* Try to get the a sample... if we cannot, then wait on the semaphore
|
||||
* that is posted when new sample data is available.
|
||||
@@ -395,7 +395,7 @@ static int stmpe811_open(FAR struct file *filep)
|
||||
priv->crefs = tmp;
|
||||
|
||||
errout_with_sem:
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
return ret;
|
||||
#else
|
||||
return OK;
|
||||
@@ -444,7 +444,7 @@ static int stmpe811_close(FAR struct file *filep)
|
||||
priv->crefs--;
|
||||
}
|
||||
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
#endif
|
||||
return OK;
|
||||
}
|
||||
@@ -574,7 +574,7 @@ static ssize_t stmpe811_read(FAR struct file *filep, FAR char *buffer, size_t le
|
||||
ret = SIZEOF_TOUCH_SAMPLE_S(1);
|
||||
|
||||
errout:
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -635,7 +635,7 @@ static int stmpe811_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
break;
|
||||
}
|
||||
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -732,7 +732,7 @@ static int stmpe811_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
}
|
||||
|
||||
errout:
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
@@ -919,7 +919,7 @@ int stmpe811_register(STMPE811_HANDLE handle, int minor)
|
||||
if ((priv->inuse & TSC_PIN_SET) != 0)
|
||||
{
|
||||
ierr("ERROR: TSC pins is already in-use: %02x\n", priv->inuse);
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
@@ -936,7 +936,7 @@ int stmpe811_register(STMPE811_HANDLE handle, int minor)
|
||||
if (!priv->wdog)
|
||||
{
|
||||
ierr("ERROR: Failed to create a watchdog\n", errno);
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
@@ -947,7 +947,7 @@ int stmpe811_register(STMPE811_HANDLE handle, int minor)
|
||||
if (ret < 0)
|
||||
{
|
||||
ierr("ERROR: Failed to register driver %s: %d\n", devname, ret);
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -959,7 +959,7 @@ int stmpe811_register(STMPE811_HANDLE handle, int minor)
|
||||
|
||||
priv->inuse |= TSC_PIN_SET; /* Pins 4-7 are now in-use */
|
||||
priv->flags |= STMPE811_FLAGS_TSC_INITIALIZED; /* TSC function is initialized */
|
||||
sem_post(&priv->exclsem);
|
||||
nxsem_post(&priv->exclsem);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user