Lines Matching refs:ist

141 #define	ADDR(place)	((void *)(((char *)(ist->itm_hdr)) +\
143 #define ADDR2(place2) ((void *)(((char *)(ist->itm_hdr)) +\
149 #define REG(n) (*(ist->regs + (n)))
171 icv_state_t *ist; in _icv_open() local
189 if (NULL == (ist = malloc(sizeof (icv_state_t)))) { in _icv_open()
196 ist->itm = itm_ref; in _icv_open()
197 ist->itm_hdr = ist->itm->hdr; in _icv_open()
198 ist->reg_num = ist->itm->hdr->reg_num; in _icv_open()
200 hdr = ist->itm->hdr; in _icv_open()
201 ist->direc = ADDR(hdr->direc_init_tbl); in _icv_open()
202 ist->default_action.itm_64d = 0; in _icv_open()
204 ist->op_depth = 0; in _icv_open()
212 _icv_close(ist); in _icv_open()
220 ist->regs = NULL; in _icv_open()
222 ist->regs = malloc((sizeof (itm_num_t)) * hdr->reg_num); in _icv_open()
223 if (NULL == ist->regs) { in _icv_open()
225 _icv_close(ist); in _icv_open()
229 (void) memset(ist->regs, 0, in _icv_open()
235 if (0 != ist->itm_hdr->op_init_tbl.itm_ptr) { in _icv_open()
240 (void) eval_op_tbl(ist, ist->itm_hdr->op_init_tbl, &ip, in _icv_open()
243 op_init_default(ist); in _icv_open()
246 return (ist); in _icv_open()
254 _icv_close(icv_state_t *ist) in _icv_close() argument
256 if (NULL == ist) { in _icv_close()
260 itm_ref_dec(ist->itm); in _icv_close()
261 free(ist->regs); in _icv_close()
262 free(ist); in _icv_close()
271 icv_state_t *ist, in _icv_iconv() argument
284 if (NULL == ist) { in _icv_iconv()
298 hdr = ist->itm_hdr; in _icv_iconv()
314 ist->direc = ADDR(hdr->direc_init_tbl); in _icv_iconv()
315 retval = eval_op_tbl(ist, hdr->op_reset_tbl, inbuf, in _icv_iconv()
321 op_reset_default(ist); in _icv_iconv()
326 if (ITM_TBL_MAP_INDEX_FIXED_1_1 == ist->direc->type) { in _icv_iconv()
334 map_hdr = (itm_map_idx_fix_hdr_t *)(ist->direc + 1); in _icv_iconv()
338 retval = map_i_f(ist->direc, inbuf, inbytesleft, in _icv_iconv()
363 } else if (ITM_TBL_MAP_INDEX_FIXED == ist->direc->type) { in _icv_iconv()
364 retval = map_i_f(ist->direc, inbuf, inbytesleft, in _icv_iconv()
367 } else if (ITM_TBL_MAP_HASH == ist->direc->type) { in _icv_iconv()
368 retval = map_h_l(ist->direc, inbuf, inbytesleft, in _icv_iconv()
371 } else if (ITM_TBL_MAP_DENSE_ENC == ist->direc->type) { in _icv_iconv()
372 retval = map_d_e_l(ist->direc, inbuf, inbytesleft, in _icv_iconv()
375 } else if (ITM_TBL_MAP_LOOKUP == ist->direc->type) { in _icv_iconv()
376 retval = map_l_f(ist->direc, inbuf, inbytesleft, in _icv_iconv()
382 ist->op_depth = 0; in _icv_iconv()
395 direc_hdr = ist->direc; in _icv_iconv()
396 direc = (itm_direc_t *)(ist->direc + 1); in _icv_iconv()
399 if (0 == ist->default_action.itm_ptr) { in _icv_iconv()
408 action = ist->default_action; in _icv_iconv()
415 retval = eval_cond_tbl(ist, direc->condition, in _icv_iconv()
436 retval = eval_op_tbl(ist, action, in _icv_iconv()
443 ist->direc = ADDR(action); in _icv_iconv()
927 icv_state_t *ist, in eval_cond_tbl() argument
1000 if (NULL == ist->default_action.itm_ptr) { in eval_cond_tbl()
1001 ist->default_action = direc->action; in eval_cond_tbl()
1028 ist->default_action = direc->action; in eval_cond_tbl()
1039 retval = eval_expr(ist, cond->operand.place, in eval_cond_tbl()
1065 icv_state_t *ist, in eval_op_tbl() argument
1081 if (OP_DEPTH_MAX <= ist->op_depth) { in eval_op_tbl()
1086 ist->op_depth += 1; in eval_op_tbl()
1096 retval = eval_op(ist, op_place, inbuf, inbytesleft, in eval_op_tbl()
1100 ist->op_depth -= 1; in eval_op_tbl()
1115 ist->op_depth -= 1; in eval_op_tbl()
1127 icv_state_t *ist, in eval_op() argument
1157 eval_expr(ist, operation->data.operand[(n)], \ in eval_op()
1166 num = eval_expr(ist, operation->data.operand[0], in eval_op()
1171 num = eval_expr(ist, operation->data.operand[0], in eval_op()
1189 c = eval_expr(ist, operation->data.operand[0], in eval_op()
1249 num = eval_expr(ist, operation->data.operand[0], in eval_op()
1275 c = eval_expr(ist, operation->data.operand[0], in eval_op()
1279 retval = eval_op_tbl(ist, operation->data.operand[1], in eval_op()
1284 c = eval_expr(ist, operation->data.operand[0], in eval_op()
1288 retval = eval_op_tbl(ist, operation->data.operand[1], in eval_op()
1291 retval = eval_op_tbl(ist, operation->data.operand[2], in eval_op()
1298 ist->direc = ADDR(operation->data.operand[0]); in eval_op()
1308 i = eval_expr(ist, operation->data.operand[1], in eval_op()
1360 retval = eval_op_tbl(ist, operation->data.operand[0], in eval_op()
1366 ist->itm_hdr->op_init_tbl)); in eval_op()
1367 if (0 != ist->itm_hdr->op_init_tbl.itm_ptr) { in eval_op()
1368 retval = eval_op_tbl(ist, ist->itm_hdr->op_init_tbl, in eval_op()
1371 op_init_default(ist); in eval_op()
1377 ist->itm_hdr->op_reset_tbl)); in eval_op()
1378 if (0 != ist->itm_hdr->op_reset_tbl.itm_ptr) { in eval_op()
1379 retval = eval_op_tbl(ist, ist->itm_hdr->op_reset_tbl, in eval_op()
1382 op_reset_default(ist); in eval_op()
1393 c = eval_expr(ist, operation->data.operand[0], *inbytesleft, in eval_op()
1400 c = eval_expr(ist, operation->data.operand[0], *inbytesleft, in eval_op()
1407 c = eval_expr(ist, operation->data.operand[0], *inbytesleft, in eval_op()
1429 icv_state_t *ist, in eval_expr() argument
1444 #define EVAL_EXPR_E(n) (eval_expr(ist, expr->data.operand[(n)], \ in eval_expr()
1465 eval_expr(ist, expr->data.operand[(n)], \ in eval_expr()
1692 if (expr->data.operand[0].itm_ptr < ist->itm_hdr->reg_num) { in eval_expr()
1693 return (*(ist->regs + expr->data.operand[0].itm_ptr) in eval_expr()
1836 op_init_default(icv_state_t *ist) in op_init_default() argument
1838 ist->direc = ADDR(ist->itm_hdr->direc_init_tbl); in op_init_default()
1839 regs_init(ist); in op_init_default()
1844 op_reset_default(icv_state_t *ist) in op_reset_default() argument
1846 ist->direc = ADDR(ist->itm_hdr->direc_init_tbl); in op_reset_default()
1847 regs_init(ist); in op_reset_default()
1852 regs_init(icv_state_t *ist) in regs_init() argument
1854 if (0 < ist->itm_hdr->reg_num) { in regs_init()
1855 (void) memset(ist->regs, 0, in regs_init()
1856 (sizeof (itm_num_t)) * ist->itm_hdr->reg_num); in regs_init()