52 #include "pwr_class.h"
53 #include "co_platform.h"
55 #include "rt_gdb_msg.h"
64 #define qcom_cTmoNone 0
65 #define qcom_cTmoEternal -1
66 #define qcom_cIloopBack (1 << 31 | 0)
67 #define qcom_cInetEvent (1 << 31 | 100)
68 #define qcom_cIapplEvent (1 << 31 | 101)
69 #define qcom_cImhAllHandlers (1 << 31 | 102)
70 #define qcom_cImhAllOutunits (1 << 31 | 103)
71 #define qcom_cIhdServer (1 << 31 | 104)
72 #define qcom_cIhdClient (1 << 31 | 105)
73 #define qcom_cInacp (1 << 31 | 106)
74 #define qcom_cIini (1 << 31 | 107)
75 #define qcom_cImonAction (1 << 31 | 108)
81 typedef int qcom_tBus;
82 typedef int qcom_tQix;
83 typedef int qcom_tAix;
84 typedef int qcom_tRid;
96 qcom_eStype_linkConnect,
97 qcom_eStype_linkDisconnect,
98 qcom_eStype_linkActive,
99 qcom_eStype_linkStalled,
100 qcom_eStype_applConnect,
101 qcom_eStype_applDisconnect,
109 qcom_eQtype_broadcast,
115 qcom_eNodeConnectionFull = 0,
116 qcom_eNodeConnectionQcom = 1
117 } qcom_eNodeConnection;
130 static const qcom_sQid qcom_cNQid = { 0, 0 };
131 static const qcom_sQid qcom_cQnetEvent = { qcom_cInetEvent, 0 };
132 static const qcom_sQid qcom_cQapplEvent = { qcom_cIapplEvent, 0 };
133 static const qcom_sQid qcom_cQmhAllHandlers = { qcom_cImhAllHandlers, 0 };
134 static const qcom_sQid qcom_cQmhAllOutunits = { qcom_cImhAllOutunits, 0 };
135 static const qcom_sQid qcom_cQhdServer = { qcom_cIhdServer, 0 };
136 static const qcom_sQid qcom_cQhdClient = { qcom_cIhdClient, 0 };
137 static const qcom_sQid qcom_cQnacp = { qcom_cInacp, 0 };
138 static const qcom_sQid qcom_cQini = { qcom_cIini, 0 };
146 static const qcom_sAid qcom_cNAid = { 0, 0 };
179 unsigned int allocate;
192 unsigned int maxSize;
201 pwr_32Bits(pwr_Bits(initiated, 1), pwr_Bits(connected, 1),
202 pwr_Bits(active, 1), pwr_Bits(fill_0, 5), , , , ,
204 pwr_Bits(fill_1, 8), , , , , , , , pwr_Bits(fill_2, 8), , , , , , , ,
205 pwr_Bits(fill_3, 8), , , , , , , ) b;
207 #define qcom_mNode__ 0
208 #define qcom_mNode_initiated pwr_Bit(0)
209 #define qcom_mNode_connected pwr_Bit(1)
210 #define qcom_mNode_active pwr_Bit(2)
212 #define qcom_mNode_up (qcom_mNode_connected | qcom_mNode_active)
213 #define qcom_mNode_down (~qcom_mNode_up)
214 #define qcom_mNode_ (~qcom_mNode__)
268 const qcom_sQid* eid,
int mask,
int tmo);
271 const qcom_sQid* eid,
int mask,
int tmo,
int* event);
317 void qcom_SetRedundancyState(pwr_eRedundancyState state);
323 bool_t xdr_qcom_sAid(XDR* xdrs,
qcom_sAid* objp);
325 bool_t xdr_qcom_sQid(XDR* xdrs,
qcom_sQid* objp);
int qcom_QidCompare(const qcom_sQid *q1, const qcom_sQid *q2)
Compare two queue identities;.
pwr_tBoolean qcom_Reply(pwr_tStatus *sts, qcom_sGet *get, qcom_sPut *put)
Reply to a qcom_Request. The qcom_Reply() call looks almost like a qcom_Put(), but the queue id is re...
pwr_tBoolean qcom_WaitAnd(pwr_tStatus *status, const qcom_sQid *qid, const qcom_sQid *eid, int mask, int tmo)
Wait for an event or a message.
pwr_tBoolean qcom_AttachQ(pwr_tStatus *sts, const qcom_sQid *qid)
Attach to an allready created queue.
pwr_tBoolean qcom_AidIsNotEqual(const qcom_sAid *a1, const qcom_sAid *a2)
Test if two application identities are different.
pwr_tBoolean qcom_NextNode(pwr_tStatus *sts, qcom_sNode *node, pwr_tNodeId nid)
Get the next qcom node. If nid is pwr_cNNodeId the first node is returned.
void qcom_LinkConnect(pwr_tNodeId nid)
pwr_tBoolean qcom_AidIsEqual(const qcom_sAid *a1, const qcom_sAid *a2)
Test if two application identities are equal.
pwr_tBoolean qcom_QidIsEqual(const qcom_sQid *q1, const qcom_sQid *q2)
Test if two queue identities are equal.
pwr_tBoolean qcom_MyNode(pwr_tStatus *sts, qcom_sNode *node)
Get the local qcom node.
qcom_tBus qcom_MyBus(pwr_tStatus *sts)
Get the current qcom bus number.
pwr_tBoolean qcom_Unbind(pwr_tStatus *sts, const qcom_sQid *myQ, const qcom_sQid *fromQ)
Disconnect a target queue from a bound source queue.
pwr_tBoolean qcom_Exit(pwr_tStatus *sts)
Disconnect from QCom. Disconnects an application from the Qcom message bus, all resources such as,...
pwr_tBoolean qcom_QidIsNotNull(const qcom_sQid *q)
Test if queue identity is not null.
pwr_tBoolean qcom_Put(pwr_tStatus *sts, const qcom_sQid *receiver, qcom_sPut *put)
Put a new message.
pwr_tBoolean qcom_Bind(pwr_tStatus *sts, const qcom_sQid *myQ, const qcom_sQid *toQ)
Bind one queue to another.
pwr_tBoolean qcom_CreateQ(pwr_tStatus *sts, qcom_sQid *myQ, qcom_sQattr *attr, const char *qname)
Create a queue and make an implicit connect to it.
pwr_tBoolean qcom_WaitOr(pwr_tStatus *status, const qcom_sQid *qid, const qcom_sQid *eid, int mask, int tmo, int *event)
Wait for an event or a message.
pwr_tBoolean qcom_Node(pwr_tStatus *sts, qcom_sNode *node, pwr_tNodeId nid)
Get qcom node from node identity.
pwr_tBoolean qcom_QidIsNull(const qcom_sQid *q)
Test if queue identity is null.
pwr_tBoolean qcom_Free(pwr_tStatus *sts, void *buffer)
Free a previously allocated buffer.
void * qcom_Request(pwr_tStatus *sts, const qcom_sQid *receiver, qcom_sPut *put, const qcom_sQid *myQ, qcom_sGet *get, int tmo_ms, pwr_tBitMask flags)
Put a request and return the reply.
int qcom_AidCompare(const qcom_sAid *a1, const qcom_sAid *a2)
Compare two application identities;.
void * qcom_Get(pwr_tStatus *sts, const qcom_sQid *myQ, qcom_sGet *get, int tmo_ms)
Get a new message.
void qcom_LinkDisconnect(pwr_tNodeId nid)
pwr_tBoolean qcom_QidIsNotEqual(const qcom_sQid *q1, const qcom_sQid *q2)
Test if two queue identities are different.
pwr_tBoolean qcom_Init(pwr_tStatus *sts, qcom_sAid *aid, const char *aname)
Connect to QCom.
pwr_tBoolean qcom_AidIsNotNull(const qcom_sAid *a)
Test if application identity is not null.
pwr_tBoolean qcom_DeleteQ(pwr_tStatus *sts, const qcom_sQid *myQ)
Delete a queue. Delete a queue and release all resources held by the queue.
void * qcom_Alloc(pwr_tStatus *sts, unsigned int size)
Allocate a buffer in the qcom pool.
char * qcom_QidToString(char *s, qcom_sQid *qid, int prefix)
Converts a queue identifier, 'qid' to a string.
pwr_tBoolean qcom_AidIsNull(const qcom_sAid *a)
Test if application identity is null.
char * qcom_NodeName(pwr_tNodeId nid)
Get the name of a qcom node.
pwr_tNid pwr_tNodeId
Node identity type.
unsigned int pwr_tBitMask
Bitmask type.
unsigned int pwr_tBoolean
Boolean type.
int pwr_tStatus
Status type.
qcom_eNodeConnection connection
type of connection
qcom_mNode flags
node flags
pwr_tNodeId nid
node index
co_eBO bo
big/little endian
co_eOS os
operating system