Avalon FIFO status pointers not working

Hi all,
I simply connected a Avalon memory FIFO to HPS. It simply takes in and out data from HPS.


But the Problem is that the read and write status pointers are not working as you can see they are stuck at 0 always…

here is my c code any idea what am i doing wrong here?
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include “C:\altera\15.1\embedded\ip\altera\hps\altera_hps\hwlib\include\hwlib.h”
#include “C:\altera\15.1\embedded\ip\altera\hps\altera_hps\hwlib\include\soc_cv_av\socal\socal.h”
#include “C:\altera\15.1\embedded\ip\altera\hps\altera_hps\hwlib\include\soc_cv_av\socal\hps.h”
#include “C:\altera\15.1\embedded\ip\altera\hps\altera_hps\hwlib\include\soc_cv_av\socal\alt_gpio.h”
#include “D:\TestDesigns\customfifoloopback3\hps_0.h”

//Main bus addresses
#define FIFO_BASE 0xC0000000
#define FIFO_SPAN 0x00001000

//LW Addresses
#define REG_BASE 0xFF200000
#define REG_SPAN 0x00200000

//initializing the pointers
void* virtual_base;
void* h2f_virtual_base;
volatile unsigned int * FIFO_write_ptr;
volatile unsigned int * FIFO_read_ptr;
volatile unsigned int * FIFO_write_status_ptr;
volatile unsigned int * FIFO_read_status_ptr;
//unsigned int value;
int data[8];
int i;
//int FIFO_FULL;
//int FIFO_EMPTY;
//main functions
int main ()
{

int fd = EXIT_FAILURE;
fd=open("/dev/mem",(O_RDWR|O_SYNC));
if (fd < 0) {
perror(“open”);
exit(EXIT_FAILURE);
}
printf(“fd is ok\n”);

//accessing the virtual addresses of the fifo pointers
virtual_base=mmap(NULL,REG_SPAN,(PROT_READ|PROT_WRITE),MAP_SHARED,fd,REG_BASE);
h2f_virtual_base=mmap(NULL,FIFO_SPAN,(PROT_READ|PROT_WRITE),MAP_SHARED,fd,FIFO_BASE);
printf(“virtual base pointer to open device memory file is ok\n”);
FIFO_write_status_ptr = (unsigned int *)(virtual_base+FIFO_0_IN_CSR_BASE);
FIFO_read_status_ptr = (unsigned int *)(virtual_base+FIFO_0_OUT_CSR_BASE);
FIFO_write_ptr=(unsigned int *)(h2f_virtual_base+FIFO_0_IN_BASE);
FIFO_read_ptr= (unsigned int *)(h2f_virtual_base+FIFO_0_OUT_BASE);
printf(“fifo pointers are ok\n”);

//entering data into the fifo
for(i=0;i<8;i++)
{
data[i]=i+1;
*FIFO_write_ptr=data[i];
printf("////////////////////////////\n");
printf(“you entered the value %d\n”,*FIFO_write_ptr);
printf(“fifo write status pointer is %d\n”,*FIFO_write_status_ptr);
printf("//////////////////////////////\n");
}

printf(“reading back the data\n”);

for(i=0;i<8;i++)
{
//reading data from the fifo
printf("////////////////////////////\n");
printf(“the output value from the fifo is %d\n”,*FIFO_read_ptr);
printf(“fifo read status pointer is %d\n”,*FIFO_read_status_ptr);
printf("/////////////////////////////\n");
}
return 0;
}