@@ -236,6 +236,40 @@ macro_rules! _kobj_rule {
236
236
unsafe { :: core:: mem:: zeroed( ) } ;
237
237
} ;
238
238
239
+ // static NAME: StaticMutex
240
+ ( $v: vis, $name: ident, StaticMutex ) => {
241
+ #[ link_section = concat!( "._k_mutex.static." , stringify!( $name) , "." , file!( ) , line!( ) ) ]
242
+ $v static $name: $crate:: sys:: sync:: StaticMutex =
243
+ $crate:: sys:: sync:: StaticMutex :: new( ) ;
244
+ } ;
245
+
246
+ // static NAMES: [StaticMutex; COUNT];
247
+ ( $v: vis, $name: ident, [ StaticMutex ; $size: expr] ) => {
248
+ #[ link_section = concat!( "._k_mutex.static." , stringify!( $name) , "." , file!( ) , line!( ) ) ]
249
+ $v static $name: [ $crate:: sys:: sync:: StaticMutex ; $size] =
250
+ // This isn't Copy, intentionally, so initialize the whole thing with zerored memory.
251
+ // Relying on the atomic to be 0 for the uninitialized state.
252
+ // [$crate::sys::sync::StaticMutex::new(); $size];
253
+ unsafe { :: core:: mem:: zeroed( ) } ;
254
+ } ;
255
+
256
+ // static NAME: StaticCondvar;
257
+ ( $v: vis, $name: ident, StaticCondvar ) => {
258
+ #[ link_section = concat!( "._k_condvar.static." , stringify!( $name) , "." , file!( ) , line!( ) ) ]
259
+ $v static $name: $crate:: sys:: sync:: StaticCondvar =
260
+ $crate:: sys:: sync:: StaticCondvar :: new( ) ;
261
+ } ;
262
+
263
+ // static NAMES: [StaticCondvar; COUNT];
264
+ ( $v: vis, $name: ident, [ StaticCondvar ; $size: expr] ) => {
265
+ #[ link_section = concat!( "._k_condvar.static." , stringify!( $name) , "." , file!( ) , line!( ) ) ]
266
+ $v static $name: [ $crate:: sys:: sync:: StaticCondvar ; $size] =
267
+ // This isn't Copy, intentionally, so initialize the whole thing with zerored memory.
268
+ // Relying on the atomic to be 0 for the uninitialized state.
269
+ // [$crate::sys::sync::StaticMutex::new(); $size];
270
+ unsafe { :: core:: mem:: zeroed( ) } ;
271
+ } ;
272
+
239
273
// static THREAD: staticThread;
240
274
( $v: vis, $name: ident, StaticThread ) => {
241
275
// Since the static object has an atomic that we assume is initialized, we cannot use the
0 commit comments