*** empty log message ***
This commit is contained in:
parent
4d535fd155
commit
d353ea2966
3 changed files with 31 additions and 25 deletions
|
@ -186,7 +186,6 @@ void * msgAllocate(msgSpace *space,
|
||||||
int bufferFreeSize;
|
int bufferFreeSize;
|
||||||
bufferFreeSize=mSPoolDataTabAddr[selectedPoolIndex].bufferSize;
|
bufferFreeSize=mSPoolDataTabAddr[selectedPoolIndex].bufferSize;
|
||||||
printf("BufferSize : %d", bufferFreeSize);
|
printf("BufferSize : %d", bufferFreeSize);
|
||||||
<<<<<<< allocate.c
|
|
||||||
|
|
||||||
resultAddr=msgBufferMap(mSPoolDataTabAddr,selectedPoolIndex,bufferFreeIndex);
|
resultAddr=msgBufferMap(mSPoolDataTabAddr,selectedPoolIndex,bufferFreeIndex);
|
||||||
if (resultAddr==NULL){
|
if (resultAddr==NULL){
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
|
|
||||||
void * msgBufferMap(msgPoolData * poolDataTab, int poolIndex, int bufferIndex) {
|
void * msgBufferMap(msgPoolData * poolDataTab, int poolIndex, int bufferIndex) {
|
||||||
void * resultAddr;
|
void * resultAddr;
|
||||||
int bufferSize, bufferNb;
|
int bufferSize, bufferNb;
|
||||||
int poolBufferTabFd;
|
int poolBufferTabFd;
|
||||||
msgPoolId poolBufferTabId;
|
msgPoolId poolBufferTabId;
|
||||||
|
printf("Mapping buffer (%d,%d)\n",poolIndex,bufferIndex);
|
||||||
// TODO: récuperer l'ID du BufferInfoTab;
|
// TODO: récuperer l'ID du BufferInfoTab;
|
||||||
strcpy(poolBufferTabId, poolDataTab[poolIndex].poolId);
|
strcpy(poolBufferTabId, poolDataTab[poolIndex].poolId);
|
||||||
bufferSize=poolDataTab[poolIndex].bufferSize;
|
bufferSize=poolDataTab[poolIndex].bufferSize;
|
||||||
|
@ -21,27 +21,32 @@ void * msgBufferMap(msgPoolData * poolDataTab, int poolIndex, int bufferIndex) {
|
||||||
// mapper le buffer dans l'espace mémoire du processus
|
// mapper le buffer dans l'espace mémoire du processus
|
||||||
/* on s'arrete juste derriere l'index qui nous intéresse */
|
/* on s'arrete juste derriere l'index qui nous intéresse */
|
||||||
resultAddr=mmap(NULL,
|
resultAddr=mmap(NULL,
|
||||||
bufferSize*(bufferIndex+1),
|
bufferSize*(bufferIndex+1),
|
||||||
PROT_NONE,
|
PROT_READ|PROT_WRITE, //PROT_NONE
|
||||||
MAP_SHARED,
|
MAP_SHARED,
|
||||||
poolBufferTabFd,
|
poolBufferTabFd,
|
||||||
(off_t)0);
|
(off_t)0);
|
||||||
if(resultAddr == MAP_FAILED) {
|
if(resultAddr == MAP_FAILED) {
|
||||||
NZG_ERROR("mmap", poolBufferTabId);
|
NZG_ERROR("mmap", poolBufferTabId);
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
}
|
}
|
||||||
|
printf( "Mapped from 0x%08x\n to 0x%08x\n",
|
||||||
|
(int)resultAddr,
|
||||||
|
(int)resultAddr+ bufferSize*(bufferIndex+1)
|
||||||
|
);
|
||||||
|
|
||||||
resultAddr=resultAddr +( bufferSize*bufferIndex);
|
resultAddr=resultAddr +( bufferSize*bufferIndex);
|
||||||
|
printf( "Moved to 0x%08x\n",(int)resultAddr );
|
||||||
|
|
||||||
mprotect(
|
/* mprotect(
|
||||||
resultAddr,
|
resultAddr,
|
||||||
bufferSize,
|
bufferSize,
|
||||||
PROT_READ|PROT_WRITE
|
PROT_READ|PROT_WRITE
|
||||||
);
|
);*/
|
||||||
|
|
||||||
close(poolBufferTabFd);
|
close(poolBufferTabFd);
|
||||||
|
|
||||||
return resultAddr;
|
return resultAddr;
|
||||||
ERROR:
|
ERROR:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,8 @@ int msgBufferGetProcAttach(msgPoolData *poolDataTabAddr, int poolNb, int *poolIn
|
||||||
int msgBufferInfoTabCreate(msgSpaceId externId, msgPoolData *poolDataTabAddr, int poolIdx, int bufferNb);
|
int msgBufferInfoTabCreate(msgSpaceId externId, msgPoolData *poolDataTabAddr, int poolIdx, int bufferNb);
|
||||||
/* bufferInfoTabInit.c */
|
/* bufferInfoTabInit.c */
|
||||||
int msgBufferInfoTabInit(msgPoolData *poolDataTabAddr, int poolIndex);
|
int msgBufferInfoTabInit(msgPoolData *poolDataTabAddr, int poolIndex);
|
||||||
|
/* bufferMap.c */
|
||||||
|
void *msgBufferMap(msgPoolData *poolDataTab, int poolIndex, int bufferIndex);
|
||||||
/* free.c */
|
/* free.c */
|
||||||
int msgFree(msgSpace *space, void *addr);
|
int msgFree(msgSpace *space, void *addr);
|
||||||
/* get.c */
|
/* get.c */
|
||||||
|
|
Loading…
Reference in a new issue