From: Mikael Pettersson <mikpe@csd.uu.se>

- Move tsc_on/nractrs/nrictrs control fields to new struct cpu_control_header.

This depends on the physical-indexing patch for ppc32.

Signed-off-by: Mikael Pettersson <mikpe@csd.uu.se>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/perfctr/ppc.c     |   18 +++++++++---------
 25-akpm/include/asm-ppc/perfctr.h |    6 +++++-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff -puN drivers/perfctr/ppc.c~perfctr-api-update-4-9-cpu_control_header-ppc32 drivers/perfctr/ppc.c
--- 25/drivers/perfctr/ppc.c~perfctr-api-update-4-9-cpu_control_header-ppc32	2005-03-13 13:23:21.000000000 -0800
+++ 25-akpm/drivers/perfctr/ppc.c	2005-03-13 13:23:21.000000000 -0800
@@ -285,8 +285,8 @@ static int ppc_check_control(struct perf
 	unsigned int nr_pmcs, evntsel[6];
 
 	nr_pmcs = get_nr_pmcs();
-	nractrs = state->control.nractrs;
-	nrctrs = nractrs + state->control.nrictrs;
+	nractrs = state->control.header.nractrs;
+	nrctrs = nractrs + state->control.header.nrictrs;
 	if (nrctrs < nractrs || nrctrs > nr_pmcs)
 		return -EINVAL;
 
@@ -340,7 +340,7 @@ static int ppc_check_control(struct perf
 
 	/* We do not yet handle TBEE as the only exception cause,
 	   so PMXE requires at least one interrupt-mode counter. */
-	if ((state->control.mmcr0 & MMCR0_PMXE) && !state->control.nrictrs)
+	if ((state->control.mmcr0 & MMCR0_PMXE) && !state->control.header.nrictrs)
 		return -EINVAL;
 
 	state->k1.id = new_id();
@@ -577,8 +577,8 @@ static inline int check_ireset(const str
 {
 	unsigned int nrctrs, i;
 
-	i = state->control.nractrs;
-	nrctrs = i + state->control.nrictrs;
+	i = state->control.header.nractrs;
+	nrctrs = i + state->control.header.nrictrs;
 	for(; i < nrctrs; ++i) {
 		unsigned int pmc = state->pmc[i].map;
 		if ((int)state->control.ireset[pmc] < 0) /* PPC-specific */
@@ -620,7 +620,7 @@ int perfctr_cpu_update_control(struct pe
 
 	/* disallow i-mode counters if we cannot catch the interrupts */
 	if (!(perfctr_info.cpu_features & PERFCTR_FEATURE_PCINT)
-	    && state->control.nrictrs)
+	    && state->control.header.nrictrs)
 		return -EPERM;
 
 	err = check_control(state); /* may initialise state->cstatus */
@@ -629,9 +629,9 @@ int perfctr_cpu_update_control(struct pe
 	err = check_ireset(state);
 	if (err < 0)
 		return err;
-	state->cstatus |= perfctr_mk_cstatus(state->control.tsc_on,
-					     state->control.nractrs,
-					     state->control.nrictrs);
+	state->cstatus |= perfctr_mk_cstatus(state->control.header.tsc_on,
+					     state->control.header.nractrs,
+					     state->control.header.nrictrs);
 	setup_imode_start_values(state);
 	return 0;
 }
diff -puN include/asm-ppc/perfctr.h~perfctr-api-update-4-9-cpu_control_header-ppc32 include/asm-ppc/perfctr.h
--- 25/include/asm-ppc/perfctr.h~perfctr-api-update-4-9-cpu_control_header-ppc32	2005-03-13 13:23:21.000000000 -0800
+++ 25-akpm/include/asm-ppc/perfctr.h	2005-03-13 13:23:21.000000000 -0800
@@ -19,10 +19,14 @@ struct perfctr_sum_ctrs {
 	unsigned long long pmc[8];
 };
 
-struct perfctr_cpu_control {
+struct perfctr_cpu_control_header {
 	unsigned int tsc_on;
 	unsigned int nractrs;		/* # of a-mode counters */
 	unsigned int nrictrs;		/* # of i-mode counters */
+};
+
+struct perfctr_cpu_control {
+	struct perfctr_cpu_control_header header;
 	unsigned int mmcr0;
 	unsigned int mmcr1;
 	unsigned int mmcr2;
_