Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hwpmc/hwpmc_powerpc.c
Show First 20 Lines • Show All 561 Lines • ▼ Show 20 Lines | pmc_md_initialize() | ||||
/* Just one class */ | /* Just one class */ | ||||
pmc_mdep = pmc_mdep_alloc(1); | pmc_mdep = pmc_mdep_alloc(1); | ||||
vers = mfpvr() >> 16; | vers = mfpvr() >> 16; | ||||
pmc_mdep->pmd_switch_in = powerpc_switch_in; | pmc_mdep->pmd_switch_in = powerpc_switch_in; | ||||
pmc_mdep->pmd_switch_out = powerpc_switch_out; | pmc_mdep->pmd_switch_out = powerpc_switch_out; | ||||
switch (vers) { | switch (vers) { | ||||
case MPC7447A: | case MPC7447A: | ||||
case MPC7448: | case MPC7448: | ||||
case MPC7450: | case MPC7450: | ||||
case MPC7455: | case MPC7455: | ||||
case MPC7457: | case MPC7457: | ||||
error = pmc_mpc7xxx_initialize(pmc_mdep); | error = pmc_mpc7xxx_initialize(pmc_mdep); | ||||
break; | break; | ||||
Show All 18 Lines | default: | ||||
error = -1; | error = -1; | ||||
break; | break; | ||||
} | } | ||||
if (error != 0) { | if (error != 0) { | ||||
pmc_mdep_free(pmc_mdep); | pmc_mdep_free(pmc_mdep); | ||||
pmc_mdep = NULL; | pmc_mdep = NULL; | ||||
} | } | ||||
snprintf(pmc_cpuid, sizeof(pmc_cpuid), "%08lx", mfpvr()); | |||||
mhorne: Worth having a simple comment here, something like `/* Set the value for kern.hwpmc.cpuid */`. | |||||
return (pmc_mdep); | return (pmc_mdep); | ||||
} | } | ||||
void | void | ||||
pmc_md_finalize(struct pmc_mdep *md) | pmc_md_finalize(struct pmc_mdep *md) | ||||
{ | { | ||||
Show All 36 Lines |
Worth having a simple comment here, something like /* Set the value for kern.hwpmc.cpuid */.