forked from xt-sys/exectos
Implement memory barriers
This commit is contained in:
@@ -271,6 +271,23 @@ 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("lock; orl $0, %0;"
|
||||
:
|
||||
: "m"(Barrier));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the specified CPU control register and returns its value.
|
||||
*
|
||||
@@ -485,6 +502,23 @@ ArReadTimeStampCounter()
|
||||
return ((ULONGLONG)High << 32) | Low;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user