@@ -44,14 +44,16 @@ use crate::sync::atomic::{AtomicUsize, Ordering};
44
44
/// be properly registered in Zephyr as kernel objects. The object has the underlying Zephyr type
45
45
/// T, and the wrapper type W.
46
46
///
47
+ /// TODO: Can we avoid the public fields with a const new method?
48
+ ///
47
49
/// TODO: Handling const-defined alignment for these.
48
50
pub struct StaticKernelObject < T > {
49
51
#[ allow( dead_code) ]
50
52
/// The underlying zephyr kernel object.
51
- pub ( crate ) value : UnsafeCell < T > ,
53
+ pub value : UnsafeCell < T > ,
52
54
/// Initialization status of this object. Most objects will start uninitialized and be
53
55
/// initialized manually.
54
- pub ( crate ) init : AtomicUsize ,
56
+ pub init : AtomicUsize ,
55
57
}
56
58
57
59
/// Each can be wrapped appropriately. The wrapped type is the instance that holds the raw pointer.
@@ -205,20 +207,20 @@ macro_rules! _kobj_rule {
205
207
#[ macro_export]
206
208
macro_rules! _kobj_stack {
207
209
( $v: vis, $name: ident, $size: expr) => {
208
- :: paste :: paste! {
210
+ $crate :: paste! {
209
211
// The actual stack itself goes into the no-init linker section. We'll use the user_name,
210
212
// with _REAL appended, to indicate the real stack.
211
213
#[ link_section = concat!( ".noinit." , stringify!( $name) , "." , file!( ) , line!( ) ) ]
212
- $v static [ < $name _REAL >] $crate:: sys:: thread:: RealThreadStack <{ $crate:: sys:: thread:: stack_len( $size) } > =
214
+ $v static [ < $name _REAL >] : $crate:: sys:: thread:: RealStaticThreadStack <{ $crate:: sys:: thread:: stack_len( $size) } > =
213
215
unsafe { :: core:: mem:: zeroed( ) } ;
214
216
215
217
// The proxy object used to ensure initialization is placed in initialized memory.
216
- $v static $name: $crate:: object:: StaticKernelObject <$crate:: object :: StaticThreadStack > = StaticKernelObject {
217
- value: :: core:: cell:: UnsafeCell :: new( $crate:: object :: StaticThreadStack {
218
+ $v static $name: $crate:: object:: StaticKernelObject <$crate:: sys :: thread :: StaticThreadStack > = $crate :: object :: StaticKernelObject {
219
+ value: :: core:: cell:: UnsafeCell :: new( $crate:: sys :: thread :: StaticThreadStack {
218
220
base: [ < $name _REAL >] . data. get( ) as * mut $crate:: raw:: z_thread_stack_element,
219
221
size: $size,
220
222
} ) ,
221
- init: $crate:: atomic:: AtomicUsize :: new( 0 ) ,
223
+ init: $crate:: sync :: atomic:: AtomicUsize :: new( 0 ) ,
222
224
} ;
223
225
}
224
226
} ;
0 commit comments