Fixed bug 3495487.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4004 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
gdisirio 2012-02-29 16:57:56 +00:00
parent d1df00f6a8
commit 08d544d2f4
2 changed files with 12 additions and 1 deletions

View File

@ -98,6 +98,12 @@ struct context {
#define APUSH(p, a) (p) -= sizeof(void *), *(void **)(p) = (void*)(a)
/* Darwin requires the stack to be aligned to a 16-byte boundary at
* the time of a call instruction (in case the called function needs
* to save MMX registers). This aligns to 'mod' module 16, so that we'll end
* up with the right alignment after pushing the args. */
#define AALIGN(p, mask, mod) p = (void *)((((uintptr_t)(p) - mod) & ~mask) + mod)
/**
* Platform dependent part of the @p chThdCreateI() API.
* This code usually setup the context switching frame represented by a
@ -105,6 +111,9 @@ struct context {
*/
#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \
uint8_t *esp = (uint8_t *)workspace + wsize; \
APUSH(esp, 0); \
uint8_t *savebp = esp; \
AALIGN(esp, 15, 8); \
APUSH(esp, arg); \
APUSH(esp, pf); \
APUSH(esp, 0); \
@ -113,7 +122,7 @@ struct context {
((struct intctx *)esp)->ebx = 0; \
((struct intctx *)esp)->edi = 0; \
((struct intctx *)esp)->esi = 0; \
((struct intctx *)esp)->ebp = 0; \
((struct intctx *)esp)->ebp = savebp; \
tp->p_ctx.esp = (struct intctx *)esp; \
}

View File

@ -79,6 +79,8 @@
*****************************************************************************
*** 2.5.0 ***
- FIX: Fixed stack misalignment on Posix-MacOSX (bug 3495487)(backported
in 2.2.9 and 2.4.1).
- FIX: Fixed STM8S HSI clock initialization error (bug 3489727)(backported to
2.2.9 and 2.4.1).
- FIX: Fixed MMC over SPI driver performs an unnecessary SPI read (bug