MPC885 Instruction Set
MPC885 PowerQUICC Family Reference Manual, Rev. 2
Freescale Semiconductor
5-17
The functions performed by the sync instruction normally take a significant amount of time to complete;
as a result, frequent use of this instruction may adversely affect performance. In addition, the number of
cycles required to complete a sync instruction depends on system parameters and on the processor's state
when the instruction is issued.
The proper paired use of the lwarx and stwcx. instructions allows programmers to emulate common
semaphore operations such as “test and set,” “compare and swap,” “exchange memory,” and “fetch and
add.” Examples of these semaphore operations can be found in Appendix E, “Synchronization
Programming Examples,” in the Programming Environments Manual. The lwarx instruction must be
paired with an stwcx. instruction with the same effective address used for both instructions of the pair.
Note that the reservation granularity is 16 bytes.
The lwarx and stwcx. instructions are implemented according to the PowerPC architecture requirements.
The concept behind the use of the lwarx and stwcx. instructions is that a processor may load a semaphore
from memory, compute a result based on the value of the semaphore, and conditionally store it back to the
same location (only if that location has not been modified since it was first read), and determine if the store
was successful. The conditional store is performed based upon the existence of a reservation established
by the preceding lwarx instruction. If the reservation exists when the store is executed, the store is
performed and a bit is set in the CR. If the reservation does not exist when the store is executed, the target
memory location is not modified and a bit is cleared in the CR.
If the store was successful, the sequence of instructions from the read of the semaphore to the store that
updated the semaphore appear to have been executed atomically (that is, no other processor or mechanism
modified the semaphore location between the read and the update), thus providing the equivalent of a real
atomic operation. However, in reality, other processors may have read from the location during this
operation. In the MPC885, the reservations are made on behalf of aligned 16-byte sections of the memory
address space.
The lwarx and stwcx. instructions require the EA to be aligned. Exception handling software should not
attempt to emulate a misaligned lwarx or stwcx. instruction, because there is no correct way to define the
address associated with the reservation.
In general, the lwarx and stwcx. instructions should be used only in system programs, which can be
invoked by application programs as needed.
At most, one reservation exists simultaneously on any processor. The address associated with the
reservation can be changed by a subsequent lwarx instruction. The conditional store is performed based
upon the existence of a reservation established by the preceding lwarx, regardless of whether the address
generated by the lwarx matches that generated by the stwcx. instruction. A reservation held by the
processor is cleared by one of the following:
•
Executing an stwcx. instruction to any address
•
Attempt by another device to modify a location in the reservation granularity (16 bytes)
In write-through mode, lwarx and stwcx. do not cause a DSI exception.
The sync instruction guarantees that previously fetched instructions finish before any subsequent
instructions are dispatched to the execution units. It does not affect fetching; instructions continue to be
fetched up to the instruction queue limit, but dispatch stalls until the sync finishes.
Содержание PowerQUICC MPC870
Страница 1: ...MPC885 PowerQUICC Family Reference Manual Supports MPC885 MPC880 MPC875 MPC870 MPC885RM Rev 2 04 2006 ...
Страница 98: ...MPC885 PowerQUICC Family Reference Manual Rev 2 I 4 Freescale Semiconductor ...
Страница 118: ...MPC885 Overview MPC885 PowerQUICC Family Reference Manual Rev 2 1 20 Freescale Semiconductor ...
Страница 158: ...The MPC8xx Core MPC885 PowerQUICC Family Reference Manual Rev 2 3 18 Freescale Semiconductor ...
Страница 192: ...MPC885 Instruction Set MPC885 PowerQUICC Family Reference Manual Rev 2 5 22 Freescale Semiconductor ...
Страница 242: ...Instruction and Data Caches MPC885 PowerQUICC Family Reference Manual Rev 2 7 30 Freescale Semiconductor ...
Страница 288: ...MPC885 PowerQUICC Family Reference Manual Rev 2 III 4 Freescale Semiconductor ...
Страница 416: ...External Bus Interface MPC885 PowerQUICC Family Reference Manual Rev 2 13 42 Freescale Semiconductor ...
Страница 440: ...Clocks and Power Control MPC885 PowerQUICC Family Reference Manual Rev 2 14 24 Freescale Semiconductor ...
Страница 554: ...MPC885 PowerQUICC Family Reference Manual Rev 2 V 6 Freescale Semiconductor ...
Страница 606: ...SDMA Channels and IDMA Emulation MPC885 PowerQUICC Family Reference Manual Rev 2 19 20 Freescale Semiconductor ...
Страница 738: ...SCC Asynchronous HDLC Mode and IrDA MPC885 PowerQUICC Family Reference Manual Rev 2 25 16 Freescale Semiconductor ...
Страница 780: ...SCC Ethernet Mode MPC885 PowerQUICC Family Reference Manual Rev 2 27 24 Freescale Semiconductor ...
Страница 794: ...SCC Transparent Mode MPC885 PowerQUICC Family Reference Manual Rev 2 28 14 Freescale Semiconductor ...
Страница 848: ...Serial Peripheral Interface SPI MPC885 PowerQUICC Family Reference Manual Rev 2 30 18 Freescale Semiconductor ...
Страница 882: ...Universal Serial Bus USB MPC885 PowerQUICC Family Reference Manual Rev 2 31 34 Freescale Semiconductor ...
Страница 944: ...Parallel I O Ports MPC885 PowerQUICC Family Reference Manual Rev 2 34 26 Freescale Semiconductor ...
Страница 956: ...CPM Interrupt Controller MPC885 PowerQUICC Family Reference Manual Rev 2 35 12 Freescale Semiconductor ...
Страница 1004: ...Buffer Descriptors and Connection Tables MPC885 PowerQUICC Family Reference Manual Rev 2 37 30 Freescale Semiconductor ...
Страница 1022: ...ATM Parameter RAM MPC885 PowerQUICC Family Reference Manual Rev 2 38 18 Freescale Semiconductor ...
Страница 1068: ...ATM Pace Control MPC885 PowerQUICC Family Reference Manual Rev 2 40 22 Freescale Semiconductor ...
Страница 1090: ...UTOPIA Interface MPC885 PowerQUICC Family Reference Manual Rev 2 43 8 Freescale Semiconductor ...
Страница 1120: ...AAL2 Implementation MPC885 PowerQUICC Family Reference Manual Rev 2 44 30 Freescale Semiconductor ...
Страница 1162: ...Fast Ethernet Controller FEC MPC885 PowerQUICC Family Reference Manual Rev 2 45 40 Freescale Semiconductor ...
Страница 1172: ...SEC Lite Overview MPC885 PowerQUICC Family Reference Manual Rev 2 46 8 Freescale Semiconductor ...
Страница 1176: ...SEC Lite Address Map MPC885 PowerQUICC Family Reference Manual Rev 2 47 4 Freescale Semiconductor ...
Страница 1214: ...SEC Lite Execution Units MPC885 PowerQUICC Family Reference Manual Rev 2 48 38 Freescale Semiconductor ...
Страница 1312: ...Byte Ordering MPC885 PowerQUICC Family Reference Manual Rev 2 A 8 Freescale Semiconductor ...
Страница 1313: ...MPC885 PowerQUICC Family Reference Manual Rev 2 Freescale Semiconductor B 1 Appendix B Serial Communications Performance TBD ...
Страница 1314: ...Serial Communications Performance MPC885 PowerQUICC Family Reference Manual Rev 2 B 2 Freescale Semiconductor ...
Страница 1320: ...Register Quick Reference Guide MPC885 PowerQUICC Family Reference Manual Rev 2 C 6 Freescale Semiconductor ...
Страница 1336: ...MPC885 PowerQUICC Family Reference Manual Rev 2 D 16 Freescale Semiconductor ...
Страница 1358: ...MPC885 PowerQUICC Family Reference Manual Rev 2 D 38 Freescale Semiconductor ...
Страница 1370: ...MPC880 MPC885 PowerQUICC Family Reference Manual Rev 2 E 4 Freescale Semiconductor ...
Страница 1384: ...Serial ATM Scrambling Reception and SI Programming MPC885 PowerQUICC Family Reference Manual Rev 2 H 6 Freescale Semiconductor ...
Страница 1386: ...Revision History MPC885 PowerQUICC Family Reference Manual Rev 2 I 2 Freescale Semiconductor ...