You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by st...@apache.org on 2016/02/04 02:18:32 UTC
incubator-mynewt-larva git commit: fix stackusage variable
Repository: incubator-mynewt-larva
Updated Branches:
refs/heads/master 17c1bff6d -> d66cc974e
fix stackusage variable
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/d66cc974
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/d66cc974
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/d66cc974
Branch: refs/heads/master
Commit: d66cc974eb8268c997fb9dd85ae82d923481044f
Parents: 17c1bff
Author: Sterling Hughes <st...@apache.org>
Authored: Wed Feb 3 17:18:03 2016 -0800
Committer: Sterling Hughes <st...@apache.org>
Committed: Wed Feb 3 17:18:20 2016 -0800
----------------------------------------------------------------------
libs/os/src/os_task.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/d66cc974/libs/os/src/os_task.c
----------------------------------------------------------------------
diff --git a/libs/os/src/os_task.c b/libs/os/src/os_task.c
index e13f24f..87535f6 100644
--- a/libs/os/src/os_task.c
+++ b/libs/os/src/os_task.c
@@ -112,7 +112,7 @@ os_task_init(struct os_task *t, char *name, os_task_func_t func, void *arg,
_clear_stack(stack_bottom, stack_size);
t->t_stackptr = os_arch_task_stack_init(t, &stack_bottom[stack_size],
stack_size);
- t->t_stackbase = stack_bottom;
+ t->t_stackbase = &stack_bottom[stack_size];
t->t_stacksize = stack_size;
/* insert this task into the task list */
@@ -153,7 +153,7 @@ os_task_info_get_next(const struct os_task *prev, struct os_task_info *oti)
oti->oti_prio = next->t_prio;
oti->oti_taskid = next->t_taskid;
oti->oti_state = next->t_state;
- oti->oti_stkusage = (uint16_t) (next->t_stackptr - next->t_stackbase);
+ oti->oti_stkusage = (uint16_t) (next->t_stackbase - next->t_stackptr);
oti->oti_stksize = next->t_stacksize;
oti->oti_cswcnt = next->t_ctx_sw_cnt;
oti->oti_runtime = next->t_run_time;