This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MessageQ需要维护SharedRegion的一致性吗



环境:DSP6678、CCS5.0

问题:在MSMC中分配了一块区域做SharedRegion,每次从SharedRegion分配内存通过messageQ发送,发送之前和接收的时候需要维护cache的一致性吗??在官方的例子shmIpcBenchmark中并没有去维护cache的一致性。

代码:

/////////////////////////////////////cfg///////////////////////////////////////////

var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
SharedRegion.translate = false;
SharedRegion.setEntryMeta(0,
{ base: Program.global.shmBase,
len: Program.global.shmSize,
ownerProcId: 0,
isValid: true,
cacheEnable: cacheEnabled,
cacheLineSize: cacheLineSize, /* Aligns allocated messages to a cache line */
name: "internal_shared_mem",
});

////////////////////////////////////发送/////////////////////////////////////////////

msg = MessageQ_alloc(HEAP_ID, MESSAGE_SIZE_IN_BYTES);
if (msg == NULL) {
System_abort("MessageQ_alloc failed\n");
}

/* !!!!!!!!!是否需要维护cache的一致性问题!!!!!!!!!!!!??????? */

status = MessageQ_put(nextQueueId, msg);
if (status < 0) {
System_abort("MessageQ_put failed\n");
}

/////////////////////////////接收//////////////////////////////////////////

/* !!!!!!!!!是否需要维护cache的一致性问题!!!!!!!!!!!!??????? */

/* Get a message */
status = MessageQ_get(messageQ, &msg, MessageQ_FOREVER);
if (status < 0) {
System_abort("MessageQ_get failed\n");
}