Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

RE: [lpc2000] ARM_UCOS port and the use of stmfd/ldmfd

2005-09-21 by David Hawkins

> 
> There are two forms of stm: stm(1) and stm(2)
> There are three forms of ldm: 1,2,3.
> 
> The stm(1) form seems to be generally safe whereas the stm(2) 
> form is only 
> safe in certain cases (saving the SYS/user register bank while 
> not in that 
> mode).

> How you determine which you get, perhaps someone else knows...

There is the slight syntacical difference between a context
restore sequence, eg. 

  ldmfd sp!,{r0-r12,lr,pc}^   // pop new task's r0-r12,lr & pc

versus not including pc in the register list. In that case
the user/sys registers are updated. (I think thats right,
I don't have my ARM-ARM open).

So I was wondering whether the 'safety' issues with using
ldm from user/sys mode are related to this particular use
only, or were in general not useable from user/sys mode.

If this is the case, then I suspect Jean Labrosse's uCOS
port was based on caution, and that the ldm instructions
can be used to speed up the context save/restore sequence
slightly.

At some point I'll just boot the LPC board I have with
one version of the code or the other and see if I break
anything :)  (Busy on other things at the moment tho).

Dave

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.