diff --git a/configs/ea3131/locked/mklocked.sh b/configs/ea3131/locked/mklocked.sh index d557f001eea..f3683be3e52 100755 --- a/configs/ea3131/locked/mklocked.sh +++ b/configs/ea3131/locked/mklocked.sh @@ -175,7 +175,7 @@ echo "EXTERN(sem_initialize)" >>ld-locked.inc answer=$(checkconfig CONFIG_DISABLE_MQUEUE) if [ "$answer" = n ]; then - echo "EXTERN(mq_initialize)" >>ld-locked.inc + echo "EXTERN(nxmq_initialize)" >>ld-locked.inc fi answer=$(checkconfig CONFIG_DISABLE_PTHREAD) diff --git a/sched/group/group_leave.c b/sched/group/group_leave.c index 9c9e72bb9b7..79a1bde1a10 100644 --- a/sched/group/group_leave.c +++ b/sched/group/group_leave.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/group/group_leave.c * - * Copyright (C) 2013-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -190,7 +190,7 @@ static inline void group_release(FAR struct task_group_s *group) #ifndef CONFIG_DISABLE_MQUEUE /* Close message queues opened by members of the group */ - mq_release(group); + nxmq_release(group); #endif #if defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_MM_SHM) diff --git a/sched/init/os_start.c b/sched/init/os_start.c index 27aeb62430e..80fc944956e 100644 --- a/sched/init/os_start.c +++ b/sched/init/os_start.c @@ -649,10 +649,10 @@ void os_start(void) /* Initialize the named message queue facility (if in link) */ #ifdef CONFIG_HAVE_WEAKFUNCTIONS - if (mq_initialize != NULL) + if (nxmq_initialize != NULL) #endif { - mq_initialize(); + nxmq_initialize(); } #endif diff --git a/sched/mqueue/mq_descreate.c b/sched/mqueue/mq_descreate.c index 10e548d7538..0cb0e8a01a0 100644 --- a/sched/mqueue/mq_descreate.c +++ b/sched/mqueue/mq_descreate.c @@ -62,7 +62,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: mq_desalloc + * Name: nxmq_alloc_des * * Description: * Allocate a message queue descriptor. @@ -75,7 +75,7 @@ * ****************************************************************************/ -static mqd_t mq_desalloc(void) +static mqd_t nxmq_alloc_des(void) { mqd_t mqdes; @@ -89,7 +89,7 @@ static mqd_t mq_desalloc(void) { /* Add another block of message descriptors to the list */ - mq_desblockalloc(); + nxmq_alloc_desblock(); /* And try again */ @@ -140,7 +140,7 @@ mqd_t mq_descreate(FAR struct tcb_s *mtcb, FAR struct mqueue_inode_s *msgq, /* Create a message queue descriptor for the TCB */ - mqdes = mq_desalloc(); + mqdes = nxmq_alloc_des(); if (mqdes) { /* Initialize the message queue descriptor */ diff --git a/sched/mqueue/mq_initialize.c b/sched/mqueue/mq_initialize.c index b86c74c6d94..3e46ac25542 100644 --- a/sched/mqueue/mq_initialize.c +++ b/sched/mqueue/mq_initialize.c @@ -149,7 +149,7 @@ mq_msgblockalloc(FAR sq_queue_t *queue, uint16_t nmsgs, ****************************************************************************/ /**************************************************************************** - * Name: mq_initialize + * Name: nxmq_initialize * * Description: * This function initializes the messasge system. This function must @@ -164,7 +164,7 @@ mq_msgblockalloc(FAR sq_queue_t *queue, uint16_t nmsgs, * ****************************************************************************/ -void mq_initialize(void) +void nxmq_initialize(void) { /* Initialize the message free lists */ @@ -188,11 +188,11 @@ void mq_initialize(void) /* Allocate a block of message queue descriptors */ - mq_desblockalloc(); + nxmq_alloc_desblock(); } /**************************************************************************** - * Name: mq_desblockalloc + * Name: nxmq_alloc_desblock * * Description: * Allocate a block of message descriptors and place them on the free @@ -206,7 +206,7 @@ void mq_initialize(void) * ****************************************************************************/ -void mq_desblockalloc(void) +void nxmq_alloc_desblock(void) { FAR struct mq_des_block_s *mqdesblock; diff --git a/sched/mqueue/mq_msgfree.c b/sched/mqueue/mq_msgfree.c index 3aefca36d43..9492a93d387 100644 --- a/sched/mqueue/mq_msgfree.c +++ b/sched/mqueue/mq_msgfree.c @@ -52,10 +52,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: mq_msgfree + * Name: nxmq_free_msg * * Description: - * The mq_msgfree function will return a message to the free pool of + * The nxmq_free_msg function will return a message to the free pool of * messages if it was a pre-allocated message. If the message was * allocated dynamically it will be deallocated. * @@ -67,7 +67,7 @@ * ****************************************************************************/ -void mq_msgfree(FAR struct mqueue_msg_s *mqmsg) +void nxmq_free_msg(FAR struct mqueue_msg_s *mqmsg) { irqstate_t flags; diff --git a/sched/mqueue/mq_msgqfree.c b/sched/mqueue/mq_msgqfree.c index 53e73aef1a0..976f4d30fb1 100644 --- a/sched/mqueue/mq_msgqfree.c +++ b/sched/mqueue/mq_msgqfree.c @@ -78,7 +78,7 @@ void mq_msgqfree(FAR struct mqueue_inode_s *msgq) /* Deallocate the message structure. */ next = curr->next; - mq_msgfree(curr); + nxmq_free_msg(curr); curr = next; } diff --git a/sched/mqueue/mq_rcvinternal.c b/sched/mqueue/mq_rcvinternal.c index 7f6fca8c798..8068e50e528 100644 --- a/sched/mqueue/mq_rcvinternal.c +++ b/sched/mqueue/mq_rcvinternal.c @@ -60,7 +60,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: mq_verifyreceive + * Name: nxmq_verify_receive * * Description: * This is internal, common logic shared by both mq_receive and @@ -85,7 +85,7 @@ * ****************************************************************************/ -int mq_verifyreceive(mqd_t mqdes, FAR char *msg, size_t msglen) +int nxmq_verify_receive(mqd_t mqdes, FAR char *msg, size_t msglen) { /* Verify the input parameters */ @@ -111,7 +111,7 @@ int mq_verifyreceive(mqd_t mqdes, FAR char *msg, size_t msglen) } /**************************************************************************** - * Name: mq_waitreceive + * Name: nxmq_wait_receive * * Description: * This is internal, common logic shared by both mq_receive and @@ -129,20 +129,20 @@ int mq_verifyreceive(mqd_t mqdes, FAR char *msg, size_t msglen) * * Assumptions: * - The caller has provided all validity checking of the input parameters - * using mq_verifyreceive. + * using nxmq_verify_receive. * - Interrupts should be disabled throughout this call. This is necessary * because messages can be sent from interrupt level processing. * - For mq_timedreceive, setting of the timer and this wait must be atomic. * ****************************************************************************/ -FAR struct mqueue_msg_s *mq_waitreceive(mqd_t mqdes) +FAR struct mqueue_msg_s *nxmq_wait_receive(mqd_t mqdes) { FAR struct tcb_s *rtcb; FAR struct mqueue_inode_s *msgq; FAR struct mqueue_msg_s *rcvmsg; - /* mq_waitreceive() is not a cancellation point, but it is always called + /* nxmq_wait_receive() is not a cancellation point, but it is always called * from a cancellation point. */ @@ -218,7 +218,7 @@ FAR struct mqueue_msg_s *mq_waitreceive(mqd_t mqdes) } /**************************************************************************** - * Name: mq_doreceive + * Name: nxmq_do_receive * * Description: * This is internal, common logic shared by both mq_receive and @@ -238,15 +238,15 @@ FAR struct mqueue_msg_s *mq_waitreceive(mqd_t mqdes) * * Assumptions: * - The caller has provided all validity checking of the input parameters - * using mq_verifyreceive. + * using nxmq_verify_receive. * - The user buffer, ubuffer, is known to be large enough to accept the * largest message that an be sent on this message queue * - Pre-emption should be disabled throughout this call. * ****************************************************************************/ -ssize_t mq_doreceive(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, - FAR char *ubuffer, int *prio) +ssize_t nxmq_do_receive(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, + FAR char *ubuffer, int *prio) { FAR struct tcb_s *btcb; irqstate_t flags; @@ -270,7 +270,7 @@ ssize_t mq_doreceive(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, /* We are done with the message. Deallocate it now. */ - mq_msgfree(mqmsg); + nxmq_free_msg(mqmsg); /* Check if any tasks are waiting for the MQ not full event. */ diff --git a/sched/mqueue/mq_receive.c b/sched/mqueue/mq_receive.c index 31878a29a57..63e0787227b 100644 --- a/sched/mqueue/mq_receive.c +++ b/sched/mqueue/mq_receive.c @@ -112,7 +112,7 @@ ssize_t mq_receive(mqd_t mqdes, FAR char *msg, size_t msglen, * errno appropriately. */ - if (mq_verifyreceive(mqdes, msg, msglen) != OK) + if (nxmq_verify_receive(mqdes, msg, msglen) != OK) { leave_cancellation_point(); return ERROR; @@ -127,7 +127,7 @@ ssize_t mq_receive(mqd_t mqdes, FAR char *msg, size_t msglen, sched_lock(); - /* Furthermore, mq_waitreceive() expects to have interrupts disabled + /* Furthermore, nxmq_wait_receive() expects to have interrupts disabled * because messages can be sent from interrupt level. */ @@ -135,7 +135,7 @@ ssize_t mq_receive(mqd_t mqdes, FAR char *msg, size_t msglen, /* Get the message from the message queue */ - mqmsg = mq_waitreceive(mqdes); + mqmsg = nxmq_wait_receive(mqdes); leave_critical_section(flags); /* Check if we got a message from the message queue. We might @@ -147,7 +147,7 @@ ssize_t mq_receive(mqd_t mqdes, FAR char *msg, size_t msglen, if (mqmsg) { - ret = mq_doreceive(mqdes, mqmsg, msg, prio); + ret = nxmq_do_receive(mqdes, mqmsg, msg, prio); } sched_unlock(); diff --git a/sched/mqueue/mq_recover.c b/sched/mqueue/mq_recover.c index b9a09881ebe..087dc4d3417 100644 --- a/sched/mqueue/mq_recover.c +++ b/sched/mqueue/mq_recover.c @@ -51,7 +51,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: mq_recover + * Name: nxmq_recover * * Description: * This function is called when a task is deleted via task_deleted or @@ -69,7 +69,7 @@ * ****************************************************************************/ -void mq_recover(FAR struct tcb_s *tcb) +void nxmq_recover(FAR struct tcb_s *tcb) { /* If were were waiting for a timed message queue event, then the * timer was canceled and deleted in task_recover() before this diff --git a/sched/mqueue/mq_release.c b/sched/mqueue/mq_release.c index 7a5f25129c2..2adfa04a954 100644 --- a/sched/mqueue/mq_release.c +++ b/sched/mqueue/mq_release.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/mqueue/mq_release.c * - * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,7 +48,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: mq_release + * Name: nxmq_release * * Description: * This function is called when the final member of a task group exits. @@ -63,7 +63,7 @@ * ****************************************************************************/ -void mq_release(FAR struct task_group_s *group) +void nxmq_release(FAR struct task_group_s *group) { while (group->tg_msgdesq.head) { diff --git a/sched/mqueue/mq_send.c b/sched/mqueue/mq_send.c index 59e6eecebef..a6edb3c64b8 100644 --- a/sched/mqueue/mq_send.c +++ b/sched/mqueue/mq_send.c @@ -112,7 +112,7 @@ int mq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio) * on any failures to verify. */ - if (mq_verifysend(mqdes, msg, msglen, prio) != OK) + if (nxmq_verify_send(mqdes, msg, msglen, prio) != OK) { leave_cancellation_point(); return ERROR; @@ -133,18 +133,18 @@ int mq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio) flags = enter_critical_section(); if (up_interrupt_context() || /* In an interrupt handler */ msgq->nmsgs < msgq->maxmsgs || /* OR Message queue not full */ - mq_waitsend(mqdes) == OK) /* OR Successfully waited for mq not full */ + nxmq_wait_send(mqdes) == OK) /* OR Successfully waited for mq not full */ { /* Allocate the message */ leave_critical_section(flags); - mqmsg = mq_msgalloc(); + mqmsg = nxmq_alloc_msg(); /* Check if the message was sucessfully allocated */ if (mqmsg == NULL) { - /* No... mq_msgalloc() does not set the errno value */ + /* No... nxmq_alloc_msg() does not set the errno value */ set_errno(ENOMEM); } @@ -157,7 +157,7 @@ int mq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio) * - The message queue is full AND * - When we tried waiting, the wait was unsuccessful. * - * In this case mq_waitsend() has already set the errno value. + * In this case nxmq_wait_send() has already set the errno value. */ leave_critical_section(flags); @@ -175,11 +175,11 @@ int mq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio) * * NOTE: There is a race condition here: What if a message is added by * interrupt related logic so that queue again becomes non-empty. - * That is handled because mq_dosend() will permit the maxmsgs limit + * That is handled because nxmq_do_send() will permit the maxmsgs limit * to be exceeded in that case. */ - ret = mq_dosend(mqdes, mqmsg, msg, msglen, prio); + ret = nxmq_do_send(mqdes, mqmsg, msg, msglen, prio); } sched_unlock(); diff --git a/sched/mqueue/mq_sndinternal.c b/sched/mqueue/mq_sndinternal.c index e571d1a06d8..083b497dee6 100644 --- a/sched/mqueue/mq_sndinternal.c +++ b/sched/mqueue/mq_sndinternal.c @@ -66,7 +66,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: mq_verifysend + * Name: nxmq_verify_send * * Description: * This is internal, common logic shared by both mq_send and mq_timesend. @@ -92,7 +92,8 @@ * ****************************************************************************/ -int mq_verifysend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio) +int nxmq_verify_send(mqd_t mqdes, FAR const char *msg, size_t msglen, + int prio) { /* Verify the input parameters */ @@ -118,10 +119,10 @@ int mq_verifysend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio) } /**************************************************************************** - * Name: mq_msgalloc + * Name: nxmq_alloc_msg * * Description: - * The mq_msgalloc function will get a free message for use by the + * The nxmq_alloc_msg function will get a free message for use by the * operating system. The message will be allocated from the g_msgfree * list. * @@ -144,7 +145,7 @@ int mq_verifysend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio) * ****************************************************************************/ -FAR struct mqueue_msg_s *mq_msgalloc(void) +FAR struct mqueue_msg_s *nxmq_alloc_msg(void) { FAR struct mqueue_msg_s *mqmsg; irqstate_t flags; @@ -203,7 +204,7 @@ FAR struct mqueue_msg_s *mq_msgalloc(void) } /**************************************************************************** - * Name: mq_waitsend + * Name: nxmq_wait_send * * Description: * This is internal, common logic shared by both mq_send and mq_timesend. @@ -223,17 +224,17 @@ FAR struct mqueue_msg_s *mq_msgalloc(void) * (mq_timedsend only). * * Assumptions/restrictions: - * - The caller has verified the input parameters using mq_verifysend(). + * - The caller has verified the input parameters using nxmq_verify_send(). * - Executes within a critical section established by the caller. * ****************************************************************************/ -int mq_waitsend(mqd_t mqdes) +int nxmq_wait_send(mqd_t mqdes) { FAR struct tcb_s *rtcb; FAR struct mqueue_inode_s *msgq; - /* mq_waitsend() is not a cancellation point, but it is always called from + /* nxmq_wait_send() is not a cancellation point, but it is always called from * a cancellation point. */ @@ -314,7 +315,7 @@ int mq_waitsend(mqd_t mqdes) } /**************************************************************************** - * Name: mq_dosend + * Name: nxmq_do_send * * Description: * This is internal, common logic shared by both mq_send and mq_timesend. @@ -336,8 +337,8 @@ int mq_waitsend(mqd_t mqdes) * ****************************************************************************/ -int mq_dosend(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, FAR const char *msg, - size_t msglen, int prio) +int nxmq_do_send(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, + FAR const char *msg, size_t msglen, int prio) { FAR struct tcb_s *btcb; FAR struct mqueue_inode_s *msgq; diff --git a/sched/mqueue/mq_timedreceive.c b/sched/mqueue/mq_timedreceive.c index 096f057c59e..cd00f549ac8 100644 --- a/sched/mqueue/mq_timedreceive.c +++ b/sched/mqueue/mq_timedreceive.c @@ -61,7 +61,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: mq_rcvtimeout + * Name: nxmq_rcvtimeout * * Description: * This function is called if the timeout elapses before the message queue @@ -78,7 +78,7 @@ * ****************************************************************************/ -static void mq_rcvtimeout(int argc, wdparm_t pid) +static void nxmq_rcvtimeout(int argc, wdparm_t pid) { FAR struct tcb_s *wtcb; irqstate_t flags; @@ -103,7 +103,7 @@ static void mq_rcvtimeout(int argc, wdparm_t pid) { /* Restart with task with a timeout error */ - mq_waitirq(wtcb, ETIMEDOUT); + nxmq_wait_irq(wtcb, ETIMEDOUT); } /* Interrupts may now be re-enabled. */ @@ -183,7 +183,7 @@ ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen, * errno appropriately. */ - if (mq_verifyreceive(mqdes, msg, msglen) != OK) + if (nxmq_verify_receive(mqdes, msg, msglen) != OK) { leave_cancellation_point(); return ERROR; @@ -218,7 +218,7 @@ ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen, sched_lock(); - /* Furthermore, mq_waitreceive() expects to have interrupts disabled + /* Furthermore, nxmq_wait_receive() expects to have interrupts disabled * because messages can be sent from interrupt level. */ @@ -264,12 +264,13 @@ ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen, /* Start the watchdog */ - wd_start(rtcb->waitdog, ticks, (wdentry_t)mq_rcvtimeout, 1, getpid()); + wd_start(rtcb->waitdog, ticks, (wdentry_t)nxmq_rcvtimeout, + 1, getpid()); } /* Get the message from the message queue */ - mqmsg = mq_waitreceive(mqdes); + mqmsg = nxmq_wait_receive(mqdes); /* Stop the watchdog timer (this is not harmful in the case where * it was never started) @@ -291,7 +292,7 @@ ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen, if (mqmsg) { - ret = mq_doreceive(mqdes, mqmsg, msg, prio); + ret = nxmq_do_receive(mqdes, mqmsg, msg, prio); } sched_unlock(); diff --git a/sched/mqueue/mq_timedsend.c b/sched/mqueue/mq_timedsend.c index 6e2fbf8a742..2a0bc59732a 100644 --- a/sched/mqueue/mq_timedsend.c +++ b/sched/mqueue/mq_timedsend.c @@ -61,7 +61,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: mq_sndtimeout + * Name: nxmq_sndtimeout * * Description: * This function is called if the timeout elapses before the message queue @@ -78,7 +78,7 @@ * ****************************************************************************/ -static void mq_sndtimeout(int argc, wdparm_t pid) +static void nxmq_sndtimeout(int argc, wdparm_t pid) { FAR struct tcb_s *wtcb; irqstate_t flags; @@ -103,7 +103,7 @@ static void mq_sndtimeout(int argc, wdparm_t pid) { /* Restart with task with a timeout error */ - mq_waitirq(wtcb, ETIMEDOUT); + nxmq_wait_irq(wtcb, ETIMEDOUT); } /* Interrupts may now be re-enabled. */ @@ -187,9 +187,9 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio, * on any failures to verify. */ - if (mq_verifysend(mqdes, msg, msglen, prio) != OK) + if (nxmq_verify_send(mqdes, msg, msglen, prio) != OK) { - /* mq_verifysend() will set the errno appropriately */ + /* nxmq_verify_send() will set the errno appropriately */ leave_cancellation_point(); return ERROR; @@ -197,10 +197,10 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio, /* Pre-allocate a message structure */ - mqmsg = mq_msgalloc(); + mqmsg = nxmq_alloc_msg(); if (mqmsg == NULL) { - /* Failed to allocate the message. mq_msgalloc() does not set the + /* Failed to allocate the message. nxmq_alloc_msg() does not set the * errno value. */ @@ -224,17 +224,17 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio, * * NOTE: There is a race condition here: What if a message is added by * interrupt related logic so that queue again becomes non-empty. That - * is handled because mq_dosend() will permit the maxmsgs limit to be + * is handled because nxmq_do_send() will permit the maxmsgs limit to be * exceeded in that case. */ if (msgq->nmsgs < msgq->maxmsgs || up_interrupt_context()) { /* Do the send with no further checks (possibly exceeding maxmsgs) - * Currently mq_dosend() always returns OK. + * Currently nxmq_do_send() always returns OK. */ - ret = mq_dosend(mqdes, mqmsg, msg, msglen, prio); + ret = nxmq_do_send(mqdes, mqmsg, msg, msglen, prio); sched_unlock(); leave_cancellation_point(); return ret; @@ -290,11 +290,11 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio, /* Start the watchdog and begin the wait for MQ not full */ - wd_start(rtcb->waitdog, ticks, (wdentry_t)mq_sndtimeout, 1, getpid()); + wd_start(rtcb->waitdog, ticks, (wdentry_t)nxmq_sndtimeout, 1, getpid()); /* And wait for the message queue to be non-empty */ - ret = mq_waitsend(mqdes); + ret = nxmq_wait_send(mqdes); /* This may return with an error and errno set to either EINTR * or ETIMEOUT. Cancel the watchdog timer in any event. @@ -302,11 +302,11 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio, wd_cancel(rtcb->waitdog); - /* Check if mq_waitsend() failed */ + /* Check if nxmq_wait_send() failed */ if (ret < 0) { - /* mq_waitsend() will set the errno, but the error exit will reset it */ + /* nxmq_wait_send() will set the errno, but the error exit will reset it */ result = get_errno(); goto errout_in_critical_section; @@ -320,10 +320,10 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio, * be space for another message in the message queue. NOW we can allocate * the message structure. * - * Currently mq_dosend() always returns OK. + * Currently nxmq_do_send() always returns OK. */ - ret = mq_dosend(mqdes, mqmsg, msg, msglen, prio); + ret = nxmq_do_send(mqdes, mqmsg, msg, msglen, prio); sched_unlock(); wd_delete(rtcb->waitdog); @@ -346,7 +346,7 @@ errout_in_critical_section: */ errout_with_mqmsg: - mq_msgfree(mqmsg); + nxmq_free_msg(mqmsg); sched_unlock(); set_errno(result); diff --git a/sched/mqueue/mq_waitirq.c b/sched/mqueue/mq_waitirq.c index 10dada1af49..45d3565f071 100644 --- a/sched/mqueue/mq_waitirq.c +++ b/sched/mqueue/mq_waitirq.c @@ -53,7 +53,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: mq_waitirq + * Name: nxmq_wait_irq * * Description: * This function is called when a signal or a timeout is received by a @@ -71,7 +71,7 @@ * ****************************************************************************/ -void mq_waitirq(FAR struct tcb_s *wtcb, int errcode) +void nxmq_wait_irq(FAR struct tcb_s *wtcb, int errcode) { FAR struct mqueue_inode_s *msgq; irqstate_t flags; diff --git a/sched/mqueue/mqueue.h b/sched/mqueue/mqueue.h index 34fc2d91c6c..5d8f5d1d347 100644 --- a/sched/mqueue/mqueue.h +++ b/sched/mqueue/mqueue.h @@ -141,38 +141,36 @@ struct task_group_s; /* Forward reference */ /* Functions defined in mq_initialize.c ************************************/ -void weak_function mq_initialize(void); -void mq_desblockalloc(void); - -FAR struct mqueue_inode_s *mq_findnamed(FAR const char *mq_name); -void mq_msgfree(FAR struct mqueue_msg_s *mqmsg); +void weak_function nxmq_initialize(void); +void nxmq_alloc_desblock(void); +void nxmq_free_msg(FAR struct mqueue_msg_s *mqmsg); /* mq_waitirq.c ************************************************************/ -void mq_waitirq(FAR struct tcb_s *wtcb, int errcode); +void nxmq_wait_irq(FAR struct tcb_s *wtcb, int errcode); /* mq_rcvinternal.c ********************************************************/ -int mq_verifyreceive(mqd_t mqdes, FAR char *msg, size_t msglen); -FAR struct mqueue_msg_s *mq_waitreceive(mqd_t mqdes); -ssize_t mq_doreceive(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, - FAR char *ubuffer, FAR int *prio); +int nxmq_verify_receive(mqd_t mqdes, FAR char *msg, size_t msglen); +FAR struct mqueue_msg_s *nxmq_wait_receive(mqd_t mqdes); +ssize_t nxmq_do_receive(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, + FAR char *ubuffer, FAR int *prio); /* mq_sndinternal.c ********************************************************/ -int mq_verifysend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio); -FAR struct mqueue_msg_s *mq_msgalloc(void); -int mq_waitsend(mqd_t mqdes); -int mq_dosend(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, - FAR const char *msg, size_t msglen, int prio); +int nxmq_verify_send(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio); +FAR struct mqueue_msg_s *nxmq_alloc_msg(void); +int nxmq_wait_send(mqd_t mqdes); +int nxmq_do_send(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, + FAR const char *msg, size_t msglen, int prio); /* mq_release.c ************************************************************/ -void mq_release(FAR struct task_group_s *group); +void nxmq_release(FAR struct task_group_s *group); /* mq_recover.c ************************************************************/ -void mq_recover(FAR struct tcb_s *tcb); +void nxmq_recover(FAR struct tcb_s *tcb); #undef EXTERN #ifdef __cplusplus diff --git a/sched/semaphore/sem_holder.c b/sched/semaphore/sem_holder.c index cc7c0c08a79..860032fb175 100644 --- a/sched/semaphore/sem_holder.c +++ b/sched/semaphore/sem_holder.c @@ -1113,7 +1113,7 @@ void nxsem_restorebaseprio(FAR struct tcb_s *stcb, FAR sem_t *sem) * Name: nxsem_canceled * * Description: - * Called from nxsem_waitirq() after a thread that was waiting for a semaphore + * Called from nxsem_wait_irq() after a thread that was waiting for a semaphore * count was awakened because of a signal and the semaphore wait has been * cancelled. This function restores the correct thread priority of each * holder of the semaphore. diff --git a/sched/semaphore/sem_recover.c b/sched/semaphore/sem_recover.c index edeb30e037e..bccb904e07b 100644 --- a/sched/semaphore/sem_recover.c +++ b/sched/semaphore/sem_recover.c @@ -81,7 +81,7 @@ void nxsem_recover(FAR struct tcb_s *tcb) /* The task is being deleted. If it is waiting for a semphore, then * increment the count on the semaphores. This logic is almost identical - * to what you see in nxsem_waitirq() except that no attempt is made to + * to what you see in nxsem_wait_irq() except that no attempt is made to * restart the exiting task. * * NOTE: In the case that the task is waiting we can assume: (1) That the diff --git a/sched/semaphore/sem_timeout.c b/sched/semaphore/sem_timeout.c index 1d9c86d4f1e..377793930b9 100644 --- a/sched/semaphore/sem_timeout.c +++ b/sched/semaphore/sem_timeout.c @@ -94,7 +94,7 @@ void nxsem_timeout(int argc, wdparm_t pid) { /* Cancel the semaphore wait */ - nxsem_waitirq(wtcb, ETIMEDOUT); + nxsem_wait_irq(wtcb, ETIMEDOUT); } /* Interrupts may now be enabled. */ diff --git a/sched/semaphore/sem_waitirq.c b/sched/semaphore/sem_waitirq.c index 9b845168213..4ca202f07e2 100644 --- a/sched/semaphore/sem_waitirq.c +++ b/sched/semaphore/sem_waitirq.c @@ -52,7 +52,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: nxsem_waitirq + * Name: nxsem_wait_irq * * Description: * This function is called when either: @@ -77,7 +77,7 @@ * ****************************************************************************/ -void nxsem_waitirq(FAR struct tcb_s *wtcb, int errcode) +void nxsem_wait_irq(FAR struct tcb_s *wtcb, int errcode) { irqstate_t flags; diff --git a/sched/semaphore/semaphore.h b/sched/semaphore/semaphore.h index f59345c9ce2..47bba0dfef9 100644 --- a/sched/semaphore/semaphore.h +++ b/sched/semaphore/semaphore.h @@ -71,7 +71,7 @@ void nxsem_initialize(void); /* Wake up a thread that is waiting on semaphore */ -void nxsem_waitirq(FAR struct tcb_s *wtcb, int errcode); +void nxsem_wait_irq(FAR struct tcb_s *wtcb, int errcode); /* Handle semaphore timer expiration */ diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c index 0088335318c..ebe31093aec 100644 --- a/sched/signal/sig_dispatch.c +++ b/sched/signal/sig_dispatch.c @@ -409,7 +409,7 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info) if (stcb->task_state == TSTATE_WAIT_SEM) { - nxsem_waitirq(stcb, EINTR); + nxsem_wait_irq(stcb, EINTR); } /* If the task is blocked waiting on a message queue, then that task @@ -420,7 +420,7 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info) if (stcb->task_state == TSTATE_WAIT_MQNOTEMPTY || stcb->task_state == TSTATE_WAIT_MQNOTFULL) { - mq_waitirq(stcb, EINTR); + nxmq_wait_irq(stcb, EINTR); } #endif } diff --git a/sched/task/task_cancelpt.c b/sched/task/task_cancelpt.c index ce194547d35..df404f92842 100644 --- a/sched/task/task_cancelpt.c +++ b/sched/task/task_cancelpt.c @@ -302,7 +302,7 @@ void notify_cancellation(FAR struct tcb_s *tcb) if (tcb->task_state == TSTATE_WAIT_SEM) { - nxsem_waitirq(tcb, ECANCELED); + nxsem_wait_irq(tcb, ECANCELED); } /* If the thread is blocked waiting on a message queue, then the @@ -313,7 +313,7 @@ void notify_cancellation(FAR struct tcb_s *tcb) if (tcb->task_state == TSTATE_WAIT_MQNOTEMPTY || tcb->task_state == TSTATE_WAIT_MQNOTFULL) { - mq_waitirq(tcb, ECANCELED); + nxmq_wait_irq(tcb, ECANCELED); } #endif } diff --git a/sched/task/task_recover.c b/sched/task/task_recover.c index 8f563cf1220..7c6bee21148 100644 --- a/sched/task/task_recover.c +++ b/sched/task/task_recover.c @@ -89,7 +89,7 @@ void task_recover(FAR struct tcb_s *tcb) #ifndef CONFIG_DISABLE_MQUEUE /* Handle cases where the thread was waiting for a message queue event */ - mq_recover(tcb); + nxmq_recover(tcb); #endif #ifdef CONFIG_SCHED_SPORADIC