📄 scout_synch.h
字号:
#ifndef __x86_synch_h__#define __x86_synch_h__#ifndef LANGUAGE_ASSEMBLY#ifndef USER_LEVELextern inline longsynchEnableInterrupts (void){ register long result; asm volatile ("pushfl ; popl %0 ; sti" : "r="(result) : ); return result;}extern inline longsynchDisableInterrupts (void){ register long result; asm volatile (" ; pushfl ; popl %0 ; cli ;" : "r="(result) : ); return result;}extern inline voidsynchRestoreInterrupts (long flags){ asm volatile ("pushl %0; popfl ; " : : "r"(flags) : "cc");}#endif /* USER_LEVEL */#define synchAtomicSequence(as) \({ \ register long as_flags; \ as_flags = synchDisableInterrupts(); \ {as;} \ synchRestoreInterrupts(as_flags); \})#endif /* LANGUAGE_ASSEMBLY */#endif /* __x86_synch_h__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -