What are and how are the "_XMK_xxxx_STACK" macros defined?
These macros are used to calculate the amount of stack overhead that is required by 1) the context registers; and 2) the XMK's calling sequence when doing context switches from an ISR and/or from a thread. This overhead becomes the absolute minimum size for a thread's stack. These macros are also compiler specific because they depended on the compiler's ABI.
_XMK_1LEVEL_ISR_STACK - This is the size, in bytes, of the stack frame that is generated when an interrupt occurs, i.e. what is pushed onto the stack by the hardware and the prolog of the interrupt service routine. It includes: the return address, the program status word, and the volatile hardware registers
_XMK_ISRHOOK_STACK - This is the amount of overhead, in bytes, required by XMK's ISR stubs. Typically it is only the size of a 'return address' since the XMK stub calls the applications ISR.
_XMK_ISR_SWITCH_GETNEXT - This is the amount of stack, in bytes, required by XMK's function: Xmk_getNext(). Xmk_getNext() returns the thread handle of the new thread when a context is performed. Typically this is only the size of a 'return address' since the function has no functions args, no local variables, and has minimal code (i.e. all the work can be done using the volatile hardware registers - this is all up to the compiler though).
_XMK_ISR_KERNEL_WAKEUP - This the amount of stack, in bytes, required by XMK's function: Xmk_requestContextSwitch(). This method is called internally when an ISR 'wakes-up' a thread. Typically this is only the size of a 'return address' since the function has no functions args, no local variables, and has minimal code (i.e. all the work can be done using the volatile hardware registers - this is all up to the compiler though).
_XMK_GP_STACK - This is the size, in bytes, of the non-volatile hardware registers.