Merge branch 'master' into master
This commit is contained in:
7
third_party/lang-items/src/lib.rs
vendored
7
third_party/lang-items/src/lib.rs
vendored
@@ -7,3 +7,10 @@ mod allocator;
|
||||
mod panic_handler;
|
||||
#[cfg(not(feature = "std"))]
|
||||
mod util;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
#[no_mangle]
|
||||
unsafe fn libtock_alloc_init(_app_heap_start: usize, _app_heap_size: usize) {
|
||||
// Stub so that the symbol is present.
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
14
third_party/libtock-drivers/src/console.rs
vendored
14
third_party/libtock-drivers/src/console.rs
vendored
@@ -17,7 +17,7 @@ mod allow_nr {
|
||||
pub const SHARE_BUFFER: usize = 1;
|
||||
}
|
||||
|
||||
const BUFFER_SIZE: usize = 1024;
|
||||
pub const BUFFER_SIZE: usize = 1024;
|
||||
|
||||
pub struct Console {
|
||||
allow_buffer: [u8; BUFFER_SIZE],
|
||||
@@ -70,11 +70,13 @@ impl Console {
|
||||
// Clear the buffer even in case of error, to avoid an infinite loop.
|
||||
self.count_pending = 0;
|
||||
|
||||
let result = syscalls::allow(
|
||||
DRIVER_NUMBER,
|
||||
allow_nr::SHARE_BUFFER,
|
||||
&mut self.allow_buffer[..count],
|
||||
);
|
||||
Console::write_unbuffered(&mut self.allow_buffer[..count]);
|
||||
}
|
||||
|
||||
pub fn write_unbuffered(buf: &mut [u8]) {
|
||||
let count = buf.len();
|
||||
|
||||
let result = syscalls::allow(DRIVER_NUMBER, allow_nr::SHARE_BUFFER, buf);
|
||||
if result.is_err() {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user