vPortEnableInterruptsFromThumb use

bflorac wrote on Monday, March 03, 2008:

Im confused as to use of the function vPortDisableInterruptsFromThumb()[see: portDISABLE_INTERRUPTS]. It does not appear to result in any different code then vPortEnterCritical()[see: portENTER_CRITICAL]. Both functions disable interrupts and both are contained in the portISR.c code. All the code here is defined as ARM and it seems the GCC compiler correct puts it in and out of THUMB mode when these are called.

rtel wrote on Monday, March 03, 2008:

When compiling your entire application in ARM mode it is more efficient to disable/enable interrupts using an inline macro, but this macro uses ARM instructions.  When compiling your code in THUMB mode you cannot use the macro (as it contains ARM instructions) so instead a function call is used.  When using ARM/THUMB interworking the compiler will ensure you switch to ARM mode on entry to the function, so the function is compiled to ARM mode.  It is called "FromThumb", but compiled to ARM, with the compiler taking care of the switching.


bflorac wrote on Tuesday, March 04, 2008:

It seems odd that the “FromThumb” version is only called once. Elsewhere, the other version is called.  So if one compiles with Thumb/Interworking off but in THUMB mode, shouldn’t the “FromThumb” always be called?