/* Set the input/output data address of a tcw (depending on the value of the r-flag and w-flag). If @use_tidal is non-zero, the corresponding tida flag is set as well.  */
void tcw_set_data(struct tcw *tcw, void *data, int use_tidal)
/* Set the input/output data address of a tcw (depending on the value of the r-flag and w-flag). If @use_tidal is non-zero, the corresponding tida flag is set as well.  */
void tcw_set_data(struct tcw *tcw, void *data, int use_tidal)
{
	if (tcw->r) {
		tcw->input = (u64) ((addr_t) data);
		if (use_tidal)
			tcw->flags |= TCW_FLAGS_INPUT_TIDA;
	} else if (tcw->w) {
		tcw->output = (u64) ((addr_t) data);
		if (use_tidal)
			tcw->flags |= TCW_FLAGS_OUTPUT_TIDA;
	}
}