Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
59451ae6
Commit
59451ae6
authored
17 years ago
by
patacongo
Browse files
Options
Downloads
Patches
Plain Diff
Cosmetic
git-svn-id:
svn://svn.code.sf.net/p/nuttx/code/trunk@589
42af7a65-404d-4744-a932-0658087f49c3
parent
715cc891
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sched/mq_descreate.c
+22
-22
22 additions, 22 deletions
sched/mq_descreate.c
sched/mq_open.c
+23
-23
23 additions, 23 deletions
sched/mq_open.c
sched/mq_rcvinternal.c
+29
-29
29 additions, 29 deletions
sched/mq_rcvinternal.c
with
74 additions
and
74 deletions
sched/mq_descreate.c
+
22
−
22
View file @
59451ae6
/************************************************************
/************************************************************
****************
* mq_descreate.c
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Copyright (C) 2007
, 2008
Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
...
...
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name
Gregory
Nutt nor the names of its contributors may be
* 3. Neither the name Nutt
X
nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
...
...
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Included Files
************************************************************/
************************************************************
****************
/
#include
<stdarg.h>
/* va_list */
#include
<unistd.h>
...
...
@@ -53,27 +53,27 @@
#include
<nuttx/kmalloc.h>
#include
"mq_internal.h"
/************************************************************
/************************************************************
****************
* Definitions
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Type Declarations
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Global Variables
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Variables
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Functions
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Function: mq_desalloc
*
* Description:
...
...
@@ -85,7 +85,7 @@
* Return Value:
* Reference to the allocated mq descriptor.
*
************************************************************/
************************************************************
****************
/
static
mqd_t
mq_desalloc
(
void
)
{
...
...
@@ -111,11 +111,11 @@ static mqd_t mq_desalloc(void)
return
mqdes
;
}
/************************************************************
/************************************************************
****************
* Public Functions
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Function: mq_descreate
*
* Description:
...
...
@@ -129,7 +129,7 @@ static mqd_t mq_desalloc(void)
* Return Value:
*
*
************************************************************/
************************************************************
****************
/
mqd_t
mq_descreate
(
FAR
_TCB
*
mtcb
,
FAR
msgq_t
*
msgq
,
int
oflags
)
{
...
...
This diff is collapsed.
Click to expand it.
sched/mq_open.c
+
23
−
23
View file @
59451ae6
/************************************************************
/************************************************************
****************
* mq_open.c
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Copyright (C) 2007
, 2008
Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
...
...
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name
Gregory
Nutt nor the names of its contributors may be
* 3. Neither the name Nutt
X
nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
...
...
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Included Files
************************************************************/
************************************************************
****************
/
#include
<sys/types.h>
/* uint32, etc. */
#include
<stdarg.h>
/* va_list */
...
...
@@ -49,31 +49,31 @@
#include
"os_internal.h"
#include
"mq_internal.h"
/************************************************************
/************************************************************
****************
* Definitions
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Type Declarations
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Global Variables
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Variables
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Functions
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Public Functions
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Function: mq_open
*
* Description:
...
...
@@ -100,7 +100,7 @@
*
* Assumptions:
*
************************************************************/
************************************************************
****************
/
mqd_t
mq_open
(
const
char
*
mq_name
,
int
oflags
,
...)
{
...
...
@@ -125,11 +125,11 @@ mqd_t mq_open(const char *mq_name, int oflags, ...)
msgq
=
mq_findnamed
(
mq_name
);
if
(
msgq
)
{
/* It does. Check if the caller wanted to create
*
a new
message queue with this name
.
/* It does. Check if the caller wanted to create
a new
* message queue with this name
(i.e., O_CREAT|O_EXCL)
*/
if
(
!
(
oflags
&
O_CREAT
)
||
!
(
oflags
&
O_EXCL
))
if
((
oflags
&
O_CREAT
)
==
0
||
(
oflags
&
O_EXCL
)
==
0
)
{
/* Create a message queue descriptor for the TCB */
...
...
This diff is collapsed.
Click to expand it.
sched/mq_rcvinternal.c
+
29
−
29
View file @
59451ae6
/************************************************************
* mq_rcvinternal.c
/************************************************************
****************
*
sched/
mq_rcvinternal.c
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Copyright (C) 2007
, 2008
Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
...
...
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name
Gregory
Nutt nor the names of its contributors may be
* 3. Neither the name Nutt
X
nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
...
...
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Included Files
************************************************************/
************************************************************
****************
/
#include
<sys/types.h>
#include
<fcntl.h>
/* O_NONBLOCK */
...
...
@@ -49,31 +49,31 @@
#include
"os_internal.h"
#include
"mq_internal.h"
/************************************************************
/************************************************************
****************
* Definitions
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Type Declarations
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Global Variables
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Variables
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Functions
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Public Functions
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Name: mq_verifyreceive
*
* Description:
...
...
@@ -97,7 +97,7 @@
*
* Assumptions:
*
************************************************************/
************************************************************
****************
/
int
mq_verifyreceive
(
mqd_t
mqdes
,
void
*
msg
,
size_t
msglen
)
{
...
...
@@ -124,7 +124,7 @@ int mq_verifyreceive(mqd_t mqdes, void *msg, size_t msglen)
return
OK
;
}
/************************************************************
/************************************************************
****************
* Function: mq_waitreceive
*
* Description:
...
...
@@ -150,7 +150,7 @@ int mq_verifyreceive(mqd_t mqdes, void *msg, size_t msglen)
* - For mq_timedreceive, setting of the timer and this wait
* must be atomic.
*
************************************************************/
************************************************************
****************
/
FAR
mqmsg_t
*
mq_waitreceive
(
mqd_t
mqdes
)
{
...
...
@@ -166,13 +166,13 @@ FAR mqmsg_t *mq_waitreceive(mqd_t mqdes)
while
((
rcvmsg
=
(
FAR
mqmsg_t
*
)
sq_remfirst
(
&
msgq
->
msglist
))
==
NULL
)
{
/* Should we block until there the above condition
has been
* satisfied?
/*
The queue is empty!
Should we block until there the above condition
*
has been
satisfied?
*/
if
(
!
(
mqdes
->
oflags
&
O_NONBLOCK
))
if
((
mqdes
->
oflags
&
O_NONBLOCK
)
==
0
)
{
/* Block and try again */
/*
Yes..
Block and try again */
rtcb
=
(
FAR
_TCB
*
)
g_readytorun
.
head
;
rtcb
->
msgwaitq
=
msgq
;
...
...
@@ -214,7 +214,7 @@ FAR mqmsg_t *mq_waitreceive(mqd_t mqdes)
return
rcvmsg
;
}
/************************************************************
/************************************************************
****************
* Function: mq_doreceive
*
* Description:
...
...
@@ -245,7 +245,7 @@ FAR mqmsg_t *mq_waitreceive(mqd_t mqdes)
* message queue
* - Pre-emption should be disabled throughout this call.
*
************************************************************/
************************************************************
****************
/
ssize_t
mq_doreceive
(
mqd_t
mqdes
,
mqmsg_t
*
mqmsg
,
void
*
ubuffer
,
int
*
prio
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment