Compaq ECQD2KCTE Laptop User Manual


 
System Architecture and Programming Implications 5–27
Leaving out the MB at the beginning of the interrupt-receipt routine causes the code to fail if
an old value of the context remains in the second processor’s cache, and invalidates from the
writes done on the first processor are not delivered soon enough.
5.6.4.7 Implications for Memory Mapped I/O
Sections 5.6.4.3 and 5.6.4.4 describe methods for communicating data from a processor or
DMA I/O device to another processor that work reliably in all Alpha systems. Special consid-
erations apply to the communication of data or I-stream from a processor to a DMA I/O
device. These considerations arise from the use of bridges to connect to I/O buses with devices
that are accessible by memory accesses to non-memory-like regions of physical memory.
The following communication method works in all Alpha systems.
To reliably communicate shared data from a processor to an I/O device:
1. Write the shared data to a memory-like physical memory region on the processor.
2. Execute an MB instruction.
3. Write a flag (equivalently, send an interrupt or write a register location implemented in
the I/O device).
The receiving I/O device must:
1. Read the flag (equivalently, detect the interrupt or detect the write to the register loca-
tion implemented in the I/O device).
2. Execute the equivalent of an MB
1
3. Read the shared data.
As shown in Section 5.6.4.3, leaving out the memory barrier removes the assurance that the
shared data is written before the flag is. Unlike the case in Section 5.6.4.3, writing the shared
data to a non-memory-like physical memory region removes the assurance that the I/O device
First Processor Second Processor
:
Write data
MB
Send interrupt Receive interrupt
MB
Access data
:
1 In this context, the logical equivalent of an MB for a DMA device is whatever is necessary under the
applicable I/O subsystem architecture to ensure that preceding writes will be BEFORE (see Section
5.6.1.2) the subsequent reads of shared data. Typically, this action is defined to be present between
every read and write access done by the I/O device, according to the applicable I/O subsystem archi-
tecture.