File tree Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ ExternalProject_Add(
73
73
env
74
74
"ZEPHYR_BINDGEN=${zephyr_bindgen} "
75
75
"CONFIG_USERSPACE=${CONFIG_USERSPACE} "
76
+ "CONFIG_RUST_ALLOC_POOL=${CONFIG_RUST_ALLOC_POOL} "
76
77
"TARGET_CFLAGS=${external_project_cflags} --target=${clang_target} "
77
78
"SYSROOT=${rust_sysroot} "
78
79
"SYSROOT_BUILD=${rust_sysroot_build} "
Original file line number Diff line number Diff line change @@ -2,4 +2,7 @@ fn main() {
2
2
if std:: env:: var ( "CONFIG_USERSPACE" ) . expect ( "CONFIG_USERSPACE must be set" ) == "y" {
3
3
println ! ( "cargo:rustc-cfg=usermode" ) ;
4
4
}
5
+ if std:: env:: var ( "CONFIG_RUST_ALLOC_POOL" ) . expect ( "CONFIG_RUST_ALLOC_POOL must be set" ) == "y" {
6
+ println ! ( "cargo:rustc-cfg=mempool" ) ;
7
+ }
5
8
}
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ pub use time::*;
17
17
// Set from environment from build.rs
18
18
pub const CONFIG_USERSPACE : bool = cfg ! ( usermode) ;
19
19
20
+ // Use this mem pool for global allocs instead of kmalloc
21
+ #[ cfg( mempool) ]
22
+ crate :: global_sys_mem_pool!( rust_std_mem_pool) ;
23
+
20
24
/// Convert a negative error code to a Result
21
25
pub trait NegErr {
22
26
fn neg_err ( & self ) -> Result < u32 , u32 > ;
Original file line number Diff line number Diff line change @@ -18,9 +18,6 @@ use zephyr::mutex::*;
18
18
use zephyr:: semaphore:: * ;
19
19
use zephyr:: thread:: ThreadSyscalls ;
20
20
21
- // Use this mem pool for global allocs instead of kmalloc
22
- zephyr:: global_sys_mem_pool!( rust_std_mem_pool) ;
23
-
24
21
thread_local ! ( static TLS : RefCell <u8 > = RefCell :: new( 1 ) ) ;
25
22
26
23
zephyr_macros:: k_mutex_define!( MUTEX ) ;
You can’t perform that action at this time.
0 commit comments