Other Parts Discussed in Thread: OMAP3530
I'm trying to compile some code using C6Run which is meant to run on the Beagleboard and accesses the Video DACs on board the OMAP3530 ... when I compile using: "c6runapp-cc -O3 -o dss_testmode_dsp dss_testmode.c" I get the following errors:
$ c6runapp-cc -O3 -o dss_testmode dss_testmode.c
undefined first referenced
symbol in file
--------- ----------------
_mmap dss_testmode.o
_munmap dss_testmode.o
error: unresolved symbols remain
error: errors encountered during linking; "dss_testmode.dsp_image.out" not
built
mv: cannot stat `dss_testmode.dsp_image.out': No such file or directory
>> error: errors occurred while reading dss_testmode.dsp
the area of source code where mmap and mummap are used is here:
unsigned long ReadPhysical(unsigned long Address)
{
int fd;
unsigned long *map_base, *virt_addr;
unsigned long read_result;
if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1);
map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, Address & ~MAP_MASK);
if(map_base == (void *) -1);// FATAL;
virt_addr = map_base + (Address & MAP_MASK);
read_result = *((unsigned long *) virt_addr);
if(munmap(map_base, MAP_SIZE) == -1);
close(fd);
return read_result;
}
void WritePhysical(unsigned long Address, unsigned long Data)
{
int fd;
unsigned long *map_base, *virt_addr;
if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1);
map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, Address & ~MAP_MASK);
if(map_base == (void *) -1);// FATAL;
virt_addr = map_base + (Address & MAP_MASK);
*((unsigned long *) virt_addr) = Data;
if(munmap(map_base, MAP_SIZE) == -1);
close(fd);
}
I have included <sys/mman.h> which defines mmap and munmap, so I'm confused as to why they are "undefined" when trying to compile. Can c6runapp-cc handel this library/header file?