File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include < zephyr/kernel.h>
2
+ #include < zephyr/sys/printk.h>
3
+
4
+ void et_pal_init (void ) {}
5
+
6
+ ET_NORETURN void et_pal_abort (void ) {
7
+ _exit (-1 );
8
+ }
9
+
10
+ et_timestamp_t et_pal_current_ticks (void ) {
11
+ return k_uptime_ticks ();
12
+ }
13
+
14
+ et_tick_ratio_t et_pal_ticks_to_ns_multiplier (void ) {
15
+ // Since we don't know the CPU freq for your target and just cycles in the
16
+ // FVP for et_pal_current_ticks() we return a conversion ratio of 1
17
+ return {1 , 1 };
18
+ }
19
+
20
+ /* *
21
+ * Emit a log message via platform output (serial port, console, etc).
22
+ */
23
+ void et_pal_emit_log_message (
24
+ ET_UNUSED et_timestamp_t timestamp,
25
+ et_pal_log_level_t level,
26
+ const char * filename,
27
+ ET_UNUSED const char * function,
28
+ size_t line,
29
+ const char * message,
30
+ ET_UNUSED size_t length) {
31
+ fprintf (
32
+ stderr,
33
+ " %c [executorch:%s:%zu %s()] %s\n " ,
34
+ level,
35
+ filename,
36
+ line,
37
+ function,
38
+ message);
39
+ }
40
+
41
+ void * et_pal_allocate (size_t size) {
42
+ return k_malloc (size);
43
+ }
44
+
45
+ void et_pal_free (ET_UNUSED void * ptr) {
46
+ k_free (ptr);
47
+ }
You can’t perform that action at this time.
0 commit comments