/* The location of the software interrupt register. Software interrupts use
vector 27. */
#define portITU_SWINTR ( ( unsigned char * ) 0x000872E0 )
#define portYIELD() *portITU_SWINTR = 0x01; portNOP(); portNOP(); portNOP(); portNOP(); portNOP()
This raises several questions:
- First, why not use a trap instruction (e.g: “INT #27″) for portYIELD() (as was done for the H8S port for example)?
- Second, what bug or (apparently undocumented) feature requires the use of no less than 5 NOPs after setting the SWINTR register?
- Lastly, shouldn’t it be enclosed in a do{}while(0) block? Or better yet, shouldn’t it be a static inline function? As is, an otherwise perfectly reasonable code snipit such as
if (foo) portYIELD(); else bar();
brad