Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hwpmc/hwpmc_mod.c
Show First 20 Lines • Show All 4,619 Lines • ▼ Show 20 Lines | pmc_kld_unload(void *arg __unused, const char *filename __unused, | ||||
*/ | */ | ||||
sx_sunlock(&pmc_sx); | sx_sunlock(&pmc_sx); | ||||
} | } | ||||
/* | /* | ||||
* initialization | * initialization | ||||
*/ | */ | ||||
static const char * | |||||
pmc_name_of_pmcclass(enum pmc_class class) | |||||
{ | |||||
static const char *pmc_name_of_pmcclass[] = { | switch (class) { | ||||
#undef __PMC_CLASS | #undef __PMC_CLASS | ||||
#define __PMC_CLASS(N) #N , | #define __PMC_CLASS(S,V,D) \ | ||||
__PMC_CLASSES() | case PMC_CLASS_##S: \ | ||||
}; | return #S; | ||||
__PMC_CLASSES(); | |||||
default: | |||||
return ("<unknown>"); | |||||
} | |||||
} | |||||
/* | /* | ||||
* Base class initializer: allocate structure and set default classes. | * Base class initializer: allocate structure and set default classes. | ||||
*/ | */ | ||||
struct pmc_mdep * | struct pmc_mdep * | ||||
pmc_mdep_alloc(int nclasses) | pmc_mdep_alloc(int nclasses) | ||||
{ | { | ||||
struct pmc_mdep *md; | struct pmc_mdep *md; | ||||
▲ Show 20 Lines • Show All 262 Lines • ▼ Show 20 Lines | #endif | ||||
pmc_intr = md->pmd_intr; | pmc_intr = md->pmd_intr; | ||||
pmc_hook = pmc_hook_handler; | pmc_hook = pmc_hook_handler; | ||||
if (error == 0) { | if (error == 0) { | ||||
printf(PMC_MODULE_NAME ":"); | printf(PMC_MODULE_NAME ":"); | ||||
for (n = 0; n < (int) md->pmd_nclass; n++) { | for (n = 0; n < (int) md->pmd_nclass; n++) { | ||||
pcd = &md->pmd_classdep[n]; | pcd = &md->pmd_classdep[n]; | ||||
printf(" %s/%d/%d/0x%b", | printf(" %s/%d/%d/0x%b", | ||||
pmc_name_of_pmcclass[pcd->pcd_class], | pmc_name_of_pmcclass(pcd->pcd_class), | ||||
pcd->pcd_num, | pcd->pcd_num, | ||||
pcd->pcd_width, | pcd->pcd_width, | ||||
pcd->pcd_caps, | pcd->pcd_caps, | ||||
"\20" | "\20" | ||||
"\1INT\2USR\3SYS\4EDG\5THR" | "\1INT\2USR\3SYS\4EDG\5THR" | ||||
"\6REA\7WRI\10INV\11QUA\12PRC" | "\6REA\7WRI\10INV\11QUA\12PRC" | ||||
"\13TAG\14CSC"); | "\13TAG\14CSC"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 197 Lines • Show Last 20 Lines |