X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=kern%2Fmsg.h;h=32232c56e018d3e2d487bddfb318fc840a50a96c;hb=HEAD;hp=0fcfffad45df50bb8039163b2c0e340e6e621da3;hpb=52cd7843bd8f38047401c768abee7309157344a2;p=bertos.git diff --git a/kern/msg.h b/kern/msg.h deleted file mode 100755 index 0fcfffad..00000000 --- a/kern/msg.h +++ /dev/null @@ -1,59 +0,0 @@ -/*! - * \file - * - * - * \brief Simple inter-process messaging system - * - * This module implements a common system for executing - * a user defined action calling a hook function. - * - * \version $Id$ - * - * \author Bernardo Innocenti - */ - -/* - * $Log$ - * Revision 1.1 2004/06/06 15:11:08 bernie - * Import into DevLib. - * - */ -#ifndef KERN_MSG_H -#define KERN_MSG_H - -#include "event.h" - - -typedef struct MsgPort -{ - List queue; /*!< Messages queued at this port */ - Event evn; /*!< Event to trigger when a message arrives */ -} MsgPort; - - -typedef struct Msg -{ - Node link; /*!< Link into message port queue */ - MsgPort *replyPort; /*!< Port to which the msg is to be replied */ - /* User data may follow */ -} Msg; - - -/*! Initialize a messge port */ -#define INITPORT(p) INITLIST(&(p)->queue) - -/*! Queue a message to a message port */ -#define PUTMSG(p,m) (ADDTAIL(&(p)->queue,(Node *)(m)), DOEVENT(&(p)->evn)) -#define PUTMSG_INTR(p,m) (ADDTAIL(&(p)->queue,(Node *)(m)), DOEVENT_INTR(&(p)->evn)) - -/*! Get first message from port's queue (returns NULL when the port is empty) */ -#define GETMSG(p) ((Msg *)REMHEAD(&(p)->queue)) - -/*! Reply a message to its sender */ -#define REPLYMSG(m) (PUTMSG((m)->replyPort,(m))) - -#endif /* KERN_MSG_H */