Functions | |
int | mpmq_init (mpmq_t *mq, key_t key, cpuid_t cpuid) |
int | mpmq_destroy (mpmq_t *mq) |
int | mpmq_send (mpmq_t *mq, int8_t msgid, uint32_t data) |
int | mpmq_timedsend (mpmq_t *mq, int8_t msgid, uint32_t data, uint32_t ms) |
int | mpmq_trysend (mpmq_t *mq, int8_t msgid, uint32_t data) |
int | mpmq_receive (mpmq_t *mq, uint32_t *data) |
int | mpmq_timedreceive (mpmq_t *mq, uint32_t *data, uint32_t ms) |
int | mpmq_tryreceive (mpmq_t *mq, uint32_t *data) |
int | mpmq_notify (mpmq_t *mq, int signo, void *sigdata) |
Initialize MP message queue
mpmq_init() initialize MP message queue object. This function needs raw CPU ID at cpuid. User can use mptask_getcpuid() to get asigned CPU ID.
On the worker side, specify known key to initialize with supervisor. In this case, cpuid is ignored. If use mpmq for communicate with sub cores, set 0 to key and target CPU ID to cpuid.
[in,out] | mq | MP message queue object |
[in] | key | Unique object ID |
[in] | cpuid | Target CPU ID |
-EINVAL | Invalid argument |
int mpmq_destroy | ( | mpmq_t * | mq | ) |
Destroy MP message queue
[in,out] | mq | MP message queue object |
-EINVAL | Invalid argument |
int mpmq_send | ( | mpmq_t * | mq, |
int8_t | msgid, | ||
uint32_t | data | ||
) |
Send message via MP message queue
[in,out] | mq | MP message queue object |
[in] | msgid | User defined message ID (0-127) |
[in] | data | Message data |
-EINVAL | Invalid argument |
int mpmq_timedsend | ( | mpmq_t * | mq, |
int8_t | msgid, | ||
uint32_t | data, | ||
uint32_t | ms | ||
) |
Send message via MP message queue with timeout
[in,out] | mq | MP message queue object |
[in] | msgid | User defined message ID (0-127) |
[in] | data | Message data |
[in] | ms | Time out (milliseconds). This parameter is unused. |
-EINVAL | Invalid argument |
int mpmq_trysend | ( | mpmq_t * | mq, |
int8_t | msgid, | ||
uint32_t | data | ||
) |
Try send message via MP message queue
[in,out] | mq | MP message queue object |
[in] | msgid | User defined message ID (0-127) |
[in] | data | Message data |
-EINVAL | Invalid argument |
int mpmq_receive | ( | mpmq_t * | mq, |
uint32_t * | data | ||
) |
Receive message via MP message queue
[in,out] | mq | MP message queue object |
[out] | data | Message data |
-EINVAL | Invalid argument |
int mpmq_timedreceive | ( | mpmq_t * | mq, |
uint32_t * | data, | ||
uint32_t | ms | ||
) |
Receive message via MP message queue with timeout
[in,out] | mq | MP message queue object |
[out] | data | Message data |
[in] | ms | Time out (milliseconds). If ms is zero, then it waits forever until receiving message. If ms is MPMQ_NONBLOCK, then it behaves as polling without blocking. |
-EINVAL | Invalid argument |
-ETIMEDOUT | Timed out |
-EAGAIN | Try again when data hasn't come with non-blocking mode |
int mpmq_tryreceive | ( | mpmq_t * | mq, |
uint32_t * | data | ||
) |
Try receive message via MP message queue
[in,out] | mq | MP message queue object |
[out] | data | Message data |
-EINVAL | Invalid argument |
-EAGAIN | Try again when data hasn't come |
int mpmq_notify | ( | mpmq_t * | mq, |
int | signo, | ||
void * | sigdata | ||
) |
Request signal when MP message arrival
[in,out] | mq | MP message queue object |
[in] | signo | Signal number |
[in] | sigdata | Signal data |
-EINVAL | Invalid argument |