Lines Matching refs:rc

83 	struct _citrus_mapper_std_rowcol *rc;  in rowcol_convert()  local
89 rc = &ms->ms_rowcol; in rowcol_convert()
91 for (i = rc->rc_src_rowcol_len * rc->rc_src_rowcol_bits, in rowcol_convert()
92 lz = &rc->rc_src_rowcol[0]; i > 0; ++lz) { in rowcol_convert()
93 i -= rc->rc_src_rowcol_bits; in rowcol_convert()
94 n = (src >> i) & rc->rc_src_rowcol_mask; in rowcol_convert()
96 switch (rc->rc_oob_mode) { in rowcol_convert()
98 *dst = rc->rc_dst_invalid; in rowcol_convert()
108 switch (rc->rc_dst_unit_bits) { in rowcol_convert()
110 conv = _region_peek8(&rc->rc_table, idx); in rowcol_convert()
113 conv = be16toh(_region_peek16(&rc->rc_table, idx*2)); in rowcol_convert()
116 conv = be32toh(_region_peek32(&rc->rc_table, idx*4)); in rowcol_convert()
122 if (conv == rc->rc_dst_invalid) { in rowcol_convert()
123 *dst = rc->rc_dst_invalid; in rowcol_convert()
126 if (conv == rc->rc_dst_ilseq) in rowcol_convert()
150 rowcol_parse_variable_compat(struct _citrus_mapper_std_rowcol *rc, in rowcol_parse_variable_compat() argument
160 rc->rc_dst_invalid = be32toh(rcx->rcx_dst_invalid); in rowcol_parse_variable_compat()
161 rc->rc_dst_unit_bits = be32toh(rcx->rcx_dst_unit_bits); in rowcol_parse_variable_compat()
165 rc->rc_src_rowcol_bits = m; in rowcol_parse_variable_compat()
166 rc->rc_src_rowcol_mask = n; in rowcol_parse_variable_compat()
168 rc->rc_src_rowcol = malloc(2 * in rowcol_parse_variable_compat()
169 sizeof(*rc->rc_src_rowcol)); in rowcol_parse_variable_compat()
170 if (rc->rc_src_rowcol == NULL) in rowcol_parse_variable_compat()
172 lz = rc->rc_src_rowcol; in rowcol_parse_variable_compat()
173 rc->rc_src_rowcol_len = 1; in rowcol_parse_variable_compat()
179 free(rc->rc_src_rowcol); in rowcol_parse_variable_compat()
180 rc->rc_src_rowcol = NULL; in rowcol_parse_variable_compat()
183 ++rc->rc_src_rowcol_len, ++lz; in rowcol_parse_variable_compat()
192 rowcol_parse_variable(struct _citrus_mapper_std_rowcol *rc, in rowcol_parse_variable() argument
203 rc->rc_dst_invalid = be32toh(rcx->rcx_dst_invalid); in rowcol_parse_variable()
204 rc->rc_dst_unit_bits = be32toh(rcx->rcx_dst_unit_bits); in rowcol_parse_variable()
209 rc->rc_src_rowcol_bits = m; in rowcol_parse_variable()
210 rc->rc_src_rowcol_mask = n; in rowcol_parse_variable()
212 rc->rc_src_rowcol_len = be32toh(rcx->rcx_src_rowcol_len); in rowcol_parse_variable()
213 if (rc->rc_src_rowcol_len > _CITRUS_MAPPER_STD_ROWCOL_MAX) in rowcol_parse_variable()
215 rc->rc_src_rowcol = malloc(rc->rc_src_rowcol_len * in rowcol_parse_variable()
216 sizeof(*rc->rc_src_rowcol)); in rowcol_parse_variable()
217 if (rc->rc_src_rowcol == NULL) in rowcol_parse_variable()
219 for (i = 0, lz = rc->rc_src_rowcol; in rowcol_parse_variable()
220 i < rc->rc_src_rowcol_len; ++i, ++lz) { in rowcol_parse_variable()
225 free(rc->rc_src_rowcol); in rowcol_parse_variable()
226 rc->rc_src_rowcol = NULL; in rowcol_parse_variable()
236 struct _citrus_mapper_std_rowcol *rc; in rowcol_uninit() local
238 rc = &ms->ms_rowcol; in rowcol_uninit()
239 free(rc->rc_src_rowcol); in rowcol_uninit()
246 struct _citrus_mapper_std_rowcol *rc; in rowcol_init() local
255 rc = &ms->ms_rowcol; in rowcol_init()
259 &rc->rc_table, NULL); in rowcol_init()
275 ret = rowcol_parse_variable_compat(rc, &r); in rowcol_init()
278 ret = rowcol_parse_variable(rc, &r); in rowcol_init()
286 switch (rc->rc_src_rowcol_bits) { in rowcol_init()
288 if (rc->rc_src_rowcol_len <= 32 / rc->rc_src_rowcol_bits) in rowcol_init()
296 rc->rc_oob_mode = _CITRUS_MAPPER_STD_OOB_NONIDENTICAL; in rowcol_init()
297 rc->rc_dst_ilseq = rc->rc_dst_invalid; in rowcol_init()
306 rc->rc_oob_mode = be32toh(eix->eix_oob_mode); in rowcol_init()
307 rc->rc_dst_ilseq = be32toh(eix->eix_dst_ilseq); in rowcol_init()
311 i = rc->rc_src_rowcol_len; in rowcol_init()
312 lz = &rc->rc_src_rowcol[--i]; in rowcol_init()
315 lz = &rc->rc_src_rowcol[--i]; in rowcol_init()
318 table_size *= rc->rc_dst_unit_bits/8; in rowcol_init()
321 _region_size(&rc->rc_table) < table_size) in rowcol_init()