Skip to content

Commit fb93a15

Browse files
committed
zephyr: Create export type alias
Although the user is not intended to actually create these static thread stack objects, make an alias for the type in `_export` so that the macro is a little easier to read. This will become more important as this type picks up some constructors. Signed-off-by: David Brown <[email protected]>
1 parent f4d8e27 commit fb93a15

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

zephyr/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ pub mod raw {
7575
#[doc(hidden)]
7676
pub mod _export {
7777
pub use core::format_args;
78+
79+
use crate::{object::StaticKernelObject, sys::thread::StaticThreadStack};
80+
81+
/// Type alias for the thread stack kernel object.
82+
pub type KStaticThreadStack = StaticKernelObject<StaticThreadStack>;
7883
}
7984

8085
// Mark this as `pub` so the docs can be read.

zephyr/src/object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ macro_rules! _kobj_stack {
289289
unsafe { ::core::mem::zeroed() };
290290

291291
// The proxy object used to ensure initialization is placed in initialized memory.
292-
$v static $name: $crate::object::StaticKernelObject<$crate::sys::thread::StaticThreadStack> = $crate::object::StaticKernelObject {
292+
$v static $name: $crate::_export::KStaticThreadStack = $crate::object::StaticKernelObject {
293293
value: ::core::cell::UnsafeCell::new($crate::sys::thread::StaticThreadStack {
294294
base: [< $name _REAL >].data.get() as *mut $crate::raw::z_thread_stack_element,
295295
size: $size,

0 commit comments

Comments
 (0)