diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-04-17 18:51:04 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-04-17 18:51:04 +0200 |
commit | c908225cb5def2c6df3cf889ca458db8b633d395 (patch) | |
tree | 04f2d25cd5bfbaf0d10f8edbbc168a33514d8357 | |
parent | bfc8f3afc0ba4737f0c9f515400c04e0e624234e (diff) | |
download | gnumach-c908225cb5def2c6df3cf889ca458db8b633d395.tar.gz gnumach-c908225cb5def2c6df3cf889ca458db8b633d395.tar.bz2 gnumach-c908225cb5def2c6df3cf889ca458db8b633d395.zip |
Add memory barrier to spl*
* i386/i386/spl.S (mb): Define macro
(SETIPL, spl0, spl7): Call mb.
-rw-r--r-- | i386/i386/spl.S | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/i386/i386/spl.S b/i386/i386/spl.S index 1dce991d..307739f5 100644 --- a/i386/i386/spl.S +++ b/i386/i386/spl.S @@ -23,6 +23,12 @@ #include <i386/i386asm.h> #include <i386/xen.h> +#if NCPUS > 1 +#define mb lock; addl $0,(%esp) +#else +#define mb +#endif + /* * Set IPL to the specified value. * @@ -34,6 +40,7 @@ * potentially, return with interrupts disabled. */ #define SETIPL(level) \ + mb; \ movl $(level),%edx; \ cmpl EXT(curr_ipl),%edx; \ jne spl; \ @@ -70,6 +77,7 @@ lock orl $1,hyp_shared_info+CPU_PENDING_SEL; /* Yes, activate it */ \ #endif /* MACH_XEN */ ENTRY(spl0) + mb; movl EXT(curr_ipl),%eax /* save current ipl */ pushl %eax cli /* disable interrupts */ @@ -140,6 +148,7 @@ Entry(splsched) Entry(splhigh) Entry(splhi) ENTRY(spl7) + mb; /* ipl7 just clears IF */ movl $SPL7,%eax xchgl EXT(curr_ipl),%eax |