int recv_mem(int sock_connect, char *buffer, char *dst, int xlen, int bsize)
{
char *mem = 0;
int fd_mem = 0;
int nrecv = 0;
int nsend = 0;
float time_val = 0;
float speed = 0;
//open /dev/mem with read and write mode
if((fd_mem = open ("/dev/mem", O_RDWR)) < 0)
{
printf ("open error");
mem = 0;
return -1;
}
unsigned int crcVal = 0;
int j = 0;
int loop = xlen/bsize;
int remainder = xlen%bsize;
printf("loop is %d and remainder is 0x%x\n", loop, remainder);
gettimeofday(&curr_time_1, NULL);
for(j=0;j
{
//map physical memory bsize bytes
mem = mmap (dst+j*bsize, bsize, PROT_READ | PROT_WRITE, MAP_SHARED, fd_mem, 0);
// printf("mem is 0x%x\n", mem);
if (mem == MAP_FAILED)
{
printf ("mmap error\n");
munmap(mem, bsize);
mem = 0;
return -2;
}