Skip to content

Commit ec9b0c0

Browse files
authored
Arm Zephyr PAL is now functional (#12759)
### Summary Previously the PAL file was uploaded as a placeholder for Zephyr apps to use. However, building `arm_zephyr.o` object was unsuccessful. The PAL has been updated and can now be used and linked to zephyr executorch applications. ### Test plan Tested on a simple add model arm executor runner, see [here](https://github.com/BujSet/zephyr/blob/5801a783883f3cf9bb172213d891c0de596c3dcf/samples/modules/executorch/arm-fvp-tutorials/models/CMakeLists.txt#L61) for a concrete example. CI tests are WIP, see [here](#12734).
1 parent 8eb8cd1 commit ec9b0c0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

runtime/platform/default/arm_zephyr.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
#include <executorch/runtime/platform/compiler.h>
2+
#include <executorch/runtime/platform/platform.h>
13
#include <zephyr/kernel.h>
24
#include <zephyr/sys/printk.h>
5+
#include <cstdio>
6+
#include <cstdlib>
37

48
void et_pal_init(void) {}
59

610
ET_NORETURN void et_pal_abort(void) {
7-
_exit(-1);
11+
_Exit(-1);
812
}
913

1014
et_timestamp_t et_pal_current_ticks(void) {
@@ -21,13 +25,13 @@ et_tick_ratio_t et_pal_ticks_to_ns_multiplier(void) {
2125
* Emit a log message via platform output (serial port, console, etc).
2226
*/
2327
void et_pal_emit_log_message(
24-
ET_UNUSED et_timestamp_t timestamp,
28+
et_timestamp_t timestamp,
2529
et_pal_log_level_t level,
2630
const char* filename,
27-
ET_UNUSED const char* function,
31+
const char* function,
2832
size_t line,
2933
const char* message,
30-
ET_UNUSED size_t length) {
34+
size_t length) {
3135
fprintf(
3236
stderr,
3337
"%c [executorch:%s:%zu %s()] %s\n",
@@ -42,6 +46,6 @@ void* et_pal_allocate(size_t size) {
4246
return k_malloc(size);
4347
}
4448

45-
void et_pal_free(ET_UNUSED void* ptr) {
49+
void et_pal_free(void* ptr) {
4650
k_free(ptr);
4751
}

0 commit comments

Comments
 (0)