
/*
 *  Header file IPC Request Functions
 * :set tabstop=4
 */

#ifndef __IPC_REQ_TASK_HEADER
#define __IPC_REQ_TASK_HEADER

int time_advance_init();
int cal_time_advance_req(p_ipc_req preq, unsigned int id, int tm_type, int num);
int time_advance_req(p_ipc_req preq, unsigned int id, int tm_type, int num);
int set_time_period(int tm_type, int num);
int get_sock_status(p_ipc_socket psock);
int gba_mem_bd_ops(int id, int rd, int offs, int count, int type);
int gba_mem_sz(int count, int type);
unsigned int* gba_mem_get(int offs, int count, int type);
int gba_set_wait(int wait1, int wait2);

int gba_rom_read(int id, int ptr, int addr, int num);
int gba_rom_write(int id, int ptr, int addr, int num);
int gba_sram_rw(int id, int addr, int data, int xz, int rd);

int cpu_set_mode(int wh, int m, int t, int p);
int cpu_get_mode(int wh, int *m, int *t, int *p);

unsigned int cpu_bd_read(unsigned int id, int wh, 
	unsigned int addr, int sz, int xz_type);
int cpu_bd_write(unsigned int id, int wh, unsigned int addr,
        int sz, int xz_type, unsigned int *pdata, int fill);
int cpu_handle_issue(unsigned int id, unsigned int *pdata);

int convertTagAddr(unsigned int addr, int sz);
int acc_bd_read(p_ipc_req preq, unsigned int cur_addr, 
		unsigned int data, unsigned int xz);
int acc_bd_write(p_ipc_req preq, unsigned int cur_addr, 
		unsigned int *data, unsigned int *xz);

int ipc_bd_done(int wh, unsigned int addr);
int ipc_bd_data_size(unsigned int addr, int sz, int xz_type);

int ipc_pg_size_bit();

int flash_write(int addr, int sz, unsigned char *data);
unsigned char * flash_read(int addr, int sz); 
int gba_bus_trans(int id, int type);

#endif
