Ken Van Hoeylandt 03a6285328
Add kernel memory functions & other memory-related changes (#590)
New Features

- Added policy-based memory allocation APIs with capability flags and optional alignment: `memory_alloc_with_policy`, `memory_realloc_with_policy`, `memory_calloc_with_policy`, and `memory_free`.
- Switched heap memory reporting to `memory_print_stats`.

Bug Fixes

- Improved allocation robustness with capability fallback behavior.
- Added overflow-safe handling for aligned zero-initialized allocations.
- Tightened const-correctness for generated device-tree device arrays.

Tests

- Added unit tests for default policy, alignment, zero-initialization, realloc preservation, freeing, and memory stats reporting.
2026-07-26 22:59:18 +02:00

22 lines
645 B
C

#pragma once
#include <tactility/dts.h>
#include <tactility/error.h>
#include <tactility/module.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Initialize the kernel with the provided modules from the device tree
* @param dts_modules List of modules from devicetree, null-terminated. Non-null parameter.
* @param dts_devices The list of generated devices from the devicetree. The array must be terminated with DTS_DEVICE_TERMINATOR. Non-null parameter.
* @return ERROR_NONE on success, otherwise an error code
*/
error_t kernel_init(struct Module* const dts_modules[], const struct DtsDevice dts_devices[]);
#ifdef __cplusplus
}
#endif