阅读:1600回复:1
请问:LINUX中的mb() 如何转换为windows驱动代码?
这是一个LINUX头文件中看到的,请问LINUX中的mb() 如何转换为windows驱动代码?
291 292 /* 293 * Force strict CPU ordering. 294 * And yes, this is required on UP too when we're talking 295 * to devices. 296 */ 297 #ifdef CONFIG_X86_32 311 #define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2) 312 #define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2) 313 #define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM) 314 #else 315 #define mb() asm volatile("mfence":::"memory") 316 #define rmb() asm volatile("lfence":::"memory") 317 #define wmb() asm volatile("sfence" ::: "memory") 318 #endif 319 |
|
沙发#
发布于:2009-03-18 17:34
没人回答,我自己猜测下:意思是,memory barrier,对应lock指令,或者KeMemoryBarrier。
|
|