serialize_memory_access(D3D) —
.IX \f4serialize_memory_access\fP(D3D)
NAME
serialize_memory_access − force processor to serialize memory access
SYNOPSIS
#include <sys/types.h>
#include <sys/ddi.h>
(void) serialize_memory_access();
DESCRIPTION
Many processors execute and complete load and store instructions in the order in which they are encountered. For instance, if a program has a store instruction followed by a load instruction, the processor will execute the store instruction, and then the load instruction. Some processors, for efficiency reasons, overlap instruction executions and do not necessarily finish instructions in the same order as they begin them. Consider a possible execution of the previous example on such a processor: the store will be issued, then the load will be issued, but the load instruction may complete before the store instruction does.
Normally, this is not a problem because the processor will produce results in memory that are the same as if all loads and stores were executed in program order. Note, however, that this is because the memory system functions correctly regardless of the order of loads and stores. That is, a store to address A won’t change the results of a load from address B, for distinct addresses A and B. However, some hardware devices and their drivers require that the loads and stores be visible to the device in a specific order. In such a case, a processor must perform the instructions in a serialized fashion to guarantee correct behavior.
serialize_memory_access forces the processor to synchronize before performing any laod or store instruction; thus the processor will access all hardware addresses in the exact order specified by the program. When the order-specific instructions have been completed, the function deserialize_memory_access will restore the processor’s ability to concurrently execute load and store instructions.
Note that because synchronizing the processor decreases its effective throughput, these functions should be used only where necessary. For the same reason, the number of instructions that are performed in serialized mode should also be made as small as possible.
LEVEL
Base or Interrupt.
NOTES
Because of its impact on performance, this function should be used sparingly. For the same reason, the number of instructions that are performed in serialized mode should also be made as small as possible.
Any routine that calls this routine should invoke deserialize_memory_access() before calling sleep, longjmp, or similar functions.
On processors that do not concurrently execute load and store instructions, this function has no effect.
SEE ALSO
deserialize_memory_access(D3D), sysm88k(2)
DDI