dpr_ptr = mmap (0, ONE_MEG, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_PHYS, NOFD, buff [4]);//1
dpr_ptr = mmap_device_memory( 0, ONE_MEG, PROT_READ|PROT_WRITE|PROT_NOCACHE, 0, buff [4] );//2
if (dpr_ptr == MAP_FAILED)
{
fprintf (stderr, “failed to map FPGA memory %x\n”, buff[4]);
perror(“MMAP”);
}
with 6.2.1, the mmap call in line //1 above fails, where it used to work with 6.2.0 and before.
(The error is Not enough memory.)
Replaced by line //2, the call succeeds.
(ONE_MEG being defined as (1024*1024)
Ironically, the example from the mmap helpviewer:
/* Map in VGA display memory */
addr = mmap( 0,
65536,
PROT_READ|PROT_WRITE,
MAP_PHYS|MAP_SHARED,
NOFD,
0xa0000 );
is exactly what line //1 is…