mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Convert mqueue structure for use in VFS as inode data; rename mqueue_inode_s; remove links, reference counts and name from mqueue structure. These will be replaced by VFS data. Remove g_msgqueues and mq_findnamed.c; these will be replace with VFS logic
This commit is contained in:
+6
-12
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/mqueue.h
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2011, 2014 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -64,13 +64,11 @@
|
||||
|
||||
struct mq_des; /* forward reference */
|
||||
|
||||
struct msgq_s
|
||||
struct mqueue_inode_s
|
||||
{
|
||||
FAR struct msgq_s *flink; /* Forward link to next message queue */
|
||||
sq_queue_t msglist; /* Prioritized message list */
|
||||
int16_t maxmsgs; /* Maximum number of messages in the queue */
|
||||
int16_t nmsgs; /* Number of message in the queue */
|
||||
int16_t nconnect; /* Number of connections to message queue */
|
||||
int16_t nwaitnotfull; /* Number tasks waiting for not full */
|
||||
int16_t nwaitnotempty; /* Number tasks waiting for not empty */
|
||||
#if CONFIG_MQ_MAXMSGSIZE < 256
|
||||
@@ -78,19 +76,15 @@ struct msgq_s
|
||||
#else
|
||||
uint16_t maxmsgsize; /* Max size of message in message queue */
|
||||
#endif
|
||||
bool unlinked; /* true if the msg queue has been unlinked */
|
||||
#ifndef CONFIG_DISABLE_SIGNALS
|
||||
FAR struct mq_des *ntmqdes; /* Notification: Owning mqdes (NULL if none) */
|
||||
pid_t ntpid; /* Notification: Receiving Task's PID */
|
||||
int ntsigno; /* Notification: Signal number */
|
||||
union sigval ntvalue; /* Notification: Signal value */
|
||||
#endif
|
||||
char name[1]; /* Start of the queue name */
|
||||
};
|
||||
|
||||
typedef struct msgq_s msgq_t;
|
||||
|
||||
#define SIZEOF_MQ_HEADER ((int)(((msgq_t*)NULL)->name))
|
||||
#define SIZEOF_MQ_HEADER ((int)(((struct mqueue_inode_s*)NULL)->name))
|
||||
|
||||
/* This describes the message queue descriptor that is held in the
|
||||
* task's TCB
|
||||
@@ -98,9 +92,9 @@ typedef struct msgq_s msgq_t;
|
||||
|
||||
struct mq_des
|
||||
{
|
||||
FAR struct mq_des *flink; /* Forward link to next message descriptor */
|
||||
FAR msgq_t *msgq; /* Pointer to associated message queue */
|
||||
int oflags; /* Flags set when message queue was opened */
|
||||
FAR struct mq_des *flink; /* Forward link to next message descriptor */
|
||||
FAR struct mqueue_inode_s *msgq; /* Pointer to associated message queue */
|
||||
int oflags; /* Flags set when message queue was opened */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -224,10 +224,6 @@ typedef CODE void (*atexitfunc_t)(void);
|
||||
typedef CODE void (*onexitfunc_t)(int exitcode, FAR void *arg);
|
||||
#endif
|
||||
|
||||
/* POSIX Message queue */
|
||||
|
||||
typedef struct msgq_s msgq_t;
|
||||
|
||||
/* struct child_status_s *********************************************************/
|
||||
/* This structure is used to maintin information about child tasks.
|
||||
* pthreads work differently, they have join information. This is
|
||||
@@ -523,7 +519,7 @@ struct tcb_s
|
||||
/* POSIX Named Message Queue Fields *******************************************/
|
||||
|
||||
#ifndef CONFIG_DISABLE_MQUEUE
|
||||
FAR msgq_t *msgwaitq; /* Waiting for this message queue */
|
||||
FAR struct mqueue_inode_s *msgwaitq; /* Waiting for this message queue */
|
||||
#endif
|
||||
|
||||
/* Library related fields *****************************************************/
|
||||
|
||||
Reference in New Issue
Block a user