@@ -91,28 +91,6 @@ use crate::sync::atomic::{AtomicUsize, Ordering};
91
91
// the mutations happen from C code, so this is less important than the data being placed in the
92
92
// proper section. Many will have the link section overridden by the `kobj_define` macro.
93
93
94
- /// A kernel object represented statically in Rust code.
95
- ///
96
- /// These should not be declared directly by the user, as they generally need linker decorations to
97
- /// be properly registered in Zephyr as kernel objects. The object has the underlying Zephyr type
98
- /// T, and the wrapper type W.
99
- ///
100
- /// Kernel objects will have their `StaticThing` implemented as `StaticKernelObject<kobj>` where
101
- /// `kobj` is the type of the underlying Zephyr object. `Thing` will usually be a struct with a
102
- /// single field, which is a `*mut kobj`.
103
- ///
104
- /// TODO: Can we avoid the public fields with a const new method?
105
- ///
106
- /// TODO: Handling const-defined alignment for these.
107
- pub struct StaticKernelObject < T > {
108
- #[ allow( dead_code) ]
109
- /// The underlying zephyr kernel object.
110
- pub value : UnsafeCell < T > ,
111
- /// Initialization status of this object. Most objects will start uninitialized and be
112
- /// initialized manually.
113
- pub init : AtomicUsize ,
114
- }
115
-
116
94
/// Define the Wrapping of a kernel object.
117
95
///
118
96
/// This trait defines the association between a static kernel object and the two associated Rust
@@ -154,6 +132,28 @@ pub const KOBJ_INITING: usize = 1;
154
132
/// take has been called. And shouldn't be allowed additional times.
155
133
pub const KOBJ_INITIALIZED : usize = 2 ;
156
134
135
+ /// A kernel object represented statically in Rust code.
136
+ ///
137
+ /// These should not be declared directly by the user, as they generally need linker decorations to
138
+ /// be properly registered in Zephyr as kernel objects. The object has the underlying Zephyr type
139
+ /// T, and the wrapper type W.
140
+ ///
141
+ /// Kernel objects will have their `StaticThing` implemented as `StaticKernelObject<kobj>` where
142
+ /// `kobj` is the type of the underlying Zephyr object. `Thing` will usually be a struct with a
143
+ /// single field, which is a `*mut kobj`.
144
+ ///
145
+ /// TODO: Can we avoid the public fields with a const new method?
146
+ ///
147
+ /// TODO: Handling const-defined alignment for these.
148
+ pub struct StaticKernelObject < T > {
149
+ #[ allow( dead_code) ]
150
+ /// The underlying zephyr kernel object.
151
+ pub value : UnsafeCell < T > ,
152
+ /// Initialization status of this object. Most objects will start uninitialized and be
153
+ /// initialized manually.
154
+ pub init : AtomicUsize ,
155
+ }
156
+
157
157
impl < T > StaticKernelObject < T >
158
158
where
159
159
StaticKernelObject < T > : Wrapped ,
0 commit comments