Lines Matching defs:pcounter
1848 unsigned long *pcounter;
1960 void pmt_counter_resize_(struct pmt_counter *pcounter, unsigned int new_size)
1964 new_mem = (struct pmt_domain_info *)reallocarray(pcounter->domains, new_size, sizeof(*pcounter->domains));
1971 const size_t num_new_domains = new_size - pcounter->num_domains;
1973 memset(&new_mem[pcounter->num_domains], 0, num_new_domains * sizeof(*pcounter->domains));
1975 pcounter->num_domains = new_size;
1976 pcounter->domains = new_mem;
1979 void pmt_counter_resize(struct pmt_counter *pcounter, unsigned int new_size)
1989 new_size = MAX(new_size, pcounter->num_domains * 2);
1991 pmt_counter_resize_(pcounter, new_size);
5057 const unsigned long *pmmio = ppmt->domains[domain_id].pcounter;
9830 struct pmt_counter *pmt_find_counter(struct pmt_counter *pcounter, const char *name)
9832 while (pcounter) {
9833 if (strcmp(pcounter->name, name) == 0)
9836 pcounter = pcounter->next;
9839 return pcounter;
9856 void pmt_counter_add_domain(struct pmt_counter *pcounter, unsigned long *pmmio, unsigned int domain_id)
9859 if (domain_id >= pcounter->num_domains)
9860 pmt_counter_resize(pcounter, domain_id + 1);
9862 assert(pcounter->domains);
9863 assert(domain_id < pcounter->num_domains);
9865 pcounter->domains[domain_id].pcounter = pmmio;
9873 struct pmt_counter *pcounter;
9907 pcounter = pmt_find_counter(*pmt_root, name);
9908 if (!pcounter) {
9909 pcounter = calloc(1, sizeof(*pcounter));
9914 strncpy(pcounter->name, name, ARRAY_SIZE(pcounter->name) - 1);
9915 pcounter->type = type;
9916 pcounter->scope = scope;
9917 pcounter->lsb = lsb;
9918 pcounter->msb = msb;
9919 pcounter->format = format;
9921 conflict += pcounter->type != type;
9922 conflict += pcounter->scope != scope;
9923 conflict += pcounter->lsb != lsb;
9924 conflict += pcounter->msb != msb;
9925 conflict += pcounter->format != format;
9934 pmt_counter_add_domain(pcounter, pmt_get_counter_pointer(mmio, offset), domain_id);
9937 pcounter->next = *pmt_root;
9938 *pmt_root = pcounter;