index 0b8e105844067fcc4b8de4dd18dd8d35d23ffece..882c0b3e8beb5f2b56ea5381869623a2e0ace92b 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
String heaps[];
String gate;
UInt16 nextSeqNum;
+ String freeHookFxn[];
}
/*!
msg: "LM_get: Message 0x%x (seqNum = %d, srcProc = %d) was received by queue 0x%x"
};
+ /*!
+ * ======== FreeHookFxn ========
+ * Function prototype for the MessageQ_free callback
+ *
+ * @param(Bits16) heapId of message that was freed
+ * @param(Bits16) msgId of message that was freed
+ */
+ typedef Void (*FreeHookFxn)(Bits16, Bits16);
+
/*! MessageQ ID */
typedef UInt32 QueueId;
const UInt RESERVEDPRI = 2;
const UInt URGENTPRI = 3;
+ /*!
+ * Denotes any queueId is acceptable
+ *
+ * This constant is the default for the {@link #queueId} parameter.
+ * This value must match ti/ipc/MessageQ.h but is needed to initialize
+ * queueId.
+ */
+ const Bits16 ANY = ~(0);
+
/*!
* Assert raised when calling API with wrong handle
*
msg: "E_nameFailed: '%s' name failed to be added to NameServer"
};
+ /*!
+ * Error raised if the requested queueIndex is not available
+ */
+ config Error.Id E_indexNotAvailable = {
+ msg: "E_indexNotAvailable: queueIndex %d not available"
+ };
+
/*!
* Trace setting
*
*/
config UInt maxRuntimeEntries = NameServer.ALLOWGROWTH;
+ /*!
+ * Number of reserved MessageQ indexes
+ *
+ * An application can request the first N message queue indexes be
+ * reserved to be used by MessageQ_create2. MessageQ_create will
+ * not use these slots. The application can use any index less than
+ * the value of numReservedEntries for the queueIndex field in the
+ * MessageQ_Params2 structure.
+ *
+ * numReservedEntries must be equal or less than
+ * {@link #maxRuntimeEntries}.
+ */
+ config UInt numReservedEntries = 0;
+
/*!
* Gate used to make the name table thread safe
*
*/
metaonly config String tableSection = null;
+ /*!
+ * ======== freeHookFxn ========
+ * Free function in MessageQ_free after message was freed back to the heap
+ */
+ config FreeHookFxn freeHookFxn = null;
+
/*!
* ======== registerHeapMeta ========
* Statically register a heap with MessageQ
*/
config ISync.Handle synchronizer = null;
+ /*!
+ * Requested MessageQ_QueueIndex
+ *
+ * This parameter allows an application to specify the queueIndex to
+ * be used for a message queue. To use this functionality, the
+ * MessageQ.numReservedEntries static configuration parameter must be set to
+ * a specific value.
+ *
+ * The default is {@link #ANY}. This means do that you are not asking for
+ * an explicit index. MessageQ will find the first available one which is
+ * equal or greater than MessageQ.numReservedEntries.
+ */
+ config UInt16 queueIndex = ANY;
+
/*! @_nodoc
* ======== create ========
* Create a message queue
/*
* The following describes the usage of the flag field
* ---------------------------------
- * |V V V|T| reserved |P P|
+ * |V V V|T| reserved |t t t|P P|
* ---------------------------------
- * E D C B A 0 9 8 7 6 5 4 3 2 1 0
+ * F E D C B A 9 8 7 6 5 4 3 2 1 0
*
- * V = version
- * P = priority
- * T = trace flag
+ * [15:13] V = version
+ * [12] T = trace flag
+ * [11:5] reserved
+ * [4:2] t = transport Id, zero = default
+ * [1:0] P = priority
*/
/*! Mask to extract version setting */
Bits32 msgSize; /* message size */
Bits16 flags; /* bitmask of different flags */
Bits16 msgId; /* message id */
- Bits16 dstId; /* destination processor id */
- Bits16 dstProc; /* destination processor */
- Bits16 replyId; /* reply id */
- Bits16 replyProc; /* reply processor */
- Bits16 srcProc; /* source processor */
+ Bits16 dstId; /* destination queue id */
+ Bits16 dstProc; /* destination processor id */
+ Bits16 replyId; /* reply queue id */
+ Bits16 replyProc; /* reply processor id */
+ Bits16 srcProc; /* proc who initialized the msg */
Bits16 heapId; /* heap id */
Bits16 seqNum; /* sequence number */
Bits16 reserved; /* reserved */
UInt16 numQueues;
UInt16 numHeaps;
NameServer.Handle nameServer;
+ FreeHookFxn freeHookFxn;
Bool canFreeQueues;
UInt16 seqNum;
};