正在显示
1 个修改的文件
包含
7 行增加
和
0 行删除
@@ -546,6 +546,13 @@ _st_thread_t *st_thread_create(void *(*start)(void *arg), void *arg, int joinabl | @@ -546,6 +546,13 @@ _st_thread_t *st_thread_create(void *(*start)(void *arg), void *arg, int joinabl | ||
546 | /* Allocate thread object and per-thread data off the stack */ | 546 | /* Allocate thread object and per-thread data off the stack */ |
547 | #if defined (MD_STACK_GROWS_DOWN) | 547 | #if defined (MD_STACK_GROWS_DOWN) |
548 | sp = stack->stk_top; | 548 | sp = stack->stk_top; |
549 | + /* | ||
550 | + * The stack segment is split in the middle. The upper half is used | ||
551 | + * as backing store for the register stack which grows upward. | ||
552 | + * The lower half is used for the traditional memory stack which | ||
553 | + * grows downward. Both stacks start in the middle and grow outward | ||
554 | + * from each other. | ||
555 | + */ | ||
549 | sp = sp - (ST_KEYS_MAX * sizeof(void *)); | 556 | sp = sp - (ST_KEYS_MAX * sizeof(void *)); |
550 | ptds = (void **) sp; | 557 | ptds = (void **) sp; |
551 | sp = sp - sizeof(_st_thread_t); | 558 | sp = sp - sizeof(_st_thread_t); |
-
请 注册 或 登录 后发表评论