Commit acac09ec authored by David Brown's avatar David Brown Committed by David Brown
Browse files

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: default avatarDavid Brown <david.brown@linaro.org>
parent 542d65fc
Loading
Loading
Loading
Loading
+0 −10
Changes for lib/rust/main.c: 0 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -16,14 +16,4 @@ int main(void)
	return 0;
}

#ifdef CONFIG_PRINTK
/*
 * Until we have syscall support in Rust, wrap this syscall.
 */
void wrapped_str_out(char *c, size_t n)
{
	k_str_out(c, n);
}
#endif

#endif
+1 −5
Changes for lib/rust/zephyr/src/printk.rs: 1 added line, 5 removed lines.
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ impl Context {
    fn flush(&mut self) {
        if self.count > 0 {
            unsafe {
                wrapped_str_out(self.buf.as_ptr(), self.count);
                zephyr_sys::k_str_out(self.buf.as_mut_ptr() as *mut i8, self.count);
            }
            self.count = 0;
        }
@@ -111,7 +111,3 @@ pub fn printkln(args: Arguments<'_>) {
    context.add_byte(b'\n');
    context.flush();
}

extern "C" {
    fn wrapped_str_out(buf: *const u8, len: usize);
}