From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpeLf-0002E8-Dh for qemu-devel@nongnu.org; Fri, 23 Oct 2015 11:33:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpeLc-0001oq-4G for qemu-devel@nongnu.org; Fri, 23 Oct 2015 11:33:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpeLb-0001ol-VB for qemu-devel@nongnu.org; Fri, 23 Oct 2015 11:33:40 -0400 From: Eduardo Habkost Date: Fri, 23 Oct 2015 13:33:05 -0200 Message-Id: <1445614392-26687-7-git-send-email-ehabkost@redhat.com> In-Reply-To: <1445614392-26687-1-git-send-email-ehabkost@redhat.com> References: <1445614392-26687-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PULL 06/13] target-i386: Move hw_*breakpoint_* functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson From: Richard Henderson They're only used from bpt_helper.c now. Signed-off-by: Richard Henderson Signed-off-by: Eduardo Habkost --- target-i386/bpt_helper.c | 29 ++++++++++++++++++++++++++++- target-i386/cpu.h | 27 --------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/target-i386/bpt_helper.c b/target-i386/bpt_helper.c index 49472ea..ca58ab7 100644 --- a/target-i386/bpt_helper.c +++ b/target-i386/bpt_helper.c @@ -22,6 +22,33 @@ #ifndef CONFIG_USER_ONLY +static inline bool hw_local_breakpoint_enabled(unsigned long dr7, int index) +{ + return (dr7 >> (index * 2)) & 1; +} + +static inline bool hw_global_breakpoint_enabled(unsigned long dr7, int index) +{ + return (dr7 >> (index * 2)) & 2; + +} +static inline bool hw_breakpoint_enabled(unsigned long dr7, int index) +{ + return hw_global_breakpoint_enabled(dr7, index) || + hw_local_breakpoint_enabled(dr7, index); +} + +static inline int hw_breakpoint_type(unsigned long dr7, int index) +{ + 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 * 4))) & 3); + return (len == 2) ? 8 : len + 1; +} + static void hw_breakpoint_insert(CPUX86State *env, int index) { CPUState *cs = CPU(x86_env_get_cpu(env)); @@ -116,7 +143,6 @@ void cpu_x86_update_dr7(CPUX86State *env, uint32_t new_dr7) } } } -#endif static bool check_hw_breakpoints(CPUX86State *env, bool force_dr6_update) { @@ -187,6 +213,7 @@ void breakpoint_handler(CPUState *cs) } } } +#endif void helper_single_step(CPUX86State *env) { diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 70d1b21..0ccd513 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -1128,33 +1128,6 @@ void x86_stl_phys(CPUState *cs, hwaddr addr, uint32_t val); void x86_stq_phys(CPUState *cs, hwaddr addr, uint64_t val); #endif -static inline bool hw_local_breakpoint_enabled(unsigned long dr7, int index) -{ - return (dr7 >> (index * 2)) & 1; -} - -static inline bool hw_global_breakpoint_enabled(unsigned long dr7, int index) -{ - return (dr7 >> (index * 2)) & 2; - -} -static inline bool hw_breakpoint_enabled(unsigned long dr7, int index) -{ - return hw_global_breakpoint_enabled(dr7, index) || - hw_local_breakpoint_enabled(dr7, index); -} - -static inline int hw_breakpoint_type(unsigned long dr7, int index) -{ - 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 * 4))) & 3); - return (len == 2) ? 8 : len + 1; -} - void breakpoint_handler(CPUState *cs); /* will be suppressed */ -- 2.1.0