net: consistent the net sem wait naming conversion

to prepare the new mutex wait function

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-01-13 14:51:38 +08:00 committed by Alan Carvalho de Assis
parent 32d0c2ce9d
commit a851ad84c3
57 changed files with 145 additions and 143 deletions

View File

@ -160,7 +160,7 @@ static const rpmsg_ept_cb g_net_rpmsg_drv_handler[] =
static void net_rpmsg_drv_wait(FAR sem_t *sem)
{
net_lockedwait_uninterruptible(sem);
net_sem_wait_uninterruptible(sem);
}
/****************************************************************************

View File

@ -510,7 +510,7 @@ int usrsock_request(FAR struct iovec *iov, unsigned int iovcnt)
/* Set outstanding request for daemon to handle. */
net_lockedwait_uninterruptible(&dev->devlock);
net_sem_wait_uninterruptible(&dev->devlock);
if (usrsockdev_is_opened(dev))
{

View File

@ -199,7 +199,7 @@ int usrsock_request(FAR struct iovec *iov, unsigned int iovcnt)
nxsem_get_value(&priv->wait, &ret);
if (ret <= 0)
{
net_lockedwait_uninterruptible(&priv->wait);
net_sem_wait_uninterruptible(&priv->wait);
nxsem_post(&priv->wait);
}

View File

@ -308,7 +308,7 @@ ssize_t net_ioctl_arglen(int cmd);
*
* net_lock() - Locks the network via a re-entrant mutex.
* net_unlock() - Unlocks the network.
* net_lockedwait() - Like pthread_cond_wait() except releases the
* net_sem_wait() - Like pthread_cond_wait() except releases the
* network momentarily to wait on another semaphore.
* net_ioballoc() - Like iob_alloc() except releases the network
* momentarily to wait for an IOB to become
@ -369,7 +369,7 @@ int net_trylock(void);
void net_unlock(void);
/****************************************************************************
* Name: net_timedwait
* Name: net_sem_timedwait
*
* Description:
* Atomically wait for sem (or a timeout( while temporarily releasing
@ -390,10 +390,10 @@ void net_unlock(void);
*
****************************************************************************/
int net_timedwait(sem_t *sem, unsigned int timeout);
int net_sem_timedwait(sem_t *sem, unsigned int timeout);
/****************************************************************************
* Name: net_lockedwait
* Name: net_sem_wait
*
* Description:
* Atomically wait for sem while temporarily releasing the network lock.
@ -412,13 +412,13 @@ int net_timedwait(sem_t *sem, unsigned int timeout);
*
****************************************************************************/
int net_lockedwait(sem_t *sem);
int net_sem_wait(sem_t *sem);
/****************************************************************************
* Name: net_timedwait_uninterruptible
* Name: net_sem_timedwait_uninterruptible
*
* Description:
* This function is wrapped version of net_timedwait(), which is
* This function is wrapped version of net_sem_timedwait(), which is
* uninterruptible and convenient for use.
*
* Input Parameters:
@ -431,13 +431,13 @@ int net_lockedwait(sem_t *sem);
*
****************************************************************************/
int net_timedwait_uninterruptible(sem_t *sem, unsigned int timeout);
int net_sem_timedwait_uninterruptible(sem_t *sem, unsigned int timeout);
/****************************************************************************
* Name: net_lockedwait_uninterruptible
* Name: net_sem_wait_uninterruptible
*
* Description:
* This function is wrapped version of net_lockedwait(), which is
* This function is wrapped version of net_sem_wait(), which is
* uninterruptible and convenient for use.
*
* Input Parameters:
@ -449,7 +449,7 @@ int net_timedwait_uninterruptible(sem_t *sem, unsigned int timeout);
*
****************************************************************************/
int net_lockedwait_uninterruptible(sem_t *sem);
int net_sem_wait_uninterruptible(sem_t *sem);
#ifdef CONFIG_MM_IOB

View File

@ -153,7 +153,7 @@ int arp_wait(FAR struct arp_notify_s *notify, unsigned int timeout)
/* And wait for the ARP response (or a timeout). */
net_timedwait_uninterruptible(&notify->nt_sem, timeout);
net_sem_timedwait_uninterruptible(&notify->nt_sem, timeout);
/* Then get the real result of the transfer */

View File

@ -325,12 +325,12 @@ int arp_send(in_addr_t ipaddr)
netdev_txnotify_dev(dev);
/* Wait for the send to complete or an error to occur.
* net_lockedwait will also terminate if a signal is received.
* net_sem_wait will also terminate if a signal is received.
*/
do
{
ret = net_timedwait_uninterruptible(&state.snd_sem,
ret = net_sem_timedwait_uninterruptible(&state.snd_sem,
CONFIG_ARP_SEND_DELAYMSEC);
if (ret == -ETIMEDOUT)
{

View File

@ -377,12 +377,12 @@ ssize_t bluetooth_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
state.ir_cb->event = bluetooth_recvfrom_eventhandler;
/* Wait for either the receive to complete or for an error/timeout to
* occur. NOTES: (1) net_lockedwait will also terminate if a signal
* occur. NOTES: (1) net_sem_wait will also terminate if a signal
* is received, (2) the network is locked! It will be un-locked while
* the task sleeps and automatically re-locked when the task restarts.
*/
net_lockedwait(&state.ir_sem);
net_sem_wait(&state.ir_sem);
/* Make sure that no further events are processed */

View File

@ -345,10 +345,10 @@ static ssize_t bluetooth_sendto(FAR struct socket *psock,
netdev_txnotify_dev(&radio->r_dev);
/* Wait for the send to complete or an error to occur.
* net_lockedwait will also terminate if a signal is received.
* net_sem_wait will also terminate if a signal is received.
*/
ret = net_lockedwait(&state.is_sem);
ret = net_sem_wait(&state.is_sem);
/* Make sure that no further events are processed */
@ -368,8 +368,8 @@ static ssize_t bluetooth_sendto(FAR struct socket *psock,
return state.is_sent;
}
/* If net_lockedwait failed, then we were probably reawakened by a signal.
* In this case, net_lockedwait will have returned negated errno
/* If net_sem_wait failed, then we were probably reawakened by a signal.
* In this case, net_sem_wait will have returned negated errno
* appropriately.
*/

View File

@ -480,7 +480,7 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
* Evaluate the result of the recv operations
*
* Input Parameters:
* result The result of the net_lockedwait operation (may indicate EINTR)
* result The result of the net_sem_wait operation (may indicate EINTR)
* pstate A pointer to the state structure to be initialized
*
* Returned Value:
@ -504,8 +504,8 @@ static ssize_t can_recvfrom_result(int result,
return pstate->pr_result;
}
/* If net_lockedwait failed, then we were probably reawakened by a signal.
* In this case, net_lockedwait will have returned negated errno
/* If net_sem_wait failed, then we were probably reawakened by a signal.
* In this case, net_sem_wait will have returned negated errno
* appropriately.
*/
@ -654,12 +654,12 @@ ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
state.pr_cb->event = can_recvfrom_eventhandler;
/* Wait for either the receive to complete or for an error/timeout to
* occur. NOTES: (1) net_lockedwait will also terminate if a signal
* occur. NOTES: (1) net_sem_wait will also terminate if a signal
* is received, (2) the network is locked! It will be un-locked while
* the task sleeps and automatically re-locked when the task restarts.
*/
ret = net_lockedwait(&state.pr_sem);
ret = net_sem_wait(&state.pr_sem);
/* Make sure that no further events are processed */

View File

@ -255,16 +255,16 @@ ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
netdev_txnotify_dev(dev);
/* Wait for the send to complete or an error to occur.
* net_timedwait will also terminate if a signal is received.
* net_sem_timedwait will also terminate if a signal is received.
*/
if (_SS_ISNONBLOCK(conn->sconn.s_flags) || (flags & MSG_DONTWAIT) != 0)
{
ret = net_timedwait(&state.snd_sem, 0);
ret = net_sem_timedwait(&state.snd_sem, 0);
}
else
{
ret = net_timedwait(&state.snd_sem, UINT_MAX);
ret = net_sem_timedwait(&state.snd_sem, UINT_MAX);
}
/* Make sure that no further events are processed */
@ -284,8 +284,8 @@ ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
return state.snd_sent;
}
/* If net_lockedwait failed, then we were probably reawakened by a signal.
* In this case, net_lockedwait will have returned negated errno
/* If net_sem_wait failed, then we were probably reawakened by a signal.
* In this case, net_sem_wait will have returned negated errno
* appropriately.
*/

View File

@ -391,11 +391,11 @@ ssize_t icmp_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
state.recv_cb->event = recvfrom_eventhandler;
/* Wait for either the response to be received or for timeout to
* occur. net_timedwait will also terminate if a signal is
* occur. net_sem_timedwait will also terminate if a signal is
* received.
*/
ret = net_timedwait(&state.recv_sem,
ret = net_sem_timedwait(&state.recv_sem,
_SO_TIMEOUT(conn->sconn.s_rcvtimeo));
if (ret < 0)
{

View File

@ -396,10 +396,10 @@ ssize_t icmp_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
netdev_txnotify_dev(dev);
/* Wait for either the send to complete or for timeout to occur.
* net_timedwait will also terminate if a signal is received.
* net_sem_timedwait will also terminate if a signal is received.
*/
ret = net_timedwait(&state.snd_sem,
ret = net_sem_timedwait(&state.snd_sem,
_SO_TIMEOUT(conn->sconn.s_sndtimeo));
if (ret < 0)
{

View File

@ -222,12 +222,12 @@ static int icmpv6_send_message(FAR struct net_driver_s *dev, bool advertise)
netdev_txnotify_dev(dev);
/* Wait for the send to complete or an error to occur
* net_lockedwait will also terminate if a signal is received.
* net_sem_wait will also terminate if a signal is received.
*/
do
{
net_lockedwait(&state.snd_sem);
net_sem_wait(&state.snd_sem);
}
while (!state.snd_sent);

View File

@ -307,12 +307,12 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr)
netdev_txnotify_dev(dev);
/* Wait for the send to complete or an error to occur.
* net_lockedwait will also terminate if a signal is received.
* net_sem_wait will also terminate if a signal is received.
*/
do
{
net_lockedwait(&state.snd_sem);
net_sem_wait(&state.snd_sem);
}
while (!state.snd_sent);

View File

@ -168,7 +168,7 @@ int icmpv6_wait(FAR struct icmpv6_notify_s *notify, unsigned int timeout)
/* And wait for the Neighbor Advertisement (or a timeout). */
ret = net_timedwait(&notify->nt_sem, timeout);
ret = net_sem_timedwait(&notify->nt_sem, timeout);
if (ret >= 0)
{
ret = notify->nt_result;

View File

@ -396,13 +396,13 @@ ssize_t icmpv6_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
state.recv_cb->event = recvfrom_eventhandler;
/* Wait for either the response to be received or for timeout to
* occur. (1) net_timedwait will also terminate if a signal is
* occur. (1) net_sem_timedwait will also terminate if a signal is
* received, (2) interrupts may be disabled! They will be
* re-enabled while the task sleeps and automatically re-enabled
* when the task restarts.
*/
ret = net_timedwait(&state.recv_sem,
ret = net_sem_timedwait(&state.recv_sem,
_SO_TIMEOUT(conn->sconn.s_rcvtimeo));
if (ret < 0)
{

View File

@ -250,7 +250,7 @@ int icmpv6_rwait(FAR struct icmpv6_rnotify_s *notify, unsigned int timeout)
/* And wait for the Neighbor Advertisement (or a timeout). */
ret = net_timedwait(&notify->rn_sem, timeout);
ret = net_sem_timedwait(&notify->rn_sem, timeout);
if (ret >= 0)
{
ret = notify->rn_result;

View File

@ -383,10 +383,10 @@ ssize_t icmpv6_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
netdev_txnotify_dev(dev);
/* Wait for either the send to complete or for timeout to occur.
* net_timedwait will also terminate if a signal is received.
* net_sem_timedwait will also terminate if a signal is received.
*/
ret = net_timedwait(&state.snd_sem,
ret = net_sem_timedwait(&state.snd_sem,
_SO_TIMEOUT(conn->sconn.s_sndtimeo));
if (ret < 0)
{

View File

@ -377,12 +377,12 @@ ssize_t ieee802154_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
state.ir_cb->event = ieee802154_recvfrom_eventhandler;
/* Wait for either the receive to complete or for an error/timeout to
* occur. NOTES: (1) net_lockedwait will also terminate if a signal
* occur. NOTES: (1) net_sem_wait will also terminate if a signal
* is received, (2) the network is locked! It will be un-locked while
* the task sleeps and automatically re-locked when the task restarts.
*/
net_lockedwait(&state.ir_sem);
net_sem_wait(&state.ir_sem);
/* Make sure that no further events are processed */

View File

@ -501,10 +501,10 @@ static ssize_t ieee802154_sendto(FAR struct socket *psock,
netdev_txnotify_dev(&radio->r_dev);
/* Wait for the send to complete or an error to occur.
* net_lockedwait will also terminate if a signal is received.
* net_sem_wait will also terminate if a signal is received.
*/
ret = net_lockedwait(&state.is_sem);
ret = net_sem_wait(&state.is_sem);
/* Make sure that no further events are processed */
@ -524,8 +524,8 @@ static ssize_t ieee802154_sendto(FAR struct socket *psock,
return state.is_sent;
}
/* If net_lockedwait failed, then we were probably reawakened by a signal.
* In this case, net_lockedwait will have returned negated errno
/* If net_sem_wait failed, then we were probably reawakened by a signal.
* In this case, net_sem_wait will have returned negated errno
* appropriately.
*/

View File

@ -135,7 +135,7 @@ int igmp_waitmsg(FAR struct igmp_group_s *group, uint8_t msgid)
{
/* Wait for the semaphore to be posted */
ret = net_lockedwait_uninterruptible(&group->sem);
ret = net_sem_wait_uninterruptible(&group->sem);
if (ret < 0)
{
break;

View File

@ -55,7 +55,7 @@ static int local_waitlisten(FAR struct local_conn_s *server)
{
/* No.. wait for a connection or a signal */
ret = net_lockedwait(&server->lc_waitsem);
ret = net_sem_wait(&server->lc_waitsem);
if (ret < 0)
{
return ret;
@ -245,7 +245,7 @@ int local_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
if (ret == OK)
{
ret = net_lockedwait(&client->lc_donesem);
ret = net_sem_wait(&client->lc_donesem);
}
return ret;

View File

@ -137,7 +137,7 @@ static int inline local_stream_connect(FAR struct local_conn_s *client,
{
do
{
net_lockedwait_uninterruptible(&client->lc_waitsem);
net_sem_wait_uninterruptible(&client->lc_waitsem);
ret = client->u.client.lc_result;
}
while (ret == -EBUSY);

View File

@ -116,7 +116,7 @@ int mld_waitmsg(FAR struct mld_group_s *group, uint8_t msgtype)
{
/* Wait for the semaphore to be posted */
ret = net_lockedwait_uninterruptible(&group->sem);
ret = net_sem_wait_uninterruptible(&group->sem);
if (ret < 0)
{
break;

View File

@ -265,7 +265,7 @@ static void pkt_recvfrom_initialize(FAR struct socket *psock, FAR void *buf,
* Evaluate the result of the recv operations
*
* Input Parameters:
* result The result of the net_lockedwait operation (may indicate EINTR)
* result The result of the net_sem_wait operation (may indicate EINTR)
* pstate A pointer to the state structure to be initialized
*
* Returned Value:
@ -291,8 +291,8 @@ static ssize_t pkt_recvfrom_result(int result,
return pstate->pr_result;
}
/* If net_lockedwait failed, then we were probably reawakened by a signal.
* In this case, net_lockedwait will have returned negated errno
/* If net_sem_wait failed, then we were probably reawakened by a signal.
* In this case, net_sem_wait will have returned negated errno
* appropriately.
*/
@ -403,12 +403,12 @@ ssize_t pkt_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
state.pr_cb->event = pkt_recvfrom_eventhandler;
/* Wait for either the receive to complete or for an error/timeout to
* occur. NOTES: (1) net_lockedwait will also terminate if a signal
* occur. NOTES: (1) net_sem_wait will also terminate if a signal
* is received, (2) the network is locked! It will be un-locked while
* the task sleeps and automatically re-locked when the task restarts.
*/
ret = net_lockedwait(&state.pr_sem);
ret = net_sem_wait(&state.pr_sem);
/* Make sure that no further events are processed */

View File

@ -241,10 +241,10 @@ ssize_t pkt_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
netdev_txnotify_dev(dev);
/* Wait for the send to complete or an error to occur.
* net_lockedwait will also terminate if a signal is received.
* net_sem_wait will also terminate if a signal is received.
*/
ret = net_lockedwait(&state.snd_sem);
ret = net_sem_wait(&state.snd_sem);
/* Make sure that no further events are processed */
@ -264,8 +264,8 @@ ssize_t pkt_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
return state.snd_sent;
}
/* If net_lockedwait failed, then we were probably reawakened by a signal.
* In this case, net_lockedwait will have returned negated errno
/* If net_sem_wait failed, then we were probably reawakened by a signal.
* In this case, net_sem_wait will have returned negated errno
* appropriately.
*/

View File

@ -681,7 +681,7 @@ static int rpmsg_socket_connect_internal(FAR struct socket *psock)
return -EINPROGRESS;
}
ret = net_timedwait(&conn->sendsem,
ret = net_sem_timedwait(&conn->sendsem,
_SO_TIMEOUT(conn->sconn.s_rcvtimeo));
if (ret < 0)
@ -762,7 +762,7 @@ static int rpmsg_socket_accept(FAR struct socket *psock,
if (conn->sendsize == 0)
{
net_lockedwait(&conn->sendsem);
net_sem_wait(&conn->sendsem);
}
newsock->s_domain = psock->s_domain;
@ -783,7 +783,7 @@ static int rpmsg_socket_accept(FAR struct socket *psock,
}
else
{
ret = net_lockedwait(&server->recvsem);
ret = net_sem_wait(&server->recvsem);
if (server->backlog == -1)
{
ret = -ECONNRESET;
@ -950,7 +950,7 @@ static ssize_t rpmsg_socket_send_continuous(FAR struct socket *psock,
{
if (!nonblock)
{
ret = net_timedwait(&conn->sendsem,
ret = net_sem_timedwait(&conn->sendsem,
_SO_TIMEOUT(conn->sconn.s_sndtimeo));
if (!conn->ept.rdev)
{
@ -1049,7 +1049,7 @@ static ssize_t rpmsg_socket_send_single(FAR struct socket *psock,
if (!nonblock)
{
ret = net_timedwait(&conn->sendsem,
ret = net_sem_timedwait(&conn->sendsem,
_SO_TIMEOUT(conn->sconn.s_sndtimeo));
if (!conn->ept.rdev)
{
@ -1231,7 +1231,7 @@ static ssize_t rpmsg_socket_recvmsg(FAR struct socket *psock,
nxmutex_unlock(&conn->recvlock);
ret = net_timedwait(&conn->recvsem,
ret = net_sem_timedwait(&conn->recvsem,
_SO_TIMEOUT(conn->sconn.s_rcvtimeo));
if (!conn->ept.rdev)
{

View File

@ -246,12 +246,12 @@ int sixlowpan_send(FAR struct net_driver_s *dev,
netdev_txnotify_dev(dev);
/* Wait for the send to complete or an error to occur.
* net_timedwait will also terminate if a signal is received.
* net_sem_timedwait will also terminate if a signal is received.
*/
ninfo("Wait for send complete\n");
ret = net_timedwait(&sinfo.s_waitsem, timeout);
ret = net_sem_timedwait(&sinfo.s_waitsem, timeout);
if (ret < 0)
{
if (ret == -ETIMEDOUT)

View File

@ -642,7 +642,7 @@ static int sixlowpan_send_packet(FAR struct socket *psock,
netdev_txnotify_dev(dev);
/* Wait for the send to complete or an error to occur.
* net_timedwait will also terminate if a signal is received.
* net_sem_timedwait will also terminate if a signal is received.
*/
ninfo("Wait for send complete\n");
@ -651,7 +651,7 @@ static int sixlowpan_send_packet(FAR struct socket *psock,
{
uint32_t acked = sinfo.s_acked;
ret = net_timedwait(&sinfo.s_waitsem, timeout);
ret = net_sem_timedwait(&sinfo.s_waitsem, timeout);
if (ret != -ETIMEDOUT || acked == sinfo.s_acked)
{
if (ret == -ETIMEDOUT)

View File

@ -268,10 +268,10 @@ int psock_tcp_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
conn->accept = accept_eventhandler;
/* Wait for the send to complete or an error to occur: NOTES:
* net_lockedwait will also terminate if a signal is received.
* net_sem_wait will also terminate if a signal is received.
*/
ret = net_lockedwait(&state.acpt_sem);
ret = net_sem_wait(&state.acpt_sem);
/* Make sure that no further events are processed */
@ -290,8 +290,8 @@ int psock_tcp_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
return -state.acpt_result;
}
/* If net_lockedwait failed, then we were probably reawakened by a
* signal. In this case, net_lockedwait will have returned negated
/* If net_sem_wait failed, then we were probably reawakened by a
* signal. In this case, net_sem_wait will have returned negated
* errno appropriately.
*/

View File

@ -358,17 +358,17 @@ int psock_tcp_connect(FAR struct socket *psock,
{
/* Wait for either the connect to complete or for an
* error/timeout to occur.
* NOTES: net_lockedwait will also terminate if a
* NOTES: net_sem_wait will also terminate if a
* signal is received.
*/
ret = net_lockedwait(&state.tc_sem);
ret = net_sem_wait(&state.tc_sem);
/* Uninitialize the state structure */
nxsem_destroy(&state.tc_sem);
/* If net_lockedwait failed, negated errno was returned. */
/* If net_sem_wait failed, negated errno was returned. */
if (ret >= 0)
{

View File

@ -541,7 +541,8 @@ static void tcp_recvfrom_initialize(FAR struct tcp_conn_s *conn,
* Evaluate the result of the recv operations
*
* Input Parameters:
* result The result of the net_timedwait operation (may indicate EINTR)
* result The result of the net_sem_timedwait operation
* (may indicate EINTR)
* pstate A pointer to the state structure to be initialized
*
* Returned Value:
@ -709,11 +710,11 @@ ssize_t psock_tcp_recvfrom(FAR struct socket *psock, FAR struct msghdr *msg,
state.ir_cb->event = tcp_recvhandler;
/* Wait for either the receive to complete or for an error/timeout
* to occur. net_timedwait will also terminate if a signal is
* to occur. net_sem_timedwait will also terminate if a signal is
* received.
*/
ret = net_timedwait(&state.ir_sem,
ret = net_sem_timedwait(&state.ir_sem,
_SO_TIMEOUT(conn->sconn.s_rcvtimeo));
if (ret == -ETIMEDOUT)
{

View File

@ -1218,7 +1218,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf,
goto errout_with_lock;
}
ret = net_timedwait_uninterruptible(&conn->snd_sem,
ret = net_sem_timedwait_uninterruptible(&conn->snd_sem,
tcp_send_gettimeout(start, timeout));
if (ret < 0)
{

View File

@ -634,14 +634,14 @@ ssize_t psock_tcp_send(FAR struct socket *psock,
tcp_send_txnotify(psock, conn);
/* Wait for the send to complete or an error to occur: NOTES:
* net_lockedwait will also terminate if a signal is received.
* net_sem_wait will also terminate if a signal is received.
*/
for (; ; )
{
uint32_t acked = state.snd_acked;
ret = net_timedwait(&state.snd_sem,
ret = net_sem_timedwait(&state.snd_sem,
_SO_TIMEOUT(conn->sconn.s_sndtimeo));
if (ret != -ETIMEDOUT || acked == state.snd_acked)
{
@ -673,9 +673,9 @@ ssize_t psock_tcp_send(FAR struct socket *psock,
goto errout;
}
/* If net_timedwait failed, then we were probably reawakened by a signal.
* In this case, net_timedwait will have returned negated errno
* appropriately.
/* If net_sem_timedwait failed, then we were probably reawakened by a
* signal. In this case, net_sem_timedwait will have returned negated
* errno appropriately.
*/
if (ret < 0)

View File

@ -537,7 +537,7 @@ ssize_t tcp_sendfile(FAR struct socket *psock, FAR struct file *infile,
{
uint32_t acked = state.snd_acked;
ret = net_timedwait_uninterruptible(
ret = net_sem_timedwait_uninterruptible(
&state.snd_sem, _SO_TIMEOUT(conn->sconn.s_sndtimeo));
if (ret != -ETIMEDOUT || acked == state.snd_acked)
{

View File

@ -144,7 +144,7 @@ int tcp_txdrain(FAR struct socket *psock, unsigned int timeout)
* wait for it to drain or be be disconnected.
*/
ret = net_timedwait_uninterruptible(&waitsem, timeout);
ret = net_sem_timedwait_uninterruptible(&waitsem, timeout);
/* Tear down the disconnect notifier */

View File

@ -134,7 +134,7 @@ FAR struct tcp_wrbuffer_s *tcp_wrbuffer_timedalloc(unsigned int timeout)
* buffer
*/
ret = net_timedwait_uninterruptible(&g_wrbuffer.sem, timeout);
ret = net_sem_timedwait_uninterruptible(&g_wrbuffer.sem, timeout);
if (ret != OK)
{
return NULL;

View File

@ -500,7 +500,8 @@ static void udp_recvfrom_initialize(FAR struct udp_conn_s *conn,
* Evaluate the result of the recv operations
*
* Input Parameters:
* result The result of the net_timedwait operation (may indicate EINTR)
* result The result of the net_sem_timedwait operation
* (may indicate EINTR)
* pstate A pointer to the state structure to be initialized
*
* Returned Value:
@ -525,9 +526,9 @@ static ssize_t udp_recvfrom_result(int result, struct udp_recvfrom_s *pstate)
return pstate->ir_result;
}
/* If net_timedwait failed, then we were probably reawakened by a signal.
* In this case, net_timedwait will have returned negated errno
* appropriately.
/* If net_sem_timedwait failed, then we were probably reawakened by a
* signal. In this case, net_sem_timedwait will have returned negated
* errno appropriately.
*/
if (result < 0)
@ -634,11 +635,11 @@ ssize_t psock_udp_recvfrom(FAR struct socket *psock, FAR struct msghdr *msg,
state.ir_cb->event = udp_eventhandler;
/* Wait for either the receive to complete or for an error/timeout
* to occur. net_timedwait will also terminate if a signal is
* to occur. net_sem_timedwait will also terminate if a signal is
* received.
*/
ret = net_timedwait(&state.ir_sem,
ret = net_sem_timedwait(&state.ir_sem,
_SO_TIMEOUT(conn->sconn.s_rcvtimeo));
if (ret == -ETIMEDOUT)
{

View File

@ -683,7 +683,7 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf,
goto errout_with_lock;
}
ret = net_timedwait_uninterruptible(&conn->sndsem,
ret = net_sem_timedwait_uninterruptible(&conn->sndsem,
udp_send_gettimeout(start, timeout));
if (ret < 0)
{

View File

@ -462,11 +462,11 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf,
netdev_txnotify_dev(state.st_dev);
/* Wait for either the receive to complete or for an error/timeout to
* occur. NOTES: net_timedwait will also terminate if a signal
* occur. NOTES: net_sem_timedwait will also terminate if a signal
* is received.
*/
ret = net_timedwait(&state.st_sem,
ret = net_sem_timedwait(&state.st_sem,
_SO_TIMEOUT(conn->sconn.s_sndtimeo));
if (ret >= 0)
{

View File

@ -111,7 +111,7 @@ int udp_txdrain(FAR struct socket *psock, unsigned int timeout)
/* There is pending write data.. wait for it to drain. */
ret = net_timedwait_uninterruptible(&waitsem, timeout);
ret = net_sem_timedwait_uninterruptible(&waitsem, timeout);
/* Tear down the notifier (in case we timed out or were canceled) */

View File

@ -132,7 +132,7 @@ FAR struct udp_wrbuffer_s *udp_wrbuffer_alloc(void)
* buffer
*/
net_lockedwait_uninterruptible(&g_wrbuffer.sem);
net_sem_wait_uninterruptible(&g_wrbuffer.sem);
/* Now, we are guaranteed to have a write buffer structure reserved
* for us in the free list.
@ -186,7 +186,7 @@ FAR struct udp_wrbuffer_s *udp_wrbuffer_timedalloc(unsigned int timeout)
* buffer
*/
ret = net_timedwait_uninterruptible(&g_wrbuffer.sem, timeout);
ret = net_sem_timedwait_uninterruptible(&g_wrbuffer.sem, timeout);
if (ret != OK)
{
return NULL;

View File

@ -326,7 +326,7 @@ int usrsock_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
/* Wait for receive-avail (or abort, or timeout, or signal). */
ret = net_timedwait(&state.reqstate.recvsem,
ret = net_sem_timedwait(&state.reqstate.recvsem,
_SO_TIMEOUT(conn->sconn.s_rcvtimeo));
usrsock_teardown_data_request_callback(&state);
if (ret < 0)
@ -343,7 +343,7 @@ int usrsock_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
}
else
{
nerr("net_timedwait errno: %d\n", ret);
nerr("net_sem_timedwait errno: %d\n", ret);
DEBUGPANIC();
}
@ -400,7 +400,7 @@ int usrsock_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
{
/* Wait for completion of request. */
net_lockedwait_uninterruptible(&state.reqstate.recvsem);
net_sem_wait_uninterruptible(&state.reqstate.recvsem);
ret = state.reqstate.result;
DEBUGASSERT(state.valuelen <= inaddrlen);

View File

@ -191,7 +191,7 @@ int usrsock_bind(FAR struct socket *psock,
{
/* Wait for completion of request. */
net_lockedwait_uninterruptible(&state.recvsem);
net_sem_wait_uninterruptible(&state.recvsem);
ret = state.result;
}

View File

@ -163,7 +163,7 @@ int usrsock_close(FAR struct usrsock_conn_s *conn)
{
/* Wait for completion of request. */
net_lockedwait_uninterruptible(&state.recvsem);
net_sem_wait_uninterruptible(&state.recvsem);
ret = state.result;
if (ret < 0)

View File

@ -223,7 +223,7 @@ int usrsock_connect(FAR struct socket *psock,
{
/* Wait for completion of request (or signal). */
ret = net_lockedwait(&state.recvsem);
ret = net_sem_wait(&state.recvsem);
if (ret < 0)
{
/* Wait interrupted, exit early. */

View File

@ -641,7 +641,7 @@ int usrsock_do_request(FAR struct usrsock_conn_s *conn,
/* Set outstanding request for daemon to handle. */
net_lockedwait_uninterruptible(&req->lock);
net_sem_wait_uninterruptible(&req->lock);
if (++req->newxid == 0)
{
++req->newxid;
@ -662,7 +662,7 @@ int usrsock_do_request(FAR struct usrsock_conn_s *conn,
/* Wait ack for request. */
++req->nbusy; /* net_lock held. */
net_lockedwait_uninterruptible(&req->acksem);
net_sem_wait_uninterruptible(&req->acksem);
--req->nbusy; /* net_lock held. */
}
@ -700,12 +700,12 @@ void usrsock_abort(void)
* requests.
*/
ret = net_timedwait(&req->lock, 10);
ret = net_sem_timedwait(&req->lock, 10);
if (ret < 0)
{
if (ret != -ETIMEDOUT && ret != -EINTR)
{
ninfo("net_timedwait errno: %d\n", ret);
ninfo("net_sem_timedwait errno: %d\n", ret);
DEBUGASSERT(false);
}
}

View File

@ -202,7 +202,7 @@ int usrsock_getpeername(FAR struct socket *psock,
{
/* Wait for completion of request. */
net_lockedwait_uninterruptible(&state.reqstate.recvsem);
net_sem_wait_uninterruptible(&state.reqstate.recvsem);
ret = state.reqstate.result;
DEBUGASSERT(state.valuelen <= *addrlen);

View File

@ -202,7 +202,7 @@ int usrsock_getsockname(FAR struct socket *psock,
{
/* Wait for completion of request. */
net_lockedwait_uninterruptible(&state.reqstate.recvsem);
net_sem_wait_uninterruptible(&state.reqstate.recvsem);
ret = state.reqstate.result;
DEBUGASSERT(state.valuelen <= *addrlen);

View File

@ -225,7 +225,7 @@ int usrsock_getsockopt(FAR struct socket *psock, int level, int option,
{
/* Wait for completion of request. */
net_lockedwait_uninterruptible(&state.reqstate.recvsem);
net_sem_wait_uninterruptible(&state.reqstate.recvsem);
ret = state.reqstate.result;
DEBUGASSERT(state.valuelen <= *value_len);

View File

@ -236,7 +236,7 @@ int usrsock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg_)
{
/* Wait for completion of request. */
net_lockedwait_uninterruptible(&state.reqstate.recvsem);
net_sem_wait_uninterruptible(&state.reqstate.recvsem);
ret = state.reqstate.result;
DEBUGASSERT(state.valuelen <= arglen);

View File

@ -210,7 +210,7 @@ int usrsock_listen(FAR struct socket *psock, int backlog)
/* Wait for completion of request (or signal). */
ret = net_lockedwait(&state.recvsem);
ret = net_sem_wait(&state.recvsem);
if (ret < 0)
{
/* Wait interrupted, exit early. */

View File

@ -324,7 +324,7 @@ ssize_t usrsock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
/* Wait for receive-avail (or abort, or timeout, or signal). */
ret = net_timedwait(&state.reqstate.recvsem,
ret = net_sem_timedwait(&state.reqstate.recvsem,
_SO_TIMEOUT(conn->sconn.s_rcvtimeo));
usrsock_teardown_data_request_callback(&state);
if (ret < 0)
@ -341,7 +341,7 @@ ssize_t usrsock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
}
else
{
nerr("net_timedwait errno: %zd\n", ret);
nerr("net_sem_timedwait errno: %zd\n", ret);
DEBUGPANIC();
}
@ -397,7 +397,7 @@ ssize_t usrsock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
{
/* Wait for completion of request. */
net_lockedwait_uninterruptible(&state.reqstate.recvsem);
net_sem_wait_uninterruptible(&state.reqstate.recvsem);
ret = state.reqstate.result;
DEBUGASSERT(ret <= (ssize_t)len);

View File

@ -306,7 +306,7 @@ ssize_t usrsock_sendmsg(FAR struct socket *psock,
/* Wait for send-ready (or abort, or timeout, or signal). */
ret = net_timedwait(&state.recvsem,
ret = net_sem_timedwait(&state.recvsem,
_SO_TIMEOUT(conn->sconn.s_sndtimeo));
usrsock_teardown_request_callback(&state);
if (ret < 0)
@ -323,7 +323,7 @@ ssize_t usrsock_sendmsg(FAR struct socket *psock,
}
else
{
nerr("net_timedwait errno: %zd\n", ret);
nerr("net_sem_timedwait errno: %zd\n", ret);
DEBUGPANIC();
}
@ -371,7 +371,7 @@ ssize_t usrsock_sendmsg(FAR struct socket *psock,
{
/* Wait for completion of request. */
net_lockedwait_uninterruptible(&state.recvsem);
net_sem_wait_uninterruptible(&state.recvsem);
ret = state.result;
}

View File

@ -210,7 +210,7 @@ int usrsock_setsockopt(FAR struct socket *psock, int level, int option,
{
/* Wait for completion of request. */
net_lockedwait_uninterruptible(&state.recvsem);
net_sem_wait_uninterruptible(&state.recvsem);
ret = state.result;
}

View File

@ -225,7 +225,7 @@ int usrsock_socket(int domain, int type, int protocol,
/* Wait for completion of request. */
net_lockedwait_uninterruptible(&state.recvsem);
net_sem_wait_uninterruptible(&state.recvsem);
if (state.result < 0)
{

View File

@ -216,7 +216,7 @@ int net_restorelock(unsigned int count)
}
/****************************************************************************
* Name: net_timedwait
* Name: net_sem_timedwait
*
* Description:
* Atomically wait for sem (or a timeout) while temporarily releasing
@ -237,13 +237,13 @@ int net_restorelock(unsigned int count)
*
****************************************************************************/
int net_timedwait(sem_t *sem, unsigned int timeout)
int net_sem_timedwait(sem_t *sem, unsigned int timeout)
{
return _net_timedwait(sem, true, timeout);
}
/****************************************************************************
* Name: net_lockedwait
* Name: net_sem_wait
*
* Description:
* Atomically wait for sem while temporarily releasing the network lock.
@ -262,16 +262,16 @@ int net_timedwait(sem_t *sem, unsigned int timeout)
*
****************************************************************************/
int net_lockedwait(sem_t *sem)
int net_sem_wait(sem_t *sem)
{
return net_timedwait(sem, UINT_MAX);
return net_sem_timedwait(sem, UINT_MAX);
}
/****************************************************************************
* Name: net_timedwait_uninterruptible
* Name: net_sem_timedwait_uninterruptible
*
* Description:
* This function is wrapped version of net_timedwait(), which is
* This function is wrapped version of net_sem_timedwait(), which is
* uninterruptible and convenient for use.
*
* Input Parameters:
@ -284,16 +284,16 @@ int net_lockedwait(sem_t *sem)
*
****************************************************************************/
int net_timedwait_uninterruptible(sem_t *sem, unsigned int timeout)
int net_sem_timedwait_uninterruptible(sem_t *sem, unsigned int timeout)
{
return _net_timedwait(sem, false, timeout);
}
/****************************************************************************
* Name: net_lockedwait_uninterruptible
* Name: net_sem_wait_uninterruptible
*
* Description:
* This function is wrapped version of net_lockedwait(), which is
* This function is wrapped version of net_sem_wait(), which is
* uninterruptible and convenient for use.
*
* Input Parameters:
@ -305,9 +305,9 @@ int net_timedwait_uninterruptible(sem_t *sem, unsigned int timeout)
*
****************************************************************************/
int net_lockedwait_uninterruptible(sem_t *sem)
int net_sem_wait_uninterruptible(sem_t *sem)
{
return net_timedwait_uninterruptible(sem, UINT_MAX);
return net_sem_timedwait_uninterruptible(sem, UINT_MAX);
}
#ifdef CONFIG_MM_IOB