From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbvEL-0007kK-KO for qemu-devel@nongnu.org; Tue, 15 Sep 2015 14:45:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbvEG-0001pW-W0 for qemu-devel@nongnu.org; Tue, 15 Sep 2015 14:45:25 -0400 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:35631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbvEG-0001pK-M9 for qemu-devel@nongnu.org; Tue, 15 Sep 2015 14:45:20 -0400 Received: by pacfv12 with SMTP id fv12so187505303pac.2 for ; Tue, 15 Sep 2015 11:45:20 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Tue, 15 Sep 2015 11:45:10 -0700 Message-Id: <1442342713-29497-6-git-send-email-rth@twiddle.net> In-Reply-To: <1442342713-29497-1-git-send-email-rth@twiddle.net> References: <1442342713-29497-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 5/8] target-i386: Move hw_*breakpoint_* functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, ehabkost@redhat.com They're only used from bpt_helper.c now. Signed-off-by: Richard Henderson --- 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 911d9f8..10bbf9f 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)); @@ -114,7 +141,6 @@ void cpu_x86_update_dr7(CPUX86State *env, uint32_t new_dr7) } } } -#endif static bool check_hw_breakpoints(CPUX86State *env, bool force_dr6_update) { @@ -185,6 +211,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 6d3e4f9..8f07db1 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -1124,33 +1124,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