Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/alpha/alpha * If the cpu_model string contains some...
details: https://anonhg.NetBSD.org/src/rev/4437c5b303b2
branches: trunk
changeset: 474138:4437c5b303b2
user: ross <ross%NetBSD.org@localhost>
date: Tue Jun 29 07:21:30 1999 +0000
description:
* If the cpu_model string contains some form of MHz , don't print
the rpb field also.
* Add dot_conv(), hex format conversion for long hex digit strings.
diffstat:
sys/arch/alpha/alpha/machdep.c | 36 ++++++++++++++++++++++++++++++++----
1 files changed, 32 insertions(+), 4 deletions(-)
diffs (65 lines):
diff -r d86ba9bd6198 -r 4437c5b303b2 sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c Tue Jun 29 07:18:23 1999 +0000
+++ b/sys/arch/alpha/alpha/machdep.c Tue Jun 29 07:21:30 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.176 1999/06/28 08:20:40 itojun Exp $ */
+/* $NetBSD: machdep.c,v 1.177 1999/06/29 07:21:30 ross Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.176 1999/06/28 08:20:40 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.177 1999/06/29 07:21:30 ross Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1111,12 +1111,18 @@
void
identifycpu()
{
+ char *s;
/*
* print out CPU identification information.
*/
- printf("%s, %ldMHz\n", cpu_model,
- hwrpb->rpb_cc_freq / 1000000); /* XXX true for 21164? */
+ printf("%s", cpu_model);
+ for(s = cpu_model; *s; ++s)
+ if(strncasecmp(s, "MHz", 3) == 0)
+ goto skipMHz;
+ printf(", %ldMHz", hwrpb->rpb_cc_freq / 1000000);
+skipMHz:
+ printf("\n");
printf("%ld byte page size, %d processor%s.\n",
hwrpb->rpb_page_size, ncpus, ncpus == 1 ? "" : "s");
#if 0
@@ -2159,3 +2165,25 @@
return &startup_info;
return mchkinfo_all_cpus + alpha_pal_whami();
}
+
+char *
+dot_conv(x)
+ unsigned long x;
+{
+ int i;
+ char *xc;
+ static int next;
+ static char space[2][20];
+
+ xc = space[next ^= 1] + sizeof space[0];
+ *--xc = '\0';
+ for (i = 0;; ++i) {
+ if (i && (i & 3) == 0)
+ *--xc = '.';
+ *--xc = "0123456789abcdef"[x & 0xf];
+ x >>= 4;
+ if (x == 0)
+ break;
+ }
+ return xc;
+}
Home |
Main Index |
Thread Index |
Old Index