Module Name:    src
Committed By:   skrll
Date:           Sat May  9 11:39:31 UTC 2009

Modified Files:
        src/sys/arch/hp700/dev: mem.c power.c
        src/sys/arch/hp700/gsc: if_iee_gsc.c
        src/sys/arch/hp700/hp700: machdep.c
        src/sys/arch/hp700/include: cpu.h

Log Message:
Don't overload cpu_type in cpuid().

Rename a hppa_cpu_info member for clarity.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hp700/dev/mem.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hp700/dev/power.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hp700/gsc/if_iee_gsc.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/hp700/hp700/machdep.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/hp700/include/cpu.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hp700/dev/mem.c
diff -u src/sys/arch/hp700/dev/mem.c:1.20 src/sys/arch/hp700/dev/mem.c:1.21
--- src/sys/arch/hp700/dev/mem.c:1.20	Fri May  8 09:33:58 2009
+++ src/sys/arch/hp700/dev/mem.c	Sat May  9 11:39:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.20 2009/05/08 09:33:58 skrll Exp $	*/
+/*	$NetBSD: mem.c,v 1.21 2009/05/09 11:39:30 skrll Exp $	*/
 
 /*	$OpenBSD: mem.c,v 1.30 2007/09/22 16:21:32 krw Exp $	*/
 /*
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.20 2009/05/08 09:33:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.21 2009/05/09 11:39:30 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -265,7 +265,7 @@
 	aprint_normal("MB");
 
 	/* L2 cache controller is a part of the memory controller on PCXL2 */
