aboutsummaryrefslogtreecommitdiff
path: root/projects/hsm/hsm.c
diff options
context:
space:
mode:
Diffstat (limited to 'projects/hsm/hsm.c')
-rw-r--r--projects/hsm/hsm.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/projects/hsm/hsm.c b/projects/hsm/hsm.c
index 29509e8..52157c9 100644
--- a/projects/hsm/hsm.c
+++ b/projects/hsm/hsm.c
@@ -86,9 +86,8 @@ static uint8_t busy_stack[BUSY_STACK_SIZE];
* 4096-byte block of an FPGA or bootloader image upload.
*/
#ifndef CLI_STACK_SIZE
-#define CLI_STACK_SIZE 8*1024
+#define CLI_STACK_SIZE 16*1024
#endif
-static uint8_t cli_stack[CLI_STACK_SIZE];
/* RPC buffers. For each active request, there will be two - input and output.
*/
@@ -342,7 +341,6 @@ static void busy_task(void)
}
#include "stm-fpgacfg.h"
-#include "hashsig.h"
static void hashsig_restart_task(void)
{
@@ -396,6 +394,17 @@ static hal_error_t sdram_free(uint8_t *ptr)
return HAL_ERROR_FORBIDDEN;
}
+hal_error_t sdram_stats(size_t *used, size_t *available)
+{
+ if (used == NULL || available == NULL)
+ return HAL_ERROR_BAD_ARGUMENTS;
+
+ *used = sdram_heap - &_esdram1;
+ *available = &__end_sdram1 - sdram_heap;
+
+ return LIBHAL_OK;
+}
+
/* Implement static memory allocation for libhal over sdram_malloc().
*/
void *hal_allocate_static_memory(const size_t size)
@@ -501,7 +510,8 @@ int main(void)
*/
/* Create the CLI task. */
- if (task_add("cli", (funcp_t)cli_main, NULL, cli_stack, sizeof(cli_stack)) == NULL)
+ void *cli_stack = (void *)sdram_malloc(CLI_STACK_SIZE);
+ if (task_add("cli", (funcp_t)cli_main, NULL, cli_stack, CLI_STACK_SIZE) == NULL)
Error_Handler();
/* Start the tasker */