Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions runtime/platform/default/arm_zephyr.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>

void et_pal_init(void) {}

ET_NORETURN void et_pal_abort(void) {
_exit(-1);
}

et_timestamp_t et_pal_current_ticks(void) {
return k_uptime_ticks();
}

et_tick_ratio_t et_pal_ticks_to_ns_multiplier(void) {
// Since we don't know the CPU freq for your target and just cycles in the
// FVP for et_pal_current_ticks() we return a conversion ratio of 1
return {1, 1};
}

/**
* Emit a log message via platform output (serial port, console, etc).
*/
void et_pal_emit_log_message(
ET_UNUSED et_timestamp_t timestamp,
et_pal_log_level_t level,
const char* filename,
ET_UNUSED const char* function,
size_t line,
const char* message,
ET_UNUSED size_t length) {
fprintf(
stderr,
"%c [executorch:%s:%zu %s()] %s\n",
level,
filename,
line,
function,
message);
}

void* et_pal_allocate(size_t size) {
return k_malloc(size);
}

void et_pal_free(ET_UNUSED void* ptr) {
k_free(ptr);
}
Loading