*** 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){
|
||||||
|
|
|
@ -6,7 +6,7 @@ void * msgBufferMap(msgPoolData * poolDataTab, int poolIndex, int bufferIndex) {
|
||||||
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;
|
||||||
|
@ -22,7 +22,7 @@ void * msgBufferMap(msgPoolData * poolDataTab, int poolIndex, int bufferIndex) {
|
||||||
/* 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);
|
||||||
|
@ -30,14 +30,19 @@ void * msgBufferMap(msgPoolData * poolDataTab, int poolIndex, int bufferIndex) {
|
||||||
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);
|
||||||
|
|
||||||
|
|
|
@ -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