OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [include/] [linux/] [msg.h] - Diff between revs 199 and 1765

Only display areas with differences | Details | Blame | View Log

Rev 199 Rev 1765
#ifndef _LINUX_MSG_H
#ifndef _LINUX_MSG_H
#define _LINUX_MSG_H
#define _LINUX_MSG_H
#include <linux/ipc.h>
#include <linux/ipc.h>
 
 
/* msgrcv options */
/* msgrcv options */
#define MSG_NOERROR     010000  /* no error if message is too big */
#define MSG_NOERROR     010000  /* no error if message is too big */
#define MSG_EXCEPT      020000  /* recv any msg except of specified type.*/
#define MSG_EXCEPT      020000  /* recv any msg except of specified type.*/
 
 
/* one msqid structure for each queue on the system */
/* one msqid structure for each queue on the system */
struct msqid_ds {
struct msqid_ds {
    struct ipc_perm msg_perm;
    struct ipc_perm msg_perm;
    struct msg *msg_first;  /* first message on queue */
    struct msg *msg_first;  /* first message on queue */
    struct msg *msg_last;   /* last message in queue */
    struct msg *msg_last;   /* last message in queue */
    time_t msg_stime;       /* last msgsnd time */
    time_t msg_stime;       /* last msgsnd time */
    time_t msg_rtime;       /* last msgrcv time */
    time_t msg_rtime;       /* last msgrcv time */
    time_t msg_ctime;       /* last change time */
    time_t msg_ctime;       /* last change time */
    struct wait_queue *wwait;
    struct wait_queue *wwait;
    struct wait_queue *rwait;
    struct wait_queue *rwait;
    ushort msg_cbytes;      /* current number of bytes on queue */
    ushort msg_cbytes;      /* current number of bytes on queue */
    ushort msg_qnum;        /* number of messages in queue */
    ushort msg_qnum;        /* number of messages in queue */
    ushort msg_qbytes;      /* max number of bytes on queue */
    ushort msg_qbytes;      /* max number of bytes on queue */
    ushort msg_lspid;       /* pid of last msgsnd */
    ushort msg_lspid;       /* pid of last msgsnd */
    ushort msg_lrpid;       /* last receive pid */
    ushort msg_lrpid;       /* last receive pid */
};
};
 
 
/* message buffer for msgsnd and msgrcv calls */
/* message buffer for msgsnd and msgrcv calls */
struct msgbuf {
struct msgbuf {
    long mtype;         /* type of message */
    long mtype;         /* type of message */
    char mtext[1];      /* message text */
    char mtext[1];      /* message text */
};
};
 
 
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
struct msginfo {
struct msginfo {
    int msgpool;
    int msgpool;
    int msgmap;
    int msgmap;
    int msgmax;
    int msgmax;
    int msgmnb;
    int msgmnb;
    int msgmni;
    int msgmni;
    int msgssz;
    int msgssz;
    int msgtql;
    int msgtql;
    ushort  msgseg;
    ushort  msgseg;
};
};
 
 
#define MSGMNI   128   /* <= 1K */     /* max # of msg queue identifiers */
#define MSGMNI   128   /* <= 1K */     /* max # of msg queue identifiers */
#define MSGMAX  4056   /* <= 4056 */   /* max size of message (bytes) */
#define MSGMAX  4056   /* <= 4056 */   /* max size of message (bytes) */
#define MSGMNB 16384   /* ? */        /* default max size of a message queue */
#define MSGMNB 16384   /* ? */        /* default max size of a message queue */
 
 
/* unused */
/* unused */
#define MSGPOOL (MSGMNI*MSGMNB/1024)  /* size in kilobytes of message pool */
#define MSGPOOL (MSGMNI*MSGMNB/1024)  /* size in kilobytes of message pool */
#define MSGTQL  MSGMNB            /* number of system message headers */
#define MSGTQL  MSGMNB            /* number of system message headers */
#define MSGMAP  MSGMNB            /* number of entries in message map */
#define MSGMAP  MSGMNB            /* number of entries in message map */
#define MSGSSZ  16                /* message segment size */
#define MSGSSZ  16                /* message segment size */
#define __MSGSEG ((MSGPOOL*1024)/ MSGSSZ) /* max no. of segments */
#define __MSGSEG ((MSGPOOL*1024)/ MSGSSZ) /* max no. of segments */
#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
 
 
#ifdef __KERNEL__
#ifdef __KERNEL__
 
 
/* one msg structure for each message */
/* one msg structure for each message */
struct msg {
struct msg {
    struct msg *msg_next;   /* next message on queue */
    struct msg *msg_next;   /* next message on queue */
    long  msg_type;
    long  msg_type;
    char *msg_spot;         /* message text address */
    char *msg_spot;         /* message text address */
    time_t msg_stime;       /* msgsnd time */
    time_t msg_stime;       /* msgsnd time */
    short msg_ts;           /* message text size */
    short msg_ts;           /* message text size */
};
};
 
 
/* ipcs ctl commands */
/* ipcs ctl commands */
#define MSG_STAT 11
#define MSG_STAT 11
#define MSG_INFO 12
#define MSG_INFO 12
 
 
asmlinkage int sys_msgget (key_t key, int msgflg);
asmlinkage int sys_msgget (key_t key, int msgflg);
asmlinkage int sys_msgsnd (int msqid, struct msgbuf *msgp, size_t msgsz, int msgflg);
asmlinkage int sys_msgsnd (int msqid, struct msgbuf *msgp, size_t msgsz, int msgflg);
asmlinkage int sys_msgrcv (int msqid, struct msgbuf *msgp, size_t msgsz, long msgtyp,
asmlinkage int sys_msgrcv (int msqid, struct msgbuf *msgp, size_t msgsz, long msgtyp,
                       int msgflg);
                       int msgflg);
asmlinkage int sys_msgctl (int msqid, int cmd, struct msqid_ds *buf);
asmlinkage int sys_msgctl (int msqid, int cmd, struct msqid_ds *buf);
 
 
#endif /* __KERNEL__ */
#endif /* __KERNEL__ */
 
 
#endif /* _LINUX_MSG_H */
#endif /* _LINUX_MSG_H */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.