Monday, June 3, 2013

Linux Fixmap role

Fixmaps the kernel (virtual) address fixed address space mapped to physical memory, with the DMA / Normal zone direct physical memory address mapping is somewhat similar. However, at the beginning of the direct address 4GB mapping is linear, that is the physical address and the address of a linear mapping exists between the calculated paddr = vaddr - PAGE_OFFSET; fixed address mapping can map any physical address, including DMA Normal Highmem.

Fixmaps meaning of existence
Each fixed mapping a linear address are mapped to a physical memory page frame, fixed mapping kernel linear address to replace some of the pointer variable, since these linear addresses corresponding to the physical address will not change. In fact, a fixed mapping can correspond to multiple frames, as long as the index is incremented, to retain a few frames.
Pointer fixed mapping the linear address as the following advantages:
1 It is better than using ordinary least once a pointer variable address access
(2) ensure fixmaps kernel page table entry in the context switch will not go out from the TLB flush, so visit took place in the high-speed cache

Correlation function
  1. inline  unsigned  Long  fix_to_virt ( const  unsigned  int  IDX)  
This function calculates the index corresponds to a given constant linear address, return address similar 0xFFFC0000 ~ 0xFFFFF000
  1. set_fixmap (idx, phys)  
  2.   
  3. set_fixmap_nocache (idx, phys)  
To a physical address and a fixed linear address mappings associate, set_fixmap_nocache accessing the data in the page box to disable hardware caches, because in some cases the access requirements to disable caching.

No comments:

Post a Comment