From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NK94X-0006Em-7V for qemu-devel@nongnu.org; Mon, 14 Dec 2009 06:26:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NK94S-0006CF-50 for qemu-devel@nongnu.org; Mon, 14 Dec 2009 06:26:36 -0500 Received: from [199.232.76.173] (port=34089 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NK94Q-0006C8-LP for qemu-devel@nongnu.org; Mon, 14 Dec 2009 06:26:30 -0500 Received: from goliath.siemens.de ([192.35.17.28]:23559) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NK94P-0003LV-Ln for qemu-devel@nongnu.org; Mon, 14 Dec 2009 06:26:30 -0500 Message-ID: <4B2620E3.2050604@siemens.com> Date: Mon, 14 Dec 2009 12:26:27 +0100 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [FOR 0.12][PATCH] target-i386: Fix evaluation of DR7 register List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel hw_breakpoint_type and hw_breakpoint_len used the wrong index multiplier to extract type and len. Signed-off-by: Jan Kiszka --- target-i386/cpu.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 9ef1be4..e835f23 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -834,12 +834,12 @@ static inline int hw_breakpoint_enabled(unsigned long dr7, int index) static inline int hw_breakpoint_type(unsigned long dr7, int index) { - return (dr7 >> (DR7_TYPE_SHIFT + (index * 2))) & 3; + return (dr7 >> (DR7_TYPE_SHIFT + (index * 4))) & 3; } static inline int hw_breakpoint_len(unsigned long dr7, int index) { - int len = ((dr7 >> (DR7_LEN_SHIFT + (index * 2))) & 3); + int len = ((dr7 >> (DR7_LEN_SHIFT + (index * 4))) & 3); return (len == 2) ? 8 : len + 1; }