Created
March 21, 2012 15:13
-
-
Save le4ker/2148224 to your computer and use it in GitHub Desktop.
SET/GET debug registers MACROS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 GET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %%dr" REGISTER ",%0\n" : "=r" (VALUE)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use the set_debugreg and get_debugreg instead!