Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amigappc/amigappc Fixed overflow in cpu clock calcu...
details: https://anonhg.NetBSD.org/src/rev/132290af10ea
branches: trunk
changeset: 758315:132290af10ea
user: phx <phx%NetBSD.org@localhost>
date: Mon Nov 01 19:00:08 2010 +0000
description:
Fixed overflow in cpu clock calculation and printing of the cpu revision.
diffstat:
sys/arch/amigappc/amigappc/machdep.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diffs (51 lines):
diff -r 13e98e675b55 -r 132290af10ea sys/arch/amigappc/amigappc/machdep.c
--- a/sys/arch/amigappc/amigappc/machdep.c Mon Nov 01 16:27:07 2010 +0000
+++ b/sys/arch/amigappc/amigappc/machdep.c Mon Nov 01 19:00:08 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.43 2010/05/21 12:52:14 phx Exp $ */
+/* $NetBSD: machdep.c,v 1.44 2010/11/01 19:00:08 phx Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.43 2010/05/21 12:52:14 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.44 2010/11/01 19:00:08 phx Exp $");
#include <sys/param.h>
#include <sys/mount.h>
@@ -259,16 +259,17 @@
amigappc_identify(void)
{
extern u_long ns_per_tick, ticks_per_sec;
- static const char pll603[] = {
+ static const unsigned char pll603[] = {
10, 10, 10, 10, 20, 20, 25, 00,
30, 00, 40, 00, 15, 00, 35, 00
};
- static const char pll604[] = {
+ static const unsigned char pll604[] = {
10, 10, 70, 10, 20, 65, 25, 45,
30, 55, 40, 50, 15, 60, 35, 00
};
const char *cpuname, *mach, *p5type_p, *pup;
- int busclock, cpu, cpuclock;
+ u_long busclock, cpuclock;
+ int cpu;
register int pvr, hid1;
/* PowerUp ROM id location */
@@ -353,8 +354,9 @@
cpuclock = busclock * pll604[hid1>>28 & 0xf] / 10;
snprintf(model, sizeof(model),
- "%s %s (%s v%d.%d %d MHz, busclk %d MHz)", mach, pup, cpuname,
- pvr>>8 & 0xff, pvr & 0xff, cpuclock/1000000, busclock/1000000);
+ "%s %s (%s v%d.%d %lu MHz, busclk %lu MHz)",
+ mach, pup, cpuname, (pvr>>8) & 0xf, (pvr >> 0) & 0xf,
+ cpuclock / 1000000, busclock / 1000000);
/* set timebase */
ticks_per_sec = busclock / 4;
Home |
Main Index |
Thread Index |
Old Index