Lines Matching defs:set
73 static int kcpc_copyin_set(kcpc_set_t **set, void *ubuf, size_t len);
74 static int kcpc_verify_set(kcpc_set_t *set);
139 * An LWP may only have one set bound to it at a time; if there
140 * is a set bound to this LWP already, we unbind it here.
185 * syscall, so if this set has a CPU-bound context, return an
198 * These are valid only if this lwp has a bound set.
236 * counts as the preset to rebind a new set with the requests
441 * set has no CPU-bound context, return an error.
547 * Sane boundary on the number of requests a set can contain.
557 * Copy in a packed nvlist from the user and create a request set out of it.
558 * If successful, return 0 and store a pointer to the set we've created. Returns
564 kcpc_set_t *set;
633 * Anything else is an invalid set.
650 set = kmem_zalloc(sizeof (kcpc_set_t), KM_SLEEP);
651 set->ks_req = (kcpc_request_t *)kmem_zalloc(sizeof (kcpc_request_t) *
653 set->ks_nreqs = nreqs;
656 * with an illegal value and this set will fail sanity checks later on.
658 set->ks_flags = setflags;
660 * Initialize bind/unbind set synchronization.
662 set->ks_state &= ~KCPC_SET_BOUND;
665 * Build the set up one request at a time, always keeping it self-
671 set->ks_req[i].kr_picnum = -1;
679 set->ks_req[i].kr_flags = uint32;
681 set->ks_req[i].kr_index = uint32;
687 set->ks_req[i].kr_preset = uint64;
693 (void) strncpy(set->ks_req[i].kr_event,
713 set->ks_req[i].kr_picnum = uint64;
716 if ((set->ks_req[i].kr_nattrs =
720 if (set->ks_req[i].kr_nattrs > CPC_MAX_ATTRS)
723 set->ks_req[i].kr_attr =
724 kmem_alloc(set->ks_req[i].kr_nattrs *
730 attrp = &set->ks_req[i].kr_attr[j];
745 ASSERT(j == set->ks_req[i].kr_nattrs);
753 *inset = set;
758 kcpc_free_set(set);
778 * Performs sanity checks on the given set.
779 * Returns 0 if the set checks out OK.
783 kcpc_verify_set(kcpc_set_t *set)
790 if (set->ks_nreqs > cpc_ncounters)
793 if (CPC_SET_VALID_FLAGS(set->ks_flags) == 0)
796 for (i = 0; i < set->ks_nreqs; i++) {
797 rp = &set->ks_req[i];
809 * sure each PIC appears only once in set.
811 if ((n = set->ks_req[i].kr_picnum) != -1) {
821 if (rp->kr_index < 0 || rp->kr_index >= set->ks_nreqs)