Created
April 17, 2013 18:06
-
-
Save erincandescent/5406435 to your computer and use it in GitHub Desktop.
This file contains 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
static inline int disable_interrupts(void) | |
{ | |
int r; | |
__asm__ __volatile__( | |
"pushfd;" | |
"cli;" | |
"pop %0;" | |
: "=mr"(r) | |
); | |
return r; | |
} | |
static inline void restore_interrupts(int r) | |
{ | |
__asm__ __volatile__ ("push %0; popfd;" :: "mr"(r)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment