Multi-Processor Communication API.
More...
|
|
#define | MPDBG(format, ...) |
| |
| #define | MPERR(format, ...) |
| |
|
#define | KEY_SHM 1 |
| |
|
#define | KEY_MQ 2 |
| |
|
#define | MP_RECV_BLOCKING (0) |
| |
|
#define | MP_RECV_POLLING (MPMQ_NONBLOCK) |
| |
| #define | MP_GET_CPUID() |
| |
|
#define | MP_MAX_SUBID 6 |
| |
|
#define | MPLOG_PREFIX "[Main] " |
| |
| #define | MPLog(fmt, ...) |
| |
|
| template<typename T> |
| int | MPClass::SendObject (T &t, int subid) |
| | Send any object to the other processor.
|
| |
| template<typename T> |
| int | MPClass::RecvObject (T &t, int subid) |
| | Receive any object from the other processor.
|
| |
Multi-Processor Communication API.
◆ MPERR
| #define MPERR |
( |
| format, |
|
|
| ... ) |
Value:printf("ERROR: " format, ##__VA_ARGS__)
◆ MP_GET_CPUID
Value:(*(volatile int *)0x4e002040)
◆ MPLog
| #define MPLog |
( |
| fmt, |
|
|
| ... ) |
Value: do { \
irqstate_t flags; \
flags = printlock(); \
sync_printf(MPLOG_PREFIX fmt, ##__VA_ARGS__); \
printunlock(flags); \
} while (0)
◆ SendObject()
template<typename T>
| int MPClass::SendObject |
( |
T & | t, |
|
|
int | subid ) |
Send any object to the other processor.
- Parameters
-
| [in] | t | - reference to user-defined object |
| [in] | subid | - SubCore number(1~5) to send any message. If core is SubCore, send to MainCore by default. |
- Returns
- error code. It returns minus value on failure.
- Return values
-
| -22(-EINVAL) | Invalid argument |
| -19(-ENODEV) | No such SubCore program |
The size of object must be 128 bytes or less.
◆ RecvObject()
template<typename T>
| int MPClass::RecvObject |
( |
T & | t, |
|
|
int | subid ) |
Receive any object from the other processor.
- Parameters
-
| [out] | t | - reference to user-defined object |
| [in] | subid | - SubCore number(1~5) to receive any message. If core is SubCore, receive from MainCore by default. |
- Returns
- msgid or error code. It returns minus value on failure.
- Return values
-
| -22(-EINVAL) | Invalid argument |
| -19(-ENODEV) | No such SubCore program |
| -116(-ETIMEDOUT) | Timeout to receive from other core |
The size of object must be 128 bytes or less.