diff options
author | andrew <andrew@FreeBSD.org> | 2014-01-24 20:51:56 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2014-01-24 20:51:56 +0000 |
commit | 2370ce3666870459363d2f7a5f7b0fe975502173 (patch) | |
tree | 51b5e15695473fd65ef63b0c0404359379eb1735 /sys/arm/include/asmacros.h | |
parent | 145b8688cb8e51c396ea136976a95fb8250aafba (diff) | |
download | FreeBSD-src-2370ce3666870459363d2f7a5f7b0fe975502173.zip FreeBSD-src-2370ce3666870459363d2f7a5f7b0fe975502173.tar.gz |
Correct the alignment of sp through functions that use UNWINDSVCFRAME. We
were incorrectly adding the trap frame padding to the stack pointer after
reading it's value and unaligning it.
Diffstat (limited to 'sys/arm/include/asmacros.h')
-rw-r--r-- | sys/arm/include/asmacros.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arm/include/asmacros.h b/sys/arm/include/asmacros.h index 0c107a4..f8d5b3e 100644 --- a/sys/arm/include/asmacros.h +++ b/sys/arm/include/asmacros.h @@ -216,8 +216,13 @@ ldmia sp, {sp, lr, pc}^ /* Restore lr and exit */ #endif #if defined(__ARM_EABI__) +/* + * Unwind hints so we can unwind past functions that use + * PULLFRAMEFROMSVCANDEXIT. They are run in reverse order. + * As the last thing we do is restore the stack pointer + * we can ignore the padding at the end of struct trapframe. + */ #define UNWINDSVCFRAME \ - .pad #(4); /* Skip stack alignment */ \ .save {r13-r15}; /* Restore sp, lr, pc */ \ .pad #(2*4); /* Skip user sp and lr */ \ .save {r0-r12}; /* Restore r0-r12 */ \ |