diff options
| author | Merlin Scholz <merlin@scholz.ruhr> | 2022-10-24 17:30:32 +0200 |
|---|---|---|
| committer | Merlin Scholz <merlin@scholz.ruhr> | 2022-10-24 17:30:32 +0200 |
| commit | 581d0d2125d0ef0541b12dc9ce81deb40aa4b79b (patch) | |
| tree | 00e59c26abe7f0b53d2c82a017118546134e1312 /sys/arch/x86/include/cpufunc.h | |
| parent | 062b5ea39274e32d65f6369977a0b9142509e645 (diff) | |
First proper lockdoc hooks
Diffstat (limited to 'sys/arch/x86/include/cpufunc.h')
| -rw-r--r-- | sys/arch/x86/include/cpufunc.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/arch/x86/include/cpufunc.h b/sys/arch/x86/include/cpufunc.h index 12e1f406ec9..c82058278b3 100644 --- a/sys/arch/x86/include/cpufunc.h +++ b/sys/arch/x86/include/cpufunc.h @@ -45,6 +45,7 @@ #ifdef _KERNEL #if defined(_KERNEL_OPT) #include "opt_xen.h" +#include "opt_lockdebug.h" #endif static inline void @@ -374,17 +375,41 @@ void xrstor(const union savefpu *, uint64_t); void x86_disable_intr(void); void x86_enable_intr(void); #else + +#ifdef LOCKDEBUG +#define x86_disable_intr() __x86_disable_intr(__FILE__, __LINE__, __func__) +void __x86_disable_intr(const char *file, int line, const char *func); + +static __inline void lockdoc_x86_disable_intr(void) +{ + __asm volatile ("cli" ::: "memory"); +} + +#else static inline void x86_disable_intr(void) { __asm volatile ("cli" ::: "memory"); } +#endif /* LOCKDEBUG */ +#ifdef LOCKDEBUG +#define x86_enable_intr() __x86_enable_intr(__FILE__, __LINE__, __func__) +void __x86_enable_intr(const char *file, int line, const char *func); + +static __inline void lockdoc_x86_enable_intr(void) +{ + __asm volatile ("sti" ::: "memory"); +} + +#else static inline void x86_enable_intr(void) { __asm volatile ("sti" ::: "memory"); } +#endif /* LOCKDEBUG */ + #endif /* XENPV */ /* Use read_psl, write_psl when saving and restoring interrupt state. */ |
