Skip to content

Commit acac09e

Browse files
committed
rust: Convert k_str_out to bindgen one
Remove the manual k_str_out wrapper, and use the one generated by bindgen. Signed-off-by: David Brown <[email protected]>
1 parent 542d65f commit acac09e

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

lib/rust/main.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,4 @@ int main(void)
1616
return 0;
1717
}
1818

19-
#ifdef CONFIG_PRINTK
20-
/*
21-
* Until we have syscall support in Rust, wrap this syscall.
22-
*/
23-
void wrapped_str_out(char *c, size_t n)
24-
{
25-
k_str_out(c, n);
26-
}
27-
#endif
28-
2919
#endif

lib/rust/zephyr/src/printk.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl Context {
7777
fn flush(&mut self) {
7878
if self.count > 0 {
7979
unsafe {
80-
wrapped_str_out(self.buf.as_ptr(), self.count);
80+
zephyr_sys::k_str_out(self.buf.as_mut_ptr() as *mut i8, self.count);
8181
}
8282
self.count = 0;
8383
}
@@ -111,7 +111,3 @@ pub fn printkln(args: Arguments<'_>) {
111111
context.add_byte(b'\n');
112112
context.flush();
113113
}
114-
115-
extern "C" {
116-
fn wrapped_str_out(buf: *const u8, len: usize);
117-
}

0 commit comments

Comments
 (0)