esp-idf/components/esp_system/port/esp_system_linux.c
Marius Vikhammer 36cb08c379 heap: add linux target support
Add wrappers for public heap API for the linux target.
2022-12-06 10:49:59 +08:00

47 lines
1022 B
C

/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* All functions presented here are stubs for the POSIX/Linux implementation of FReeRTOS.
* They are meant to allow to compile, but they DO NOT return any meaningful value.
*/
#include <stdlib.h>
#include <stdint.h>
#include "esp_private/system_internal.h"
#include "esp_heap_caps.h"
// dummy, we should never get here on Linux
void esp_restart_noos_dig(void)
{
abort();
}
uint32_t esp_get_free_heap_size( void )
{
return heap_caps_get_free_size( MALLOC_CAP_DEFAULT );
}
uint32_t esp_get_free_internal_heap_size( void )
{
return heap_caps_get_free_size( MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL );
}
uint32_t esp_get_minimum_free_heap_size( void )
{
return heap_caps_get_minimum_free_size( MALLOC_CAP_DEFAULT );
}
const char *esp_get_idf_version(void)
{
return IDF_VER;
}
void __attribute__((noreturn)) esp_system_abort(const char *details)
{
exit(1);
}