parent
d5221e7efa
commit
f0db26604f
3 changed files with 22 additions and 14 deletions
|
@ -82,13 +82,14 @@
|
|||
unsigned cpu_sr;
|
||||
char level1_int_disabled;
|
||||
|
||||
/* Supervisor stack pointer entry. This is the "high water mark" of how far the
|
||||
supervisor stack grew down before task started.
|
||||
/* Supervisor stack pointer entry. This is the "high water mark" of
|
||||
how far the supervisor stack grew down before task started. Is zero
|
||||
before the scheduler starts.
|
||||
|
||||
After tasks start, task stacks are all allocated from the heap and
|
||||
FreeRTOS checks for stack overflow.
|
||||
After the scheduler starts, task stacks are all allocated from the
|
||||
heap and FreeRTOS checks for stack overflow.
|
||||
*/
|
||||
uint32_t xPortSupervisorStackPointer;
|
||||
void *xPortSupervisorStackPointer;
|
||||
|
||||
/*
|
||||
* Stack initialization
|
||||
|
@ -219,7 +220,7 @@ size_t xPortGetFreeHeapSize( void )
|
|||
struct mallinfo mi = mallinfo();
|
||||
uint32_t brk_val = (uint32_t) sbrk(0);
|
||||
|
||||
uint32_t sp = xPortSupervisorStackPointer;
|
||||
intptr_t sp = (intptr_t)xPortSupervisorStackPointer;
|
||||
if(sp == 0) /* scheduler not started */
|
||||
SP(sp);
|
||||
return sp - brk_val + mi.fordblks;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue