diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2005-10-01 19:55:26 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2005-10-01 19:55:26 +0000 |
commit | 063d10bba0810a591c7625ce6e36ace8ff549ead (patch) | |
tree | f02b2a80632fae167301b7c7076eb6dec8aeb881 /sys | |
parent | 34cc8abaf39119e92cdf89258a084f4d8ccb1749 (diff) |
Recognize 970 processor and provide a function/variable to determine if
the current processor is 64bit.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/macppc/macppc/cpu.c | 22 | ||||
-rw-r--r-- | sys/arch/powerpc/include/cpu.h | 6 |
2 files changed, 26 insertions, 2 deletions
diff --git a/sys/arch/macppc/macppc/cpu.c b/sys/arch/macppc/macppc/cpu.c index f6d2130aa25..0fe338a959a 100644 --- a/sys/arch/macppc/macppc/cpu.c +++ b/sys/arch/macppc/macppc/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.22 2005/09/29 20:40:24 kettenis Exp $ */ +/* $OpenBSD: cpu.c,v 1.23 2005/10/01 19:55:25 drahn Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -97,6 +97,23 @@ ppc_cpuspeed(int *freq) return (0); } +int ppc_proc_is_64b; + +void +ppc_check_procid() +{ + u_int32_t cpu, pvr; + pvr = ppc_mfpvr(); + cpu = pvr >> 16; + + switch (cpu) { + case PPC_CPU_IBM970: + ppc_proc_is_64b = 1; + break; + default: + ppc_proc_is_64b = 0; + } +} void cpuattach(struct device *parent, struct device *dev, void *aux) @@ -136,6 +153,9 @@ cpuattach(struct device *parent, struct device *dev, void *aux) case PPC_CPU_MPC7447A: snprintf(cpu_model, sizeof(cpu_model), "7447A"); break; + case PPC_CPU_IBM970: + snprintf(cpu_model, sizeof(cpu_model), "970"); + break; case PPC_CPU_IBM750FX: snprintf(cpu_model, sizeof(cpu_model), "750FX"); break; diff --git a/sys/arch/powerpc/include/cpu.h b/sys/arch/powerpc/include/cpu.h index 097935a51fe..6a73fdd67ab 100644 --- a/sys/arch/powerpc/include/cpu.h +++ b/sys/arch/powerpc/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.21 2005/03/10 19:24:30 otto Exp $ */ +/* $OpenBSD: cpu.h,v 1.22 2005/10/01 19:55:25 drahn Exp $ */ /* $NetBSD: cpu.h,v 1.1 1996/09/30 16:34:21 ws Exp $ */ /* @@ -129,6 +129,7 @@ FUNC_SPR(272, sprg0) FUNC_SPR(273, sprg1) FUNC_SPR(274, sprg2) FUNC_SPR(275, sprg3) +FUNC_SPR(280, asr) FUNC_SPR(282, ear) FUNC_SPR(287, pvr) FUNC_SPR(528, ibat0u) @@ -221,6 +222,8 @@ ppc_intr_disable(void) } int ppc_cpuspeed(int *); +void ppc_check_procid(void); +extern int ppc_proc_is_64b; /* * PowerPC CPU types @@ -233,6 +236,7 @@ int ppc_cpuspeed(int *); #define PPC_CPU_MPC750 8 #define PPC_CPU_MPC604ev 9 #define PPC_CPU_MPC7400 12 +#define PPC_CPU_IBM970 0x003c #define PPC_CPU_IBM750FX 0x7000 #define PPC_CPU_MPC7410 0x800c #define PPC_CPU_MPC7447A 0x8003 |