Implement memory barriers

This commit is contained in:
2024-02-04 22:10:37 +01:00
parent ec81294eba
commit 9ce841e957
4 changed files with 85 additions and 0 deletions

View File

@@ -252,6 +252,24 @@ ArLoadTaskRegister(USHORT Source)
: "rm" (Source));
}
/**
* Orders memory accesses as seen by other processors.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
ArMemoryBarrier()
{
LONG Barrier;
asm volatile("xchg %%eax, %0"
:
: "m" (Barrier)
: "%eax");
}
/**
* Reads the specified CPU control register and returns its value.
*
@@ -454,6 +472,23 @@ ArReadTimeStampCounter()
return Value;
}
/**
* Orders memory accesses as seen by other processors, without fence.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
ArReadWriteBarrier()
{
asm volatile(""
:
:
: "memory");
}
/**
* Instructs the processor to set the interrupt flag.
*