/* Convert the hex array pointed to by buf into binary to be placed in mem. Return a pointer to the character AFTER the last byte written. May return an error.  */
int kgdb_hex2mem(char *buf, char *mem, int count)
/* Convert the hex array pointed to by buf into binary to be placed in mem. Return a pointer to the character AFTER the last byte written. May return an error.  */
int kgdb_hex2mem(char *buf, char *mem, int count)
{
	char *tmp_raw;
	char *tmp_hex;
	tmp_raw = buf + count * 2;
	tmp_hex = tmp_raw - 1;
	while (tmp_hex >= buf) {
		tmp_raw--;
		*tmp_raw = hex(*tmp_hex--);
		*tmp_raw |= hex(*tmp_hex--) << 4;
	}
	return probe_kernel_write(mem, tmp_raw, count);
}