From: guenther Date: Sat, 10 May 2014 18:59:29 +0000 (+0000) Subject: Disable speedstep instead of panicing if the high and low speeds are the same. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=83425f6373fc32e9b8b8d6c38986fa5fcab4de93;p=openbsd Disable speedstep instead of panicing if the high and low speeds are the same. Problem noted by Benjamin Baier (programmer (at) netzbasis.de) improvements and ok kettenis@ --- diff --git a/sys/arch/amd64/amd64/est.c b/sys/arch/amd64/amd64/est.c index 3059a0698d6..d4ad12e6ed8 100644 --- a/sys/arch/amd64/amd64/est.c +++ b/sys/arch/amd64/amd64/est.c @@ -1,4 +1,4 @@ -/* $OpenBSD: est.c,v 1.30 2014/03/16 05:19:44 jsg Exp $ */ +/* $OpenBSD: est.c,v 1.31 2014/05/10 18:59:29 guenther Exp $ */ /* * Copyright (c) 2003 Michael Eriksson. * All rights reserved. @@ -420,12 +420,15 @@ est_init(struct cpu_info *ci) if (est_fqlist->n < 2) return; - printf("%s: Enhanced SpeedStep %d MHz", cpu_device, cpuspeed); - low = est_fqlist->table[est_fqlist->n - 1].mhz; high = est_fqlist->table[0].mhz; + if (low == high) + return; + perflevel = (cpuspeed - low) * 100 / (high - low); + printf("%s: Enhanced SpeedStep %d MHz", cpu_device, cpuspeed); + /* * OK, tell the user the available frequencies. */ diff --git a/sys/arch/i386/i386/est.c b/sys/arch/i386/i386/est.c index 5f3a72369bc..dc159fc625e 100644 --- a/sys/arch/i386/i386/est.c +++ b/sys/arch/i386/i386/est.c @@ -1,4 +1,4 @@ -/* $OpenBSD: est.c,v 1.40 2012/10/08 09:01:21 jsg Exp $ */ +/* $OpenBSD: est.c,v 1.41 2014/05/10 18:59:29 guenther Exp $ */ /* * Copyright (c) 2003 Michael Eriksson. * All rights reserved. @@ -1179,12 +1179,15 @@ est_init(struct cpu_info *ci, int vendor) if (est_fqlist->n < 2) return; - printf("%s: Enhanced SpeedStep %d MHz", cpu_device, cpuspeed); - low = est_fqlist->table[est_fqlist->n - 1].mhz; high = est_fqlist->table[0].mhz; + if (low == high) + return; + perflevel = (cpuspeed - low) * 100 / (high - low); + printf("%s: Enhanced SpeedStep %d MHz", cpu_device, cpuspeed); + /* * OK, tell the user the available frequencies. */