Multi-Processor Communication API.
More...
|
#define | MPDBG(format, ...) |
|
#define | MPERR(format, ...) printf("ERROR: " format, ##__VA_ARGS__) |
|
#define | KEY_SHM 1 |
|
#define | KEY_MQ 2 |
|
#define | MP_RECV_BLOCKING (0) |
|
#define | MP_RECV_POLLING (MPMQ_NONBLOCK) |
|
#define | MP_GET_CPUID() (*(volatile int *)0x4e002040) |
|
#define | MP_MAX_SUBID 6 |
|
#define | MPLOG_PREFIX "[Main] " |
|
#define | MPLog(fmt, ...) |
|
Multi-Processor Communication API.
◆ 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.