uint32_t *param_out = malloc(count * sizeof(uint32_t));
int i;
-// int retval;
+ int retval = ERROR_OK;
int blocksize;
int bytesread;
uint32_t param_in[2];
param_in[0] = addr;
param_in[1] = blocksize;
- mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \
+ retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code,
ARRAY_SIZE(param_in), param_in, count, param_out, 1);
// count -= blocksize;
free(param_out);
- return ERROR_OK;
+ return retval;
}
static int mips32_pracc_read_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int count, uint8_t *buf)
uint32_t *param_out = malloc(count * sizeof(uint32_t));
int i;
-// int retval;
+ int retval = ERROR_OK;
int blocksize;
int bytesread;
uint32_t param_in[2];
param_in[0] = addr;
param_in[1] = blocksize;
- mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \
+ retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code,
ARRAY_SIZE(param_in), param_in, count, param_out, 1);
// count -= blocksize;
free(param_out);
- return ERROR_OK;
+ return retval;
}
int mips32_pracc_write_mem(struct mips_ejtag *ejtag_info, uint32_t addr, int size, int count, void *buf)
memcpy(¶m_in[2], buf, count * sizeof(uint32_t));
- mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \
+ int retval;
+ retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code,
count + 2, param_in, 0, NULL, 1);
free(param_in);
- return ERROR_OK;
+ return retval;
}
static int mips32_pracc_write_u32(struct mips_ejtag *ejtag_info, uint32_t addr, uint32_t *buf)
param_in[0] = addr;
param_in[1] = *buf;
- mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \
+ return mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code,
ARRAY_SIZE(param_in), param_in, 0, NULL, 1);
-
- return ERROR_OK;
}
static int mips32_pracc_write_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int count, uint16_t *buf)
param_in[i + 2] = buf[i];
}
- mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \
+ int retval;
+ retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code,
count + 2, param_in, 0, NULL, 1);
free(param_in);
- return ERROR_OK;
+ return retval;
}
static int mips32_pracc_write_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int count, uint8_t *buf)
param_in[i + 2] = buf[i];
}
- retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \
+ retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code,
count + 2, param_in, 0, NULL, 1);
free(param_in);
int retval;
- retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \
+ retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code,
MIPS32NUMCOREREGS, regs, 0, NULL, 1);
return retval;
int retval;
- retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \
+ retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code,
0, NULL, MIPS32NUMCOREREGS, regs, 1);
return retval;
MIPS32_MFC0(1,31,0), /* move COP0 DeSave to $1 */
};
- mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \
- 0, NULL, 0, NULL, 1);
-
- return ERROR_OK;
+ return mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code,
+ 0, NULL, 0, NULL, 1);
}
static int mips_ejtag_step_disable(struct mips_ejtag *ejtag_info)
MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */
};
- mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \
+ return mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code,
0, NULL, 0, NULL, 1);
-
- return ERROR_OK;
}
int mips_ejtag_config_step(struct mips_ejtag *ejtag_info, int enable_step)
inst = MIPS32_DRET;
/* execute our dret instruction */
- mips32_pracc_exec(ejtag_info, 1, &inst, 0, NULL, 0, NULL, 0);
-
- return ERROR_OK;
+ return mips32_pracc_exec(ejtag_info, 1, &inst, 0, NULL, 0, NULL, 0);
}
int mips_ejtag_read_debug(struct mips_ejtag *ejtag_info, uint32_t* debug_reg)
MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */
};
- mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \
+ return mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code,
0, NULL, 1, debug_reg, 1);
-
- return ERROR_OK;
}
int mips_ejtag_init(struct mips_ejtag *ejtag_info)