Re: Ioreamp vs mmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mmap() is used for the following.

1. Maps device physical address (device memory or device registers ) to user virtual address, Of course, the completion of this will happen with the help of the driver mmap which will actually map the user virtual address to physical address  with the help of remap_pfn_range().
2. Maps regular file contents to the user virtual address. Most likely used instead of read(), which is expensive in time in copying data from kernel buffers
    user buffers. Use mmap cautiously, do not append the file after mmaping.
3. Allocate address region or virtual memory region for the user application. Can be used instead of malloc(), if you know what you are doing.
         Almost all of the libc file operations uses mmap. To verify, write an application which uses fprintf or fwrite and check out using strace.

ioremap()
1. maps device physical address(device memory or device registers) to kernel virtual address


Regards,
Prabhu


On Tue, Sep 6, 2016 at 8:13 PM, Er Krishna <erkrishna@xxxxxxxxx> wrote:

> Hi all
>
> I am asking this question for understanding purpose:
>
> Please help me here:
>
> What are the core difference between mmap and ioreamp ?
>
> In which scenario one can be used for other and when it can not be ?
>
> Thanks
> Krishna


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




--
Regards,
Prabhunath G
Linux Trainer
Bangalore
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux