Skip to content

Instantly share code, notes, and snippets.

@le4ker
Created March 21, 2012 15:13
Show Gist options
  • Select an option

  • Save le4ker/2148224 to your computer and use it in GitHub Desktop.

Select an option

Save le4ker/2148224 to your computer and use it in GitHub Desktop.

Revisions

  1. le4ker revised this gist Mar 21, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.c
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    //REGISTER must be between "0" and "7" for the dr0-dr7 accordingly

    #define SET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %0,%dr" REGISTER "\n" :: "r" (VALUE));
    #define SET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %0,%%dr" REGISTER "\n" :: "r" (VALUE));

    #define GET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %dr" REGISTER ",%0\n" : "=r" (VALUE));
    #define GET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %%dr" REGISTER ",%0\n" : "=r" (VALUE));
  2. le4ker revised this gist Mar 21, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.c
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    //REGISTER must be between "0" and "7" for the dr0-dr7 accordingly

    #define SET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %0,%dr" REGISTER "\n" :: "r" VALUE);
    #define SET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %0,%dr" REGISTER "\n" :: "r" (VALUE));

    #define GET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %dr" REGISTER ",%0\n" : "=r" VALUE);
    #define GET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %dr" REGISTER ",%0\n" : "=r" (VALUE));
  3. le4ker revised this gist Mar 21, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.c
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    //REGISTER must be between 0 and 7 for the dr0-dr7 accordingly
    //REGISTER must be between "0" and "7" for the dr0-dr7 accordingly

    #define SET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %0,%dr" REGISTER "\n" :: "r" VALUE);

  4. le4ker revised this gist Mar 21, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.c
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    //REGISTER must be between 0 and 7 for the dr0-dr7 accordingly

    #define SET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %0,%dr" REGISTER "\n" :: "r" (VALUE));
    #define SET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %0,%dr" REGISTER "\n" :: "r" VALUE);

    #define GET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %dr" REGISTER ",%0\n" : "=r" (VALUE));
    #define GET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %dr" REGISTER ",%0\n" : "=r" VALUE);
  5. le4ker revised this gist Mar 21, 2012. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions gistfile1.c
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    #define SET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %0,%%" REGISTER "\n" :: "r" (VALUE));
    //REGISTER must be between 0 and 7 for the dr0-dr7 accordingly

    #define GET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %%" REGISTER ",%0\n" : "=r" (VALUE));
    #define SET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %0,%dr" REGISTER "\n" :: "r" (VALUE));

    #define GET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %dr" REGISTER ",%0\n" : "=r" (VALUE));
  6. le4ker created this gist Mar 21, 2012.
    3 changes: 3 additions & 0 deletions gistfile1.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    #define SET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %0,%%" REGISTER "\n" :: "r" (VALUE));

    #define GET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %%" REGISTER ",%0\n" : "=r" (VALUE));