Kernel: Let's have cli() and sti() clobber memory.

I don't like the idea of the compiler reordering anything around either
cli() or sti(), so let's make sure it doesn't.
This commit is contained in:
Andreas Kling 2019-02-03 02:47:55 +01:00
parent e2f27aa7b5
commit c63d476da2
Notes: sideshowbarker 2024-07-19 15:53:35 +09:00

View File

@ -79,8 +79,8 @@ void write_gdt_entry(word selector, Descriptor&);
#define LSB(x) ((x) & 0xFF)
#define MSB(x) (((x)>>8) & 0xFF)
#define cli() asm volatile("cli")
#define sti() asm volatile("sti")
#define cli() asm volatile("cli" ::: "memory")
#define sti() asm volatile("sti" ::: "memory")
#define memory_barrier() asm volatile ("" ::: "memory")
inline dword cpu_cr3()