|
7 | 7 | #define _PLATFORM_INTERNAL_H
|
8 | 8 |
|
9 | 9 | #include <autoconf.h>
|
| 10 | +#include <version.h> |
| 11 | + |
| 12 | +#if KERNEL_VERSION_NUMBER < 0x030200 /* version 3.2.0 */ |
10 | 13 | #include <zephyr.h>
|
11 | 14 | #include <kernel.h>
|
12 |
| -#include <version.h> |
13 | 15 | #if KERNEL_VERSION_NUMBER >= 0x020200 /* version 2.2.0 */
|
14 | 16 | #include <sys/printk.h>
|
15 | 17 | #else
|
16 | 18 | #include <misc/printk.h>
|
17 | 19 | #endif
|
| 20 | +#else /* else of KERNEL_VERSION_NUMBER < 0x030200 */ |
| 21 | +#include <zephyr/kernel.h> |
| 22 | +#include <zephyr/sys/printk.h> |
| 23 | +#endif /* end of KERNEL_VERSION_NUMBER < 0x030200 */ |
| 24 | + |
18 | 25 | #include <inttypes.h>
|
19 | 26 | #include <stdarg.h>
|
20 | 27 | #include <ctype.h>
|
|
24 | 31 | #include <stdlib.h>
|
25 | 32 | #include <string.h>
|
26 | 33 | #include <strings.h>
|
| 34 | + |
27 | 35 | #ifndef CONFIG_NET_BUF_USER_DATA_SIZE
|
28 | 36 | #define CONFIG_NET_BUF_USER_DATA_SIZE 0
|
29 | 37 | #endif
|
| 38 | + |
| 39 | +#if KERNEL_VERSION_NUMBER < 0x030200 /* version 3.2.0 */ |
30 | 40 | #include <net/net_pkt.h>
|
31 | 41 | #include <net/net_if.h>
|
32 | 42 | #include <net/net_ip.h>
|
|
36 | 46 | #ifdef CONFIG_ARM_MPU
|
37 | 47 | #include <arch/arm/aarch32/cortex_m/cmsis.h>
|
38 | 48 | #endif
|
| 49 | +#else /* else of KERNEL_VERSION_NUMBER < 0x030200 */ |
| 50 | +#include <zephyr/net/net_pkt.h> |
| 51 | +#include <zephyr/net/net_if.h> |
| 52 | +#include <zephyr/net/net_ip.h> |
| 53 | +#include <zephyr/net/net_core.h> |
| 54 | +#include <zephyr/net/net_context.h> |
| 55 | + |
| 56 | +#ifdef CONFIG_ARM_MPU |
| 57 | +#include <zephyr/arch/arm/aarch32/cortex_m/cmsis.h> |
| 58 | +#endif |
| 59 | +#endif /* end of KERNEL_VERSION_NUMBER < 0x030200 */ |
39 | 60 |
|
40 | 61 | #ifndef BH_PLATFORM_ZEPHYR
|
41 | 62 | #define BH_PLATFORM_ZEPHYR
|
@@ -96,6 +117,11 @@ double strtod(const char *nptr, char **endptr);
|
96 | 117 | float strtof(const char *nptr, char **endptr);
|
97 | 118 | /* clang-format on */
|
98 | 119 |
|
| 120 | +#if KERNEL_VERSION_NUMBER >= 0x030100 /* version 3.1.0 */ |
| 121 | +#define BH_HAS_SQRT |
| 122 | +#define BH_HAS_SQRTF |
| 123 | +#endif |
| 124 | + |
99 | 125 | /**
|
100 | 126 | * @brief Allocate executable memroy
|
101 | 127 | *
|
|
0 commit comments