English
Language : 

SH7205 Datasheet, PDF (143/1904 Pages) Renesas Technology Corp – Renesas 32-Bit RISC Microcomputer SuperHTM RISC engine Family / SH7200 Series
Section 4 Multi-Core Processor
; Initialization routine
Make initial settings
; 1. Initialize SEMR0 to SEMR31
MOVI20
MOV
MOV.B
MOV.B
MOV.B
MOV.B
:
:
MOV.B
#H'FFFC1E00, R0
#H'01, R1
R1,@(H'000, R0) ; SEMR0.SEMF = 1
R1,@(H'004, R0) ; SEMR1.SEMF = 1
R1,@(H'008, R0) ; SEMR2.SEMF = 1
R1,@(H'00C, R0) ; SEMR3.SEMF = 1
R1,@(H'07C, R0) ; SEMR31.SEMF = 1
; 2. Read SEMR0
; 3. Make sure that 1 has been read from SEMF bit in SEMR0
MOVI20
LOOP:
BLD.B
BF
#H'FFFC1E00, R0
#0,@(H'000, R0)
LOOP
; 4. Use resource A
:
:
; 5. Set SEMF bit in SEMR0 to 1
MOVI20
MOV
MOV.B
#H'FFFC1E00, R0
#H'01, R1
R1,@(H'000, R0)
Figure 4.2 Example of a Program for Exclusive Control
(2) Notes
As a general precaution in exclusive control, pay attention to ensuring that the system does not
enter a deadlock. For example, the system enters a deadlock in the following case.
1. CPU0 is to use currently available resource A and thus reads 1 from the SEMF bit in SEMR0
(this operation clears the SEMF bit in SEMR0 to 0).
2. CPU1 is to use currently available resource B and thus reads 1 from the SEMF bit in SEMR1
(this operation clears the SEMF bit in SEMR1 to 0).
3. CPU0 is to use resource B and thus reads the SEMF bit in SEMR1, but it keeps reading the bit
as 0 since it was cleared in step 2.
4. CPU1 is to use resource A and thus reads the SEMF bit in SEMR0, but it keeps reading the bit
as 0 since it was cleared in step 1.
Rev. 1.00 Mar. 25, 2008 Page 111 of 1868
REJ09B0372-0100