Lines Matching +full:open +full:- +full:pic
63 * This open source software license conforms to the BSD License template.
123 uint32_t opl_pic; /* unshifted raw %pic value */
139 * +----------+-----+-----+------+----+
141 * +----------+-----+-----+------+----+
144 * +----+----+--- -+----+-----+---+-----+-----+----+----+----+
146 * +----+----+-----+----+-----+---+-----+-----+----+----+----+
155 * Performance Instrumentation Counter (PIC)
157 * each PIC is accessed using PCR.SC as a select field.
159 * +------------------------+--------------------------+
161 * +------------------------+--------------------------+
165 #define PIC_MASK (((uint64_t)1 << 32) - 1)
536 return (-1); in opl_pcbe_init()
540 * Initialize the list of events for each PIC. in opl_pcbe_init()
546 for (n = events[i]; n->bits != NT_END; n++) in opl_pcbe_init()
547 size += strlen(n->name) + 1; in opl_pcbe_init()
548 for (gevp = generic_events[i]; gevp->name != NULL; gevp++) in opl_pcbe_init()
549 size += strlen(gevp->name) + 1; in opl_pcbe_init()
552 for (n = events[i]; n->bits != NT_END; n++) { in opl_pcbe_init()
553 (void) strcat(pic_events[i], n->name); in opl_pcbe_init()
556 for (gevp = generic_events[i]; gevp->name != NULL; gevp++) { in opl_pcbe_init()
557 (void) strcat(pic_events[i], gevp->name); in opl_pcbe_init()
564 pic_events[i][size - 1] = '\0'; in opl_pcbe_init()
607 for (gevp = generic_events[regno]; gevp->name != NULL; gevp++) in find_generic_event()
608 if (strcmp(name, gevp->name) == 0) in find_generic_event()
621 for (; n->bits != NT_END; n++) in find_event()
622 if (strcmp(name, n->name) == 0) in find_event()
673 conf->opl_pic = (uint32_t)preset; in opl_pcbe_configure()
688 (other_config->opl_flags != flags)) in opl_pcbe_configure()
693 n = find_event(picnum, gevp->event); in opl_pcbe_configure()
702 conf->opl_picno = picnum; in opl_pcbe_configure()
703 conf->opl_bits = (uint32_t)n->bits; in opl_pcbe_configure()
704 conf->opl_flags = flags; in opl_pcbe_configure()
705 conf->opl_pic = (uint32_t)preset; in opl_pcbe_configure()
714 opl_pcbe_config_t *pic[CPC_SPARC64_VI_NPIC]; in opl_pcbe_program() local
719 uint8_t bitmap = 0; /* for used pic config */ in opl_pcbe_program()
723 /* Get next pic config */ in opl_pcbe_program()
727 ASSERT(tmp->opl_picno < CPC_SPARC64_VI_NPIC); in opl_pcbe_program()
728 ASSERT(firstconfig->opl_flags == tmp->opl_flags); in opl_pcbe_program()
729 pic[tmp->opl_picno] = tmp; in opl_pcbe_program()
730 bitmap |= (uint8_t)(1 << tmp->opl_picno); in opl_pcbe_program()
736 /* Fill in unused pic config */ in opl_pcbe_program()
742 dummypic[i].opl_flags = firstconfig->opl_flags; in opl_pcbe_program()
743 pic[i] = &dummypic[i]; in opl_pcbe_program()
755 SPARC64_VI_PCR_SEL_EVENT(pcr, pic[i*2]->opl_bits, in opl_pcbe_program()
756 pic[i*2 + 1]->opl_bits); in opl_pcbe_program()
759 curpic = (uint64_t)(pic[i*2]->opl_pic | in opl_pcbe_program()
760 ((uint64_t)pic[i*2 + 1]->opl_pic << 32)); in opl_pcbe_program()
766 * counting. Re-read the counters to sample the counter value now in opl_pcbe_program()
775 if (pic[0]->opl_flags & CPC_COUNT_USER) in opl_pcbe_program()
777 if (pic[0]->opl_flags & CPC_COUNT_SYSTEM) in opl_pcbe_program()
784 SPARC64_VI_PCR_SEL_EVENT(pcr, pic[i*2]->opl_bits, in opl_pcbe_program()
785 pic[i*2 + 1]->opl_bits); in opl_pcbe_program()
792 pic[i*2]->opl_pic = (uint32_t)(curpic & PIC_MASK); in opl_pcbe_program()
793 pic[i*2 + 1]->opl_pic = (uint32_t)(curpic >> 32); in opl_pcbe_program()
815 opl_pcbe_config_t *pic[CPC_SPARC64_VI_NPIC]; in opl_pcbe_sample() local
818 uint8_t bitmap = 0; /* for used pic config */ in opl_pcbe_sample()
823 /* Get next pic config */ in opl_pcbe_sample()
827 ASSERT(ctmp->opl_picno < CPC_SPARC64_VI_NPIC); in opl_pcbe_sample()
828 ASSERT(firstconfig->opl_flags == ctmp->opl_flags); in opl_pcbe_sample()
829 pic[ctmp->opl_picno] = ctmp; in opl_pcbe_sample()
830 pic_data[ctmp->opl_picno] = dtmp; in opl_pcbe_sample()
831 bitmap |= (uint8_t)(1 << ctmp->opl_picno); in opl_pcbe_sample()
837 /* Fill in unuse pic config */ in opl_pcbe_sample()
843 dummypic[i].opl_flags = firstconfig->opl_flags; in opl_pcbe_sample()
844 pic[i] = &dummypic[i]; in opl_pcbe_sample()
856 SPARC64_VI_PCR_SEL_EVENT(pcr, pic[i*2]->opl_bits, in opl_pcbe_sample()
857 pic[i*2 + 1]->opl_bits); in opl_pcbe_sample()
864 diff = (curpic & PIC_MASK) - (uint64_t)pic[i*2]->opl_pic; in opl_pcbe_sample()
873 diff = (curpic >> 32) - (uint64_t)pic[i*2 + 1]->opl_pic; in opl_pcbe_sample()
882 pic[i*2]->opl_pic = (uint32_t)(curpic & PIC_MASK); in opl_pcbe_sample()
883 pic[i*2 + 1]->opl_pic = (uint32_t)(curpic >> 32); in opl_pcbe_sample()