Other Parts Discussed in Thread: TMS320F28377S
I'm migrating an embeded OS to TMS320F28377s and I need to write two functions for entering and exiting critical zone. When entering critical zone, the function needs to read and return the values of ST0 and ST1 and then disable all maskable interrupts; When exiting critical zone, the function needs to load the values given by a caller to ST0 and ST1 and then enable all maskable interrupts. The problem is that I can't find any instruction that can read or write ST0 and ST1 directly. In fact, I have an idea shown as follows, but I am not sure if it is a good solution. Is there any better suggestion?
_OS_ENTER_CRITICAL:
PUSH ST0
PUSH ST1
POP ACC
DINT
LRETR
_OS_EXIT_CRITICAL:
PUSH ACC
POP ST1
POP ST0
EINT
LRETR