/* * Note: These macros assume that variables being stored on the stack are * sizeof(long), while this is usually the case it may not always be the * case for each use case.
*/ #ifdef __powerpc64__
/* * Caveat: if a function passed more than 8 doublewords, the caller will have * made more space... which would render the 112 incorrect.
*/ #define __STACK_FRAME_LOCAL(_num_params, _var_num) \
(112 + ((_var_num)*8))
#endif// ABIv2
// Common 64-bit #define STACK_FRAME_LR_POS 16 #define STACK_FRAME_CR_POS 8
/* Parameter x saved to the stack */ #define STACK_FRAME_PARAM(var) __STACK_FRAME_PARAM(var)
/* Local variable x saved to the stack after x parameters */ #define STACK_FRAME_LOCAL(num_params, var) \
__STACK_FRAME_LOCAL(num_params, var)
/* * It is very important to note here that _extra is the extra amount of * stack space needed. This space can be accessed using STACK_FRAME_PARAM() * or STACK_FRAME_LOCAL() macros. * * r1 and r2 are not defined in ppc-asm.h (instead they are defined as sp * and toc). Kernel programmers tend to prefer rX even for r1 and r2, hence * %1 and %r2. r0 is defined in ppc-asm.h and therefore %r0 gets * preprocessed incorrectly, hence r0.
*/ #define PUSH_BASIC_STACK(_extra) \
mflr r0; \
PPC_STL r0, STACK_FRAME_LR_POS(%r1); \
PPC_STLU %r1, -(((_extra + 15) & ~15) + STACK_FRAME_MIN_SIZE)(%r1);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.