mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-07-04 16:13:33 +08:00
feat(system): Provide more heap region (16KB+)
1. Change cache size from 32KB to 16KB, reverse this 16KB region as heap; 2. New heap to support seperate heap region; 3. Modify pvPortMalloc, support to choose malloc in iram; 4. Add new macro os_malloc_iram to malloc in iram; 5. Default malloc will malloc in iram firstly; Limitation: 1. Don't malloc task stack in iram; 2. Dont't use iram buffer as wifi tx buffer; If possible, use all of iram heap region firstly. internal : 2d3fbebb
This commit is contained in:
22
VERSION
22
VERSION
@ -1,14 +1,20 @@
|
|||||||
gwen:
|
gwen:
|
||||||
espnow: 1aafc07
|
crypto: a8c4880
|
||||||
main: caff253
|
espnow: a8c4880
|
||||||
mesh: 1aafc07
|
main: a8c4880
|
||||||
net80211: caff253
|
mesh: a8c4880
|
||||||
pp: caff253
|
minic: a8c4880
|
||||||
wpa: caff253
|
net80211: a8c4880
|
||||||
wps: 1aafc07
|
pp: a8c4880
|
||||||
|
pwm: a8c4880
|
||||||
|
smartconfig:a8c4880
|
||||||
|
wpa: a8c4880
|
||||||
|
wps: a8c4880
|
||||||
|
|
||||||
gitlab:
|
gitlab:
|
||||||
espconn: 3a998034
|
espconn: 3a998034
|
||||||
lwip: 2235ad17
|
freertos: ac047746
|
||||||
|
lwip: ac047746
|
||||||
driver: 7bee5263
|
driver: 7bee5263
|
||||||
mbedtls: 1ac9f1f4
|
mbedtls: 1ac9f1f4
|
||||||
|
ssl: eefb383a
|
@ -126,7 +126,15 @@ do{\
|
|||||||
#define os_malloc(s) \
|
#define os_malloc(s) \
|
||||||
({ \
|
({ \
|
||||||
static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \
|
static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \
|
||||||
pvPortMalloc(s, mem_debug_file, __LINE__); \
|
pvPortMalloc(s, mem_debug_file, __LINE__, false); \
|
||||||
|
})
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef os_malloc_iram
|
||||||
|
#define os_malloc_iram(s) \
|
||||||
|
({ \
|
||||||
|
static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \
|
||||||
|
pvPortMalloc(s, mem_debug_file, __LINE__, true); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ extern "C" {
|
|||||||
void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
|
void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
|
||||||
void vPortFree( void *pv ) PRIVILEGED_FUNCTION;
|
void vPortFree( void *pv ) PRIVILEGED_FUNCTION;
|
||||||
#else
|
#else
|
||||||
void *pvPortMalloc( size_t xSize, const char *file, unsigned line) PRIVILEGED_FUNCTION;
|
void *pvPortMalloc( size_t xSize, const char *file, unsigned line, bool use_iram) PRIVILEGED_FUNCTION;
|
||||||
void vPortFree( void *pv, const char * file, unsigned line) PRIVILEGED_FUNCTION;
|
void vPortFree( void *pv, const char * file, unsigned line) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ typedef size_t mem_size_t;
|
|||||||
}while(0)
|
}while(0)
|
||||||
#endif
|
#endif
|
||||||
#ifndef mem_malloc
|
#ifndef mem_malloc
|
||||||
#define mem_malloc(s) ({const char *file = mem_debug_file; pvPortMalloc(s, file, __LINE__);})
|
#define mem_malloc(s) ({const char *file = mem_debug_file; pvPortMalloc(s, file, __LINE__, false);})
|
||||||
#endif
|
#endif
|
||||||
#ifndef mem_calloc
|
#ifndef mem_calloc
|
||||||
#define mem_calloc(s) ({const char *file = mem_debug_file; pvPortCalloc(s, file, __LINE__);})
|
#define mem_calloc(s) ({const char *file = mem_debug_file; pvPortCalloc(s, file, __LINE__);})
|
||||||
|
@ -25,14 +25,14 @@
|
|||||||
|
|
||||||
#ifdef MEMLEAK_DEBUG
|
#ifdef MEMLEAK_DEBUG
|
||||||
|
|
||||||
extern void *pvPortMalloc( size_t xWantedSize, const char * file, unsigned line);
|
extern void *pvPortMalloc( size_t xWantedSize, const char * file, unsigned line, bool use_iram);
|
||||||
extern void *pvPortZalloc( size_t xWantedSize, const char * file, unsigned line);
|
extern void *pvPortZalloc( size_t xWantedSize, const char * file, unsigned line);
|
||||||
extern void vPortFree(void *pv, const char * file, unsigned line);
|
extern void vPortFree(void *pv, const char * file, unsigned line);
|
||||||
|
|
||||||
#define ssl_mem_malloc(s) \
|
#define ssl_mem_malloc(s) \
|
||||||
({ \
|
({ \
|
||||||
static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \
|
static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \
|
||||||
pvPortMalloc(s, mem_debug_file, __LINE__); \
|
pvPortMalloc(s, mem_debug_file, __LINE__, false); \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define ssl_mem_zalloc(s) \
|
#define ssl_mem_zalloc(s) \
|
||||||
|
@ -94,6 +94,7 @@ SECTIONS
|
|||||||
*(.init.literal)
|
*(.init.literal)
|
||||||
*(.init)
|
*(.init)
|
||||||
*libfreertos.a:(.literal .text .literal.* .text.*)
|
*libfreertos.a:(.literal .text .literal.* .text.*)
|
||||||
|
*libmain.a:spi_flash.o(.literal .text .literal.* .text.*)
|
||||||
*(.literal .text .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
*(.literal .text .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
||||||
*(.fini.literal)
|
*(.fini.literal)
|
||||||
*(.fini)
|
*(.fini)
|
||||||
|
BIN
lib/libcrypto.a
BIN
lib/libcrypto.a
Binary file not shown.
BIN
lib/libespnow.a
BIN
lib/libespnow.a
Binary file not shown.
Binary file not shown.
BIN
lib/liblwip.a
BIN
lib/liblwip.a
Binary file not shown.
BIN
lib/libmain.a
BIN
lib/libmain.a
Binary file not shown.
BIN
lib/libmesh.a
BIN
lib/libmesh.a
Binary file not shown.
BIN
lib/libminic.a
BIN
lib/libminic.a
Binary file not shown.
Binary file not shown.
BIN
lib/libpp.a
BIN
lib/libpp.a
Binary file not shown.
BIN
lib/libpwm.a
BIN
lib/libpwm.a
Binary file not shown.
Binary file not shown.
BIN
lib/libssl.a
BIN
lib/libssl.a
Binary file not shown.
BIN
lib/libwpa.a
BIN
lib/libwpa.a
Binary file not shown.
BIN
lib/libwps.a
BIN
lib/libwps.a
Binary file not shown.
File diff suppressed because it is too large
Load Diff
6
third_party/freertos/queue.c
vendored
6
third_party/freertos/queue.c
vendored
@ -299,14 +299,14 @@ xQueueHandle xReturn = NULL;
|
|||||||
/* Allocate the new queue structure. */
|
/* Allocate the new queue structure. */
|
||||||
if( uxQueueLength > ( unsigned portBASE_TYPE ) 0 )
|
if( uxQueueLength > ( unsigned portBASE_TYPE ) 0 )
|
||||||
{
|
{
|
||||||
pxNewQueue = ( xQUEUE * ) os_malloc( sizeof( xQUEUE ) );
|
pxNewQueue = ( xQUEUE * ) os_malloc_iram( sizeof( xQUEUE ) );
|
||||||
if( pxNewQueue != NULL )
|
if( pxNewQueue != NULL )
|
||||||
{
|
{
|
||||||
/* Create the list of pointers to queue items. The queue is one byte
|
/* Create the list of pointers to queue items. The queue is one byte
|
||||||
longer than asked for to make wrap checking easier/faster. */
|
longer than asked for to make wrap checking easier/faster. */
|
||||||
xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ) + ( size_t ) 1; /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ) + ( size_t ) 1; /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
||||||
|
|
||||||
pxNewQueue->pcHead = ( signed char * ) os_malloc( xQueueSizeInBytes );
|
pxNewQueue->pcHead = ( signed char * ) os_malloc_iram( xQueueSizeInBytes );
|
||||||
if( pxNewQueue->pcHead != NULL )
|
if( pxNewQueue->pcHead != NULL )
|
||||||
{
|
{
|
||||||
/* Initialise the queue members as described above where the
|
/* Initialise the queue members as described above where the
|
||||||
@ -356,7 +356,7 @@ xQueueHandle xReturn = NULL;
|
|||||||
( void ) ucQueueType;
|
( void ) ucQueueType;
|
||||||
|
|
||||||
/* Allocate the new queue structure. */
|
/* Allocate the new queue structure. */
|
||||||
pxNewQueue = ( xQUEUE * ) os_malloc( sizeof( xQUEUE ) );
|
pxNewQueue = ( xQUEUE * ) os_malloc_iram( sizeof( xQUEUE ) );
|
||||||
if( pxNewQueue != NULL )
|
if( pxNewQueue != NULL )
|
||||||
{
|
{
|
||||||
/* Information required for priority inheritance. */
|
/* Information required for priority inheritance. */
|
||||||
|
2
third_party/freertos/tasks.c
vendored
2
third_party/freertos/tasks.c
vendored
@ -2486,7 +2486,7 @@ tskTCB *pxNewTCB;
|
|||||||
|
|
||||||
/* Allocate space for the TCB. Where the memory comes from depends on
|
/* Allocate space for the TCB. Where the memory comes from depends on
|
||||||
the implementation of the port malloc function. */
|
the implementation of the port malloc function. */
|
||||||
pxNewTCB = ( tskTCB * ) os_malloc( sizeof( tskTCB ) );
|
pxNewTCB = ( tskTCB * ) os_malloc_iram( sizeof( tskTCB ) );
|
||||||
|
|
||||||
if( pxNewTCB != NULL )
|
if( pxNewTCB != NULL )
|
||||||
{
|
{
|
||||||
|
2
third_party/mbedtls/library/ecp.c
vendored
2
third_party/mbedtls/library/ecp.c
vendored
@ -1406,7 +1406,7 @@ static int ecp_mul_comb( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|
||||||
if( T != NULL && ! p_eq_g )
|
if( T != NULL && T != grp->T )
|
||||||
{
|
{
|
||||||
for( i = 0; i < pre_len; i++ )
|
for( i = 0; i < pre_len; i++ )
|
||||||
mbedtls_ecp_point_free( &T[i] );
|
mbedtls_ecp_point_free( &T[i] );
|
||||||
|
Reference in New Issue
Block a user