1 /* 2 * Copyright (c) 2024 Intel Corporation. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <stdint.h> 8 #include <zephyr/llext/symbol.h> 9 #include <zephyr/sys/printk.h> 10 #include <zephyr/ztest_assert.h> 11 detached_entry(void)12__section(".detach") void detached_entry(void) 13 { 14 static int data_cnt = -3; 15 static unsigned int bss_cnt; 16 17 printk("bss %u @ %p\n", bss_cnt++, &bss_cnt); 18 printk("data %d @ %p\n", data_cnt++, &data_cnt); 19 zassert_true(data_cnt < 0); 20 zassert_true(bss_cnt < 3); 21 } 22 EXPORT_SYMBOL(detached_entry); 23 test_entry(void)24void test_entry(void) 25 { 26 detached_entry(); 27 } 28 EXPORT_SYMBOL(test_entry); 29