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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [linux/] [msg.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#ifndef _LINUX_MSG_H
2
#define _LINUX_MSG_H
3
#include <linux/ipc.h>
4
 
5
/* msgrcv options */
6
#define MSG_NOERROR     010000  /* no error if message is too big */
7
#define MSG_EXCEPT      020000  /* recv any msg except of specified type.*/
8
 
9
/* one msqid structure for each queue on the system */
10
struct msqid_ds {
11
    struct ipc_perm msg_perm;
12
    struct msg *msg_first;  /* first message on queue */
13
    struct msg *msg_last;   /* last message in queue */
14
    time_t msg_stime;       /* last msgsnd time */
15
    time_t msg_rtime;       /* last msgrcv time */
16
    time_t msg_ctime;       /* last change time */
17
    struct wait_queue *wwait;
18
    struct wait_queue *rwait;
19
    ushort msg_cbytes;      /* current number of bytes on queue */
20
    ushort msg_qnum;        /* number of messages in queue */
21
    ushort msg_qbytes;      /* max number of bytes on queue */
22
    ushort msg_lspid;       /* pid of last msgsnd */
23
    ushort msg_lrpid;       /* last receive pid */
24
};
25
 
26
/* message buffer for msgsnd and msgrcv calls */
27
struct msgbuf {
28
    long mtype;         /* type of message */
29
    char mtext[1];      /* message text */
30
};
31
 
32
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
33
struct msginfo {
34
    int msgpool;
35
    int msgmap;
36
    int msgmax;
37
    int msgmnb;
38
    int msgmni;
39
    int msgssz;
40
    int msgtql;
41
    ushort  msgseg;
42
};
43
 
44
#define MSGMNI   128   /* <= 1K */     /* max # of msg queue identifiers */
45
#define MSGMAX  4056   /* <= 4056 */   /* max size of message (bytes) */
46
#define MSGMNB 16384   /* ? */        /* default max size of a message queue */
47
 
48
/* unused */
49
#define MSGPOOL (MSGMNI*MSGMNB/1024)  /* size in kilobytes of message pool */
50
#define MSGTQL  MSGMNB            /* number of system message headers */
51
#define MSGMAP  MSGMNB            /* number of entries in message map */
52
#define MSGSSZ  16                /* message segment size */
53
#define __MSGSEG ((MSGPOOL*1024)/ MSGSSZ) /* max no. of segments */
54
#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
55
 
56
#ifdef __KERNEL__
57
 
58
/* one msg structure for each message */
59
struct msg {
60
    struct msg *msg_next;   /* next message on queue */
61
    long  msg_type;
62
    char *msg_spot;         /* message text address */
63
    time_t msg_stime;       /* msgsnd time */
64
    short msg_ts;           /* message text size */
65
};
66
 
67
/* ipcs ctl commands */
68
#define MSG_STAT 11
69
#define MSG_INFO 12
70
 
71
asmlinkage int sys_msgget (key_t key, int msgflg);
72
asmlinkage int sys_msgsnd (int msqid, struct msgbuf *msgp, size_t msgsz, int msgflg);
73
asmlinkage int sys_msgrcv (int msqid, struct msgbuf *msgp, size_t msgsz, long msgtyp,
74
                       int msgflg);
75
asmlinkage int sys_msgctl (int msqid, int cmd, struct msqid_ds *buf);
76
 
77
#endif /* __KERNEL__ */
78
 
79
#endif /* _LINUX_MSG_H */

powered by: WebSVN 2.1.0

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