Hello,
Using IPNC_RDK v3.8.0 on DM8127 proprietary board.
I want to use shared memory between the ARM and the DSP.
In the \ipnc_rdk\ipnc_app\interface\inc\share_mem.h file there is a short example of how this is done.
The system itself has its own shared memory regions (in \ipnc_rdk\ipnc_app\interface\inc\Msg_Def.h) with their own "keys"
#define MSG_KEY 0x12345 #define SYS_MSG_KEY 0x36f9 ///< Message key used by system server. #define FILE_MSG_KEY 0xc54be5 ///< File message key. #define ALARM_KEY 0x542c7ae6 ///< Alarm message key. #define AUD_MSG_KEY 0x31 ///< Audio alarm message key
If I init a new shared memory space for my own structure with a different key, how do I specify this new area in the following API functions?
void ShareMemRead(int offset,void *buf, int length); void ShareMemWrite(int offset,void *buf, int length);
Do I have to give a specific offset? How is it calculated?
I see that ShareMemInit uses all of the MAX shared memory.
int ShareMemInit(int key)
{
mid = shmget(key, PROC_MEM_SIZE * MAX_SHARE_PROC, IPC_CREAT | 0660);
if(mid < 0)
mid = shmget(key, 0, 0);
__D("shared memory id:%d\n",mid);
if(mid < 0)
return -1;
return mid;
}
I also only found that the offset given for Shared memory is
Thanks,
Mechi