Hi,
I have just started working with P1020 PowerPC IC and have my first problem. I was looking into P1020 reference manual and e500 ppc documentation and cannot find answer for my question.
How can I read 64bit value - created as two 32bit lower TBL and 32bit upper TBU registers of Time Base module - and prevent race condition? Is it guaranteed that the value will be correct (registers are latched?). Is there any assembler instruction that can read both registers in atomic way? Where I can find this kind of info in the doc?
Regards
已解决! 转到解答。
Please use the following sequence:
1. Read upper part
2. Read lower part
3. Read upper part once again and compare with value, returned on step 1. If the value is the same, than you can be sure upper part is not changed during step 2, so the resulting 64-bit value is consistent.
Have a great day,
Alexander
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Please use the following sequence:
1. Read upper part
2. Read lower part
3. Read upper part once again and compare with value, returned on step 1. If the value is the same, than you can be sure upper part is not changed during step 2, so the resulting 64-bit value is consistent.
Have a great day,
Alexander
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------