Hi All,
I need help with the mmap failure with my linux kernel version 3.6.4
here is the following code
if ((fd = open ("/dev/mem", O_RDWR)) < 0)
{
return ((uint32_t) -1);
}
mem_virt_addr = mmap (NULL,
mem_size,
PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_NORESERVE,
fd,
0);
close (fd);
if (mem_virt_addr == NULL)
{
error_msg ("memory count not be mapped (%d).", errno);
return ((uint32_t) -1);
}
From the above code if I specify mem_size as 1MB (1024*1024) code works fine. If I increase the size >1MB then I get error number 22 which is "EINVAL". Can any one help me on how to get rid of this error. I need a memory size of 64MB.