-	if (hppa_cpu_info->hci_type == hpcxl2) {
+	if (hppa_cpu_info->hci_cputype == hpcxl2) {
 		sc->sc_l2 = (struct l2_mioc *)ca->ca_hpa;
 #ifdef DEBUG
 		snprintb(bits, sizeof(bits), SLTCV_BITS, sc->sc_l2->sltcv);

Index: src/sys/arch/hp700/dev/power.c
diff -u src/sys/arch/hp700/dev/power.c:1.3 src/sys/arch/hp700/dev/power.c:1.4
--- src/sys/arch/hp700/dev/power.c:1.3	Fri May  8 09:33:58 2009
+++ src/sys/arch/hp700/dev/power.c	Sat May  9 11:39:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: power.c,v 1.3 2009/05/08 09:33:58 skrll Exp $	*/
+/*	$NetBSD: power.c,v 1.4 2009/05/09 11:39:30 skrll Exp $	*/
 
 /*
  * Copyright (c) 2004 Jochen Kunz.
@@ -266,7 +266,7 @@
 	 * Ensure that we are on a PCX-L / PA7100LC CPU if it is a
 	 * 712 style machine.
 	 */
-	if (pdc_power_info.addr == 0 && hppa_cpu_info->hci_type != hpcxl) {
+	if (pdc_power_info.addr == 0 && hppa_cpu_info->hci_cputype != hpcxl) {
 		aprint_error_dev(sc->sc_dev, "No soft power available.\n");
 		return error;
 	}

Index: src/sys/arch/hp700/gsc/if_iee_gsc.c
diff -u src/sys/arch/hp700/gsc/if_iee_gsc.c:1.12 src/sys/arch/hp700/gsc/if_iee_gsc.c:1.13
--- src/sys/arch/hp700/gsc/if_iee_gsc.c:1.12	Sat May  9 03:22:20 2009
+++ src/sys/arch/hp700/gsc/if_iee_gsc.c	Sat May  9 11:39:30 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iee_gsc.c,v 1.12 2009/05/09 03:22:20 tsutsui Exp $ */
+/* $NetBSD: if_iee_gsc.c,v 1.13 2009/05/09 11:39:30 skrll Exp $ */
 
 /*
  * Copyright (c) 2003 Jochen Kunz.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iee_gsc.c,v 1.12 2009/05/09 03:22:20 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iee_gsc.c,v 1.13 2009/05/09 11:39:30 skrll Exp $");
 
 /* autoconfig and device stuff */
 #include <sys/param.h>
@@ -226,7 +226,7 @@
 	 * descriptors align to cache lines. Needed to avoid race conditions
 	 * caused by flushing cache lines that overlap multiple descriptors.
 	 */
-	cpu_type = hppa_cpu_info->hci_type;
+	cpu_type = hppa_cpu_info->hci_cputype;
 	if (cpu_type == hpcx || cpu_type == hpcxs || cpu_type == hpcxt)
 		sc->sc_cl_align = 32;
 	else

Index: src/sys/arch/hp700/hp700/machdep.c
diff -u src/sys/arch/hp700/hp700/machdep.c:1.61 src/sys/arch/hp700/hp700/machdep.c:1.62
--- src/sys/arch/hp700/hp700/machdep.c:1.61	Fri May  8 09:33:58 2009
+++ src/sys/arch/hp700/hp700/machdep.c	Sat May  9 11:39:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.61 2009/05/08 09:33:58 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.62 2009/05/09 11:39:30 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.61 2009/05/08 09:33:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.62 2009/05/09 11:39:30 skrll Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -617,13 +617,13 @@
 	struct pdc_cpuid pdc_cpuid PDC_ALIGNMENT;
 	const struct hppa_cpu_info *p = NULL;
 	const char *model;
-	u_int cpu_features;
+	u_int cpu_version, cpu_features;
 	int error;
 	extern int kpsw;
 
 	/* may the scientific guessing begin */
 	cpu_features = 0;
-	cpu_type = 0;
+	cpu_version = 0;
 
 	/* identify system type */
 	if ((error = pdc_call((iodcio_t)pdc, 0, PDC_MODEL, PDC_MODEL_INFO,
@@ -657,13 +657,13 @@
 		printf("%s: cpuid.revision = %x\n", __func__,
 		    pdc_cpuid.revision);
 #endif
-		cpu_type = pdc_cpuid.version;
+		cpu_version = pdc_cpuid.version;
 
 		/* XXXNH why? */
 		/* patch for old 8200 */
 		if (pdc_cpuid.version == HPPA_CPU_PCXU &&
 		    pdc_cpuid.revision > 0x0d)
-			cpu_type = HPPA_CPU_PCXUP;
+			cpu_version = HPPA_CPU_PCXUP;
 	}
 
 	/* locate coprocessors and SFUs */
@@ -681,7 +681,7 @@
 #endif
 		/* a kludge to detect PCXW */
 		if (pdc_coproc.fpu_model == HPPA_FPU_PCXW)
-			cpu_type = HPPA_CPU_PCXW;
+			cpu_version = HPPA_CPU_PCXW;
 	}
 	mtctl(pdc_coproc.ccr_enable & CCR_MASK, CR_CCR);
 #ifdef DEBUG
@@ -689,8 +689,8 @@
 #endif
 	
 	usebtlb = 0;
-	if (cpu_type == HPPA_CPU_PCXW || cpu_type > HPPA_CPU_PCXL2) {
-		printf("WARNING: BTLB no supported on cpu %d\n", cpu_type);
+	if (cpu_version == HPPA_CPU_PCXW || cpu_version > HPPA_CPU_PCXL2) {
+		printf("WARNING: BTLB no supported on cpu %d\n", cpu_version);
 	} else {
 
 		/* BTLB params */
@@ -750,9 +750,9 @@
 		pmap_hptsize = 0;
 	}
 
-	if (cpu_type)
+	if (cpu_version)
 		for (p = cpu_types; p->hci_chip_name; p++) {
-			if (p->hci_cpuid == cpu_type)
+			if (p->hci_cpuid == cpu_version)
 				break;
 		}
 	else
@@ -772,10 +772,10 @@
 	/*
 	 * TODO: HPT on 7200 is not currently supported
 	 */
-	if (pmap_hptsize && p->hci_type != hpcxl && p->hci_type != hpcxl2)
+	if (pmap_hptsize && p->hci_cputype != hpcxl && p->hci_cputype != hpcxl2)
 		pmap_hptsize = 0;
 
-	cpu_type = hppa_cpu_info->hci_type;
+	cpu_type = hppa_cpu_info->hci_cputype;
 	cpu_ibtlb_ins = hppa_cpu_info->ibtlbins;
 	cpu_dbtlb_ins = hppa_cpu_info->dbtlbins;
 	cpu_hpt_init = hppa_cpu_info->hptinit;

Index: src/sys/arch/hp700/include/cpu.h
diff -u src/sys/arch/hp700/include/cpu.h:1.31 src/sys/arch/hp700/include/cpu.h:1.32
--- src/sys/arch/hp700/include/cpu.h:1.31	Fri May  8 09:33:58 2009
+++ src/sys/arch/hp700/include/cpu.h	Sat May  9 11:39:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.31 2009/05/08 09:33:58 skrll Exp $	*/
+/*	$NetBSD: cpu.h,v 1.32 2009/05/09 11:39:31 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $	*/
 
@@ -88,7 +88,7 @@
 
 	/* The type and PA-RISC specification of the chip. */
 	const char hci_chip_type[8];
-	enum hppa_cpu_type hci_type;
+	enum hppa_cpu_type hci_cputype;
 	int  hci_cpuid;
 	int  hci_features;		/* CPU types and features */
 #define	HPPA_FTRS_TLBU		0x00000001

Reply via email to