From: Jan Kiszka Date: Mon, 14 Dec 2009 11:26:27 +0000 (+0100) Subject: target-i386: Fix evaluation of DR7 register X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~9279 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d46272c774a94a8b2f0849703070dbcd93057f50;p=sdk%2Femulator%2Fqemu.git target-i386: Fix evaluation of DR7 register hw_breakpoint_type and hw_breakpoint_len used the wrong index multiplier to extract type and len. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori --- diff --git a/target-i386/cpu.h b/target-i386/cpu.h index afb4da5..f3834b3 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -835,12 +835,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; }