Hi Peter,
----- Ursprüngliche Nachricht ----- Von: Peter Jansen Gesendet am: 30 Mrz 2011 09:20:39 >>FWIW, "naked" is a rather poorly defined construct, as the original >>implementation would allow you to write code that would silently overwrite >>parts >>of the stack. "task" (documented only in the mailing list archives) is >>equivalent to naked except that it allocates a stack frame when the function >>requires one, and is what main() will be given when I deal with 3207046. > The FreeRTOS example I'm using does not use 'task', but I agree that 'task' > is > useful for functions that don't return. Yep, it might be useful for functions you control by a task switcher (the ones that are started as a separate task and therefore do not need to save nor restore any registers as they start with a fresh stack and 'empty' registers and return to the void (some 'end task' function automatically provided by the 'create task' function when the new tasks stack is created.) >>I'm curious, though, why your interrupt routine needs control of the order of >>register saves. Does FreeRTOS inspect the stack to extract register values >>for >>some reason? I don't know how FreeRTOS does it, but my own task scheduler/switcher switches the stack, savin gall registers before doing so (except the stack pointer, the status register, which has been alread saved on stack on ISR entry, the PC, as it is always the same and R3 as it is useless. Having the compiler saving an unknown number of registers to stack is a waste of stack space in every thread. You're saving everyhting anyway. > Some way of saving all regs would be nice(tm). On MSP430X(2), there is a push command that saves any number of registers. "pushm #12, R15" saves all registers from R4 to R15, while "popm #12, R15" pops them in opposite order (!). Can't be faster :) JMGross ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users