Message-ID: <004301c9a683$c6b00200$0109220a@domain.hid> From: "Henry Bausley" Date: Mon, 16 Mar 2009 15:08:46 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0040_01C9A649.1A4C4800" Subject: [Xenomai-help] ENXIO error with large shared memory List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org This is a multi-part message in MIME format. ------=_NextPart_000_0040_01C9A649.1A4C4800 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am trying to map a large shared memory buffer and cannot seem to map 32M. I get the error code ENXIO back from the posix skin mmap. The code works for ftruncate(prgshmfd, 16777216); pPrgShm =3D mmap(NULL, 16777216, PROT_READ | PROT_WRITE, MAP_SHARED, prgs= hmfd, 0); but fails if I have ftruncate(prgshmfd, 16777216*2); pPrgShm =3D mmap(NULL, 16777216*2, PROT_READ | PROT_WRITE, MAP_SHARED, pr= gshmfd, 0); The condition failing is mmap in xenomai/skins/posix/shm.c.=20 if (!shm->addr || off + len > shm->size)=20 { err =3D ENXIO; up(&shm->maplock); goto err_free_map; } For 16M len =3D 0x1000000 and shm->size =3D 0x1000000 For 32M len =3D 0x2000000 and shm->size =3D 0x1FFF000 Is there something I didn't configure correctly that is limiting my size? I am currently using 2.4.6 Xenomai, I-pipe 2.2-07 with kernel 2.6.26-denx o= n a 1Ghz PowerPC 460EX with 2G RAM **********************************************************=0D Outbound scan for Spam or Virus by Barracuda at Delta Tau=0D ********************************************************** ------=_NextPart_000_0040_01C9A649.1A4C4800 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I am trying to map a large shared memory b= uffer and=20 cannot seem to map 32M.
I get the error code ENXIO back from the posix s= kin=20 mmap.
 
The code works for
  ftruncate(prg= shmfd,=20 16777216);
  pPrgShm =3D mmap(NULL, 16777216, PROT_READ | PROT_WRIT= E,=20 MAP_SHARED, prgshmfd, 0);
but fails if I have
  ftruncate(prgshm= fd,=20 16777216*2);
  pPrgShm =3D mmap(NULL, 16777216*2, PROT_READ | PROT_= WRITE,=20 MAP_SHARED, prgshmfd, 0);
 

The condition failing is mmap in xenomai/skins/posix/shm.c.
 
 if (!shm->addr || off + len > shm->size)=20
        {
   err =3D=20 ENXIO;
   up(&shm->maplock);
   goto=20 err_free_map;
 }
 

For  16M
len =3D 0x1000000 and shm->size =3D 0x1000000<= /DIV>
 
For 32M
len =3D 0x2000000 and shm->size =3D 0x1FFF000
 
Is there something I didn't configure correctly that is limiting my=20 size?
 
 
I am currently using 2.4.6 Xenomai, I-pipe 2.2-07 with kernel 2.6.26-d= enx=20 on a 1Ghz PowerPC 460EX with 2G RAM
------=_NextPart_000_0040_01C9A649.1A4C4800--