Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hwpmc/hwpmc_mod.c
| Show First 20 Lines • Show All 5,447 Lines • ▼ Show 20 Lines | pmc_mdep_alloc(int nclasses) | ||||
| int n; | int n; | ||||
| /* SOFT + md classes */ | /* SOFT + md classes */ | ||||
| n = 1 + nclasses; | n = 1 + nclasses; | ||||
| md = malloc(sizeof(struct pmc_mdep) + n * | md = malloc(sizeof(struct pmc_mdep) + n * | ||||
| sizeof(struct pmc_classdep), M_PMC, M_WAITOK|M_ZERO); | sizeof(struct pmc_classdep), M_PMC, M_WAITOK|M_ZERO); | ||||
| md->pmd_nclass = n; | md->pmd_nclass = n; | ||||
| /* Default methods */ | |||||
| md->pmd_switch_in = generic_switch_in; | |||||
| md->pmd_switch_out = generic_switch_out; | |||||
| /* Add base class. */ | /* Add base class. */ | ||||
| pmc_soft_initialize(md); | pmc_soft_initialize(md); | ||||
| return md; | return md; | ||||
| } | } | ||||
| void | void | ||||
| pmc_mdep_free(struct pmc_mdep *md) | pmc_mdep_free(struct pmc_mdep *md) | ||||
| { | { | ||||
| Show All 20 Lines | |||||
| static struct pmc_mdep * | static struct pmc_mdep * | ||||
| pmc_generic_cpu_initialize(void) | pmc_generic_cpu_initialize(void) | ||||
| { | { | ||||
| struct pmc_mdep *md; | struct pmc_mdep *md; | ||||
| md = pmc_mdep_alloc(0); | md = pmc_mdep_alloc(0); | ||||
| md->pmd_cputype = PMC_CPU_GENERIC; | md->pmd_cputype = PMC_CPU_GENERIC; | ||||
| md->pmd_switch_in = generic_switch_in; | |||||
| md->pmd_switch_out = generic_switch_out; | |||||
| return (md); | return (md); | ||||
| } | } | ||||
| static void | static void | ||||
| pmc_generic_cpu_finalize(struct pmc_mdep *md) | pmc_generic_cpu_finalize(struct pmc_mdep *md) | ||||
| { | { | ||||
| (void) md; | (void) md; | ||||
| ▲ Show 20 Lines • Show All 474 Lines • Show Last 20 Lines | |||||