diff mbox

[1/3] define name for some fields of dr7

Message ID 1354159971-6720-1-git-send-email-lig.fnst@cn.fujitsu.com
State New
Headers show

Commit Message

liguang Nov. 29, 2012, 3:32 a.m. UTC
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
---
 target-i386/cpu.h |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

Comments

liguang Nov. 29, 2012, 4:08 a.m. UTC | #1
sorry, need a fix like following.

在 2012-11-29四的 11:32 +0800,liguang写道:
> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> ---
>  target-i386/cpu.h |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/target-i386/cpu.h b/target-i386/cpu.h
> index 90ef1ff..7f292e6 100644
> --- a/target-i386/cpu.h
> +++ b/target-i386/cpu.h
> @@ -558,6 +558,19 @@
>  #define CPU_INTERRUPT_TPR       CPU_INTERRUPT_TGT_INT_3
>  
> 
> +/* dr7 fields */
> +/* max breakpoints*/
> +#define MAX_BP      4
> +/* Break on instruction execution only */
> +#define BP_INST     0x0
> +/* Break on data writes only */
> +#define BP_DATA_WR  0x1
> +/* Break on I/O reads or writes */
> +#define BP_IO_RW    0x10
> +/* Break on data reads or writes but not instruction fetches */
> +#define BP_DATA_RW  0x11
> +
> +

@@ -568,9 +568,9 @@
 /* Break on data writes only */
 #define BP_DATA_WR  0x1
 /* Break on I/O reads or writes */
-#define BP_IO_RW    0x10
+#define BP_IO_RW    0x2
 /* Break on data reads or writes but not instruction fetches */
-#define BP_DATA_RW  0x11
+#define BP_DATA_RW  0x3
 


>  enum {
>      CC_OP_DYNAMIC, /* must use dynamic code to get cc_op */
>      CC_OP_EFLAGS,  /* all cc are explicitly computed, CC_SRC = flags */
Peter Maydell Nov. 29, 2012, 11:24 a.m. UTC | #2
On 29 November 2012 03:32, liguang <lig.fnst@cn.fujitsu.com> wrote:

Your Subject: line is missing the "target-i386:" prefix.
(also, should be "names".)

> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> ---
>  target-i386/cpu.h |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/target-i386/cpu.h b/target-i386/cpu.h
> index 90ef1ff..7f292e6 100644
> --- a/target-i386/cpu.h
> +++ b/target-i386/cpu.h
> @@ -558,6 +558,19 @@
>  #define CPU_INTERRUPT_TPR       CPU_INTERRUPT_TGT_INT_3
>
>
> +/* dr7 fields */
> +/* max breakpoints*/
> +#define MAX_BP      4
> +/* Break on instruction execution only */
> +#define BP_INST     0x0
> +/* Break on data writes only */
> +#define BP_DATA_WR  0x1
> +/* Break on I/O reads or writes */

... or undefined for 386, 486 or if CR4 DE flag is clear.

> +#define BP_IO_RW    0x10
> +/* Break on data reads or writes but not instruction fetches */
> +#define BP_DATA_RW  0x11

These should all go next to the existing definitions in this
file for some DR7 fields, and they should follow the existing
naming conventions, ie DR7_something. I suggest naming them
DR7_TYPE_INSN, DR7_TYPE_DATA_WR, etc. Could also use a comment
that the DR7_TYPE_ constants are the values for the TYPE field
of DR7, and are what is returned by hw_breakpoint_type().

-- PMM
diff mbox

Patch

diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 90ef1ff..7f292e6 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -558,6 +558,19 @@ 
 #define CPU_INTERRUPT_TPR       CPU_INTERRUPT_TGT_INT_3
 
 
+/* dr7 fields */
+/* max breakpoints*/
+#define MAX_BP      4
+/* Break on instruction execution only */
+#define BP_INST     0x0
+/* Break on data writes only */
+#define BP_DATA_WR  0x1
+/* Break on I/O reads or writes */
+#define BP_IO_RW    0x10
+/* Break on data reads or writes but not instruction fetches */
+#define BP_DATA_RW  0x11
+
+
 enum {
     CC_OP_DYNAMIC, /* must use dynamic code to get cc_op */
     CC_OP_EFLAGS,  /* all cc are explicitly computed, CC_SRC = flags */