Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Sep 2001 17:26:32 +0200 (CEST)
From:      Stefan Keller <dres@earth.serd.org>
To:        <stable@freebsd.org>
Subject:   sys/i386/i386/identcpu.c bugfix
Message-ID:  <20010905160610.U1222-100000@earth.serd.org>

next in thread | raw e-mail | index | archive | help
Hello,

the do_cpuid() inline asm routine in identcpu.c has an incomplete
description of clobbered registers, which shows up when the kernel is
compiled with higher optimisations turned on.
The fix:

--- sys/i386/i386/identcpu.c.org	Mon Sep  3 23:44:25 2001
+++ sys/i386/i386/identcpu.c	Wed Sep  5 03:49:16 2001
@@ -121,7 +121,7 @@
 	"movl	%%edx, 12(%2);"
 	: "=a" (ax)
 	:  "0" (ax), "S" (p)
-	: "bx", "cx", "dx"
+	: "bx", "cx", "dx", "cc", "memory"
 	);
 }

Not specifying "memory" causes gcc to cache the contents of
the memory pointed to by p across do_cpuid() calls.
On my system (Athlon processor) this only showed up on the
CPU name; everything else was ok.

--
Stefan Keller <dres@earth.serd.org>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010905160610.U1222-100000>