mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 21:41:59 -04:00
* Add XMOS XCore ports Some minor modifications are also made to the kernel to support the XCore compiler's automatic stack size calculation. * Update kernel to support SMP The XMOS XCore ports are also updated to support SMP. * Fix compiler warnings in xcore ports The port set and clear interrupt mask from ISR macros were removed from the ports so that the default macros found in FreeRTOS.h are used instead. The default macros do not result in warnings when they are used. * Remove inline function from timers.h Inline function converted to macro. This should now build when optimizations are off and inlining is disabled. * Fix compiler warnings in xcore ports and tasks.c * fixed documentation for ulTaskNotifyTake() and ulTaskNotifyTakeIndexed() * spelling fixes for tasks.c Co-authored-by: Michael Bruno <mikeb@xmos.com>
29 lines
1.1 KiB
C
29 lines
1.1 KiB
C
/* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU */
|
|
/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */
|
|
/* ELIGIBILITY FOR ANY PURPOSES. */
|
|
/* (C) Fujitsu Microelectronics Europe GmbH */
|
|
/*---------------------------------------------------------------------------
|
|
__STD_LIB_sbrk.C
|
|
- Used by heap_3.c for memory accocation and deletion.
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
#include "FreeRTOSConfig.h"
|
|
#include <stdlib.h>
|
|
|
|
static long brk_siz = 0;
|
|
typedef int _heep_t;
|
|
#define ROUNDUP(s) (((s)+sizeof(_heep_t)-1)&~(sizeof(_heep_t)-1))
|
|
static _heep_t _heep[ROUNDUP(configTOTAL_HEAP_SIZE)/sizeof(_heep_t)];
|
|
#define _heep_size ROUNDUP(configTOTAL_HEAP_SIZE)
|
|
|
|
extern char *sbrk(int size)
|
|
{
|
|
if (brk_siz + size > _heep_size || brk_siz + size < 0)
|
|
|
|
return((char*)-1);
|
|
brk_siz += size;
|
|
return( (char*)_heep + brk_siz - size);
|
|
}
|
|
|