S Sekar
|
Usage of disp_phys_addr() function
|
S Sekar
08/11/2010 4:49 AM
post62596
|
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.
|
|
|