Loading arch/ppc64/kernel/cputable.c +14 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <linux/init.h> #include <linux/module.h> #include <asm/oprofile_impl.h> #include <asm/cputable.h> struct cpu_spec* cur_cpu_spec = NULL; Loading Loading @@ -61,6 +62,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/power3", .oprofile_model = &op_model_rs64, }, { /* Power3+ */ .pvr_mask = 0xffff0000, Loading @@ -74,6 +76,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/power3", .oprofile_model = &op_model_rs64, }, { /* Northstar */ .pvr_mask = 0xffff0000, Loading @@ -88,6 +91,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/rs64", .oprofile_model = &op_model_rs64, }, { /* Pulsar */ .pvr_mask = 0xffff0000, Loading @@ -102,6 +106,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/rs64", .oprofile_model = &op_model_rs64, }, { /* I-star */ .pvr_mask = 0xffff0000, Loading @@ -116,6 +121,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/rs64", .oprofile_model = &op_model_rs64, }, { /* S-star */ .pvr_mask = 0xffff0000, Loading @@ -130,6 +136,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/rs64", .oprofile_model = &op_model_rs64, }, { /* Power4 */ .pvr_mask = 0xffff0000, Loading @@ -144,6 +151,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power4, .oprofile_cpu_type = "ppc64/power4", .oprofile_model = &op_model_rs64, }, { /* Power4+ */ .pvr_mask = 0xffff0000, Loading @@ -158,6 +166,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power4, .oprofile_cpu_type = "ppc64/power4", .oprofile_model = &op_model_power4, }, { /* PPC970 */ .pvr_mask = 0xffff0000, Loading @@ -174,6 +183,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_ppc970, .oprofile_cpu_type = "ppc64/970", .oprofile_model = &op_model_power4, }, { /* PPC970FX */ .pvr_mask = 0xffff0000, Loading @@ -190,6 +200,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_ppc970, .oprofile_cpu_type = "ppc64/970", .oprofile_model = &op_model_power4, }, { /* PPC970MP */ .pvr_mask = 0xffff0000, Loading @@ -205,6 +216,7 @@ struct cpu_spec cpu_specs[] = { .dcache_bsize = 128, .cpu_setup = __setup_cpu_ppc970, .oprofile_cpu_type = "ppc64/970", .oprofile_model = &op_model_power4, }, { /* Power5 */ .pvr_mask = 0xffff0000, Loading @@ -221,6 +233,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 6, .cpu_setup = __setup_cpu_power4, .oprofile_cpu_type = "ppc64/power5", .oprofile_model = &op_model_power4, }, { /* Power5 */ .pvr_mask = 0xffff0000, Loading @@ -237,6 +250,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 6, .cpu_setup = __setup_cpu_power4, .oprofile_cpu_type = "ppc64/power5", .oprofile_model = &op_model_power4, }, { /* BE DD1.x */ .pvr_mask = 0xffff0000, Loading arch/ppc64/oprofile/common.c +5 −37 Original line number Diff line number Diff line Loading @@ -121,45 +121,13 @@ static int op_ppc64_create_files(struct super_block *sb, struct dentry *root) int __init oprofile_arch_init(struct oprofile_operations *ops) { unsigned int pvr; pvr = mfspr(SPRN_PVR); switch (PVR_VER(pvr)) { case PV_630: case PV_630p: model = &op_model_rs64; break; case PV_NORTHSTAR: case PV_PULSAR: case PV_ICESTAR: case PV_SSTAR: model = &op_model_rs64; break; case PV_POWER4: case PV_POWER4p: model = &op_model_power4; break; case PV_970: case PV_970FX: case PV_970MP: model = &op_model_power4; break; case PV_POWER5: case PV_POWER5p: model = &op_model_power4; break; default: if (!cur_cpu_spec->oprofile_model || !cur_cpu_spec->oprofile_cpu_type) return -ENODEV; } ops->cpu_type = cur_cpu_spec->oprofile_cpu_type; model = cur_cpu_spec->oprofile_model; model->num_counters = cur_cpu_spec->num_pmcs; ops->cpu_type = cur_cpu_spec->oprofile_cpu_type; ops->create_files = op_ppc64_create_files; ops->setup = op_ppc64_setup; ops->shutdown = op_ppc64_shutdown; Loading include/asm-ppc64/cputable.h +4 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ * via the mkdefs mechanism. */ struct cpu_spec; struct op_ppc64_model; typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec); Loading @@ -62,6 +63,9 @@ struct cpu_spec { /* Used by oprofile userspace to select the right counters */ char *oprofile_cpu_type; /* Processor specific oprofile operations */ struct op_ppc64_model *oprofile_model; }; extern struct cpu_spec cpu_specs[]; Loading Loading
arch/ppc64/kernel/cputable.c +14 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <linux/init.h> #include <linux/module.h> #include <asm/oprofile_impl.h> #include <asm/cputable.h> struct cpu_spec* cur_cpu_spec = NULL; Loading Loading @@ -61,6 +62,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/power3", .oprofile_model = &op_model_rs64, }, { /* Power3+ */ .pvr_mask = 0xffff0000, Loading @@ -74,6 +76,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/power3", .oprofile_model = &op_model_rs64, }, { /* Northstar */ .pvr_mask = 0xffff0000, Loading @@ -88,6 +91,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/rs64", .oprofile_model = &op_model_rs64, }, { /* Pulsar */ .pvr_mask = 0xffff0000, Loading @@ -102,6 +106,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/rs64", .oprofile_model = &op_model_rs64, }, { /* I-star */ .pvr_mask = 0xffff0000, Loading @@ -116,6 +121,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/rs64", .oprofile_model = &op_model_rs64, }, { /* S-star */ .pvr_mask = 0xffff0000, Loading @@ -130,6 +136,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/rs64", .oprofile_model = &op_model_rs64, }, { /* Power4 */ .pvr_mask = 0xffff0000, Loading @@ -144,6 +151,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power4, .oprofile_cpu_type = "ppc64/power4", .oprofile_model = &op_model_rs64, }, { /* Power4+ */ .pvr_mask = 0xffff0000, Loading @@ -158,6 +166,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_power4, .oprofile_cpu_type = "ppc64/power4", .oprofile_model = &op_model_power4, }, { /* PPC970 */ .pvr_mask = 0xffff0000, Loading @@ -174,6 +183,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_ppc970, .oprofile_cpu_type = "ppc64/970", .oprofile_model = &op_model_power4, }, { /* PPC970FX */ .pvr_mask = 0xffff0000, Loading @@ -190,6 +200,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 8, .cpu_setup = __setup_cpu_ppc970, .oprofile_cpu_type = "ppc64/970", .oprofile_model = &op_model_power4, }, { /* PPC970MP */ .pvr_mask = 0xffff0000, Loading @@ -205,6 +216,7 @@ struct cpu_spec cpu_specs[] = { .dcache_bsize = 128, .cpu_setup = __setup_cpu_ppc970, .oprofile_cpu_type = "ppc64/970", .oprofile_model = &op_model_power4, }, { /* Power5 */ .pvr_mask = 0xffff0000, Loading @@ -221,6 +233,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 6, .cpu_setup = __setup_cpu_power4, .oprofile_cpu_type = "ppc64/power5", .oprofile_model = &op_model_power4, }, { /* Power5 */ .pvr_mask = 0xffff0000, Loading @@ -237,6 +250,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 6, .cpu_setup = __setup_cpu_power4, .oprofile_cpu_type = "ppc64/power5", .oprofile_model = &op_model_power4, }, { /* BE DD1.x */ .pvr_mask = 0xffff0000, Loading
arch/ppc64/oprofile/common.c +5 −37 Original line number Diff line number Diff line Loading @@ -121,45 +121,13 @@ static int op_ppc64_create_files(struct super_block *sb, struct dentry *root) int __init oprofile_arch_init(struct oprofile_operations *ops) { unsigned int pvr; pvr = mfspr(SPRN_PVR); switch (PVR_VER(pvr)) { case PV_630: case PV_630p: model = &op_model_rs64; break; case PV_NORTHSTAR: case PV_PULSAR: case PV_ICESTAR: case PV_SSTAR: model = &op_model_rs64; break; case PV_POWER4: case PV_POWER4p: model = &op_model_power4; break; case PV_970: case PV_970FX: case PV_970MP: model = &op_model_power4; break; case PV_POWER5: case PV_POWER5p: model = &op_model_power4; break; default: if (!cur_cpu_spec->oprofile_model || !cur_cpu_spec->oprofile_cpu_type) return -ENODEV; } ops->cpu_type = cur_cpu_spec->oprofile_cpu_type; model = cur_cpu_spec->oprofile_model; model->num_counters = cur_cpu_spec->num_pmcs; ops->cpu_type = cur_cpu_spec->oprofile_cpu_type; ops->create_files = op_ppc64_create_files; ops->setup = op_ppc64_setup; ops->shutdown = op_ppc64_shutdown; Loading
include/asm-ppc64/cputable.h +4 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ * via the mkdefs mechanism. */ struct cpu_spec; struct op_ppc64_model; typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec); Loading @@ -62,6 +63,9 @@ struct cpu_spec { /* Used by oprofile userspace to select the right counters */ char *oprofile_cpu_type; /* Processor specific oprofile operations */ struct op_ppc64_model *oprofile_model; }; extern struct cpu_spec cpu_specs[]; Loading