Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Usage of disp_phys_addr() function: (1 Item)
   
Usage of disp_phys_addr() function  
I am trying to access shared-memory in OMAP-L137. 

                My code is as follows:
                
#include <stdlib.h>
#include <stdio.h>
#include <sys/mman.h>


int main(int argc, char *argv[]) {

      _Paddr32t *pdata;
      _Paddrt paddr_t;

      pdata = mmap_device_memory( 0, 0x0001ffff,            PROT_READ|PROT_WRITE|PROT_NOCACHE, 0, 0x80000000 );
      if ( pdata == MAP_FAILED ) {
          perror( "\nmmap_device_memory for physical address 0xb8000 failed\n" );
          exit( EXIT_FAILURE );
      }
      else printf("Virtual address is:0x%X",pdata);
      
      paddr_t = disp_phys_addr(pdata);
      printf("Physical address is:0x%X",paddr_t);
            
      return EXIT_SUCCESS;
}

In this program I am trying to know the physical address[using disp_phys_addr() function) of the shared 
memory(0x800000000) corresponding to the virtual address space. But the program says “undefined reference” error. Let 
me know the necessary header file to be included to support this function.