Skip to content

Commit 6085e87

Browse files
committed
zephyr: Expose some fields publicly
These need to be initialized by macros, so expose them publicly. It would probably be better to export a constructor. Signed-off-by: David Brown <[email protected]>
1 parent 130239b commit 6085e87

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

zephyr/src/sys/thread.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,27 @@ pub struct RealStaticThreadStack<const SIZE: usize> {
6666
#[allow(dead_code)]
6767
align: AlignAs<ZR_STACK_ALIGN>,
6868
#[allow(dead_code)]
69-
data: UnsafeCell<[z_thread_stack_element; SIZE]>,
69+
pub data: UnsafeCell<[z_thread_stack_element; SIZE]>,
7070
#[allow(dead_code)]
7171
extra: [z_thread_stack_element; ZR_STACK_RESERVED],
7272
}
7373

7474
unsafe impl<const SIZE: usize> Sync for RealStaticThreadStack<SIZE> {}
7575

7676
/// The dynamic stack value, which wraps the underlying stack.
77+
///
78+
/// TODO: constructor instead of private.
7779
pub struct ThreadStack {
78-
base: *mut z_thread_stack_element,
79-
size: usize,
80+
/// Private
81+
pub base: *mut z_thread_stack_element,
82+
/// Private
83+
pub size: usize,
8084
}
8185

8286
#[doc(hidden)]
8387
pub struct StaticThreadStack {
84-
base: *mut z_thread_stack_element,
85-
size: usize,
88+
pub base: *mut z_thread_stack_element,
89+
pub size: usize,
8690
}
8791

8892
unsafe impl Sync for StaticKernelObject<StaticThreadStack> {}

0 commit comments

Comments
 (0)