Lines Matching refs:template

56  * A contract template is represented by a ct_template_t, which, like a
57 * contract, points to an encapsulating contract-type specific template
58 * object. A ct_template_t contains the template's terms.
1184 contract_t template, *ct;
1188 template.ct_id = current;
1189 ct = avl_find(tree, &template, &where);
1247 contract_t template, *ct;
1251 template.ct_id = current;
1256 ct = avl_find(&contract_avl, &template, &where);
1267 ct = avl_find(&p->p_ct_held, &template, &where);
1287 contract_t template, *ct;
1289 template.ct_id = id;
1290 ct = avl_find(tree, &template, NULL);
1498 * Frees a template.
1501 ctmpl_free(ct_template_t *template)
1503 mutex_destroy(&template->ctmpl_lock);
1504 template->ctmpl_ops->ctop_free(template);
1510 * Creates a copy of a template.
1513 ctmpl_dup(ct_template_t *template)
1517 if (template == NULL)
1520 new = template->ctmpl_ops->ctop_dup(template);
1525 mutex_exit(&template->ctmpl_lock);
1533 * Sets the requested terms of a template.
1536 ctmpl_set(ct_template_t *template, ct_kparam_t *kparam, const cred_t *cr)
1552 mutex_enter(&template->ctmpl_lock);
1555 template->ctmpl_cookie = param_value;
1558 if (param_value & ~(uint64_t)template->ctmpl_ops->allevents)
1561 template->ctmpl_ev_info = param_value;
1564 if (param_value & ~(uint64_t)template->ctmpl_ops->allevents) {
1567 } else if ((~template->ctmpl_ev_crit & param_value) == 0) {
1572 template->ctmpl_ev_crit = param_value;
1582 result = template->ctmpl_ops->ctop_set(template, kparam, cr);
1584 mutex_exit(&template->ctmpl_lock);
1592 * Obtains the requested terms from a template.
1606 ctmpl_get(ct_template_t *template, ct_kparam_t *kparam)
1623 mutex_enter(&template->ctmpl_lock);
1626 *param_value = template->ctmpl_cookie;
1629 *param_value = template->ctmpl_ev_info;
1632 *param_value = template->ctmpl_ev_crit;
1635 result = template->ctmpl_ops->ctop_get(template, kparam);
1637 mutex_exit(&template->ctmpl_lock);
1646 * active template. Frees the old active template, if there was one.
1649 ctmpl_makecurrent(ct_template_t *template, ct_template_t *new)
1656 old = curlwp->lwp_ct_active[template->ctmpl_type->ct_type_index];
1657 curlwp->lwp_ct_active[template->ctmpl_type->ct_type_index] = new;
1667 * Copy the specified template as the current thread's activate
1668 * template of that type.
1671 ctmpl_activate(ct_template_t *template)
1673 ctmpl_makecurrent(template, ctmpl_dup(template));
1679 * Clears the current thread's activate template of the same type as
1680 * the specified template.
1683 ctmpl_clear(ct_template_t *template)
1685 ctmpl_makecurrent(template, NULL);
1691 * Creates a new contract using the specified template.
1694 ctmpl_create(ct_template_t *template, ctid_t *ctidp)
1696 return (template->ctmpl_ops->ctop_create(template, ctidp));
1702 * Initializes the common portion of a new contract template.
1718 * Copies the common portions of a contract template. Intended for use
1719 * by a contract type's ctop_dup template op. Returns with the old
1720 * template's lock held, which will should remain held until the
1721 * template op returns (it is dropped by ctmpl_dup).
1740 * otherwise need to create their own stub for the ctop_create template
1745 ctmpl_create_inval(ct_template_t *template, ctid_t *ctidp)