|
S912XHZ512F1VAG Datasheet, PDF (231/978 Pages) Freescale Semiconductor, Inc – Covers MC9S12XHZ384, MC9S12XHZ256 | |||
|
◁ |
Chapter 5 XGATE (S12XGATEV2)
5.4.4 Semaphores
The XGATE module offers a set of eight hardware semaphores. These semaphores provide a mechanism
to protect system resources that are shared between two concurrent threads of program execution; one
thread running on the S12X_CPU and one running on the XGATE RISC core.
Each semaphore can only be in one of the three states: âUnlockedâ, âLocked by S12X_CPUâ, and âLocked
by XGATEâ. The S12X_CPU can check and change a semaphoreâs state through the XGATE semaphore
register (XGSEM, see Section 5.3.1.6, âXGATE Semaphore Register (XGSEM)â). The RISC core does
this through its SSEM and CSEM instructions.
Figure 5-21 illustrates the valid state transitions.
%1 â XGSEM
SSEM Instruction
CSEM Instruction
%1 â XGSEM
%0 â XGSEM
SSEM Instruction
LOCKED BY
LOCKED BY
S12X_CPU
XGATE
%0 â
an%d S1Sâ%EM1XGâIonSrsXEtrGM. SEMXGSEMUNLOCKED
CInSsEtrMuctSIinoSsnEtruMction
%0 â XGSEM
CSEM Instruction
Figure 5-21. Semaphore State Transitions
MC9S12XHZ512 Data Sheet, Rev. 1.06
Freescale Semiconductor
231
|
▷ |