run cargo fmt -all

This commit is contained in:
Wenlong Zhang 2020-08-11 20:47:45 +08:00
parent 289cd8f097
commit f7152c709c
9 changed files with 12 additions and 14 deletions

View File

@ -7,7 +7,7 @@ impl Syscall<'_> {
pub fn sys_cprng_draw_once(&self, mut buf: UserOutPtr<u8>, len: usize) -> ZxResult {
info!("cprng_draw_once: buf=({:?}; {:?})", buf, len);
let mut res = vec![0u8; len];
kernel_hal::fill_random(&mut res);// Fill random bytes to the buffer
kernel_hal::fill_random(&mut res); // Fill random bytes to the buffer
buf.write_array(&res)?;
Ok(())
}

View File

@ -239,7 +239,7 @@ impl Syscall<'_> {
interrupt.destroy()
}
/// A blocking syscall which causes the caller to wait until an interrupt is triggered.
/// A blocking syscall which causes the caller to wait until an interrupt is triggered.
pub async fn sys_interrupt_wait(
&self,
interrupt: HandleValue,

View File

@ -2,7 +2,6 @@ use super::*;
use zircon_object::dev::*;
impl Syscall<'_> {
/// Write debug info to the serial port
/// To use the zx_debug_write() function,
/// you must specify ```kernel.enable-serial-syscalls=true``` or ```kernel.enable-serial-syscalls=output-only``` on the kernel command line.

View File

@ -1,7 +1,7 @@
use {super::*, zircon_object::ipc::Fifo};
impl Syscall<'_> {
/// Creates a fifo, which is actually a pair of fifos of ```elem_count``` entries of ```elem_size``` bytes.
/// Creates a fifo, which is actually a pair of fifos of ```elem_count``` entries of ```elem_size``` bytes.
pub fn sys_fifo_create(
&self,
elem_count: usize,

View File

@ -362,7 +362,7 @@ impl Syscall<'_> {
Ok(())
}
/// Asserts and deasserts the userspace-accessible signal bits on the object's peer.
/// Asserts and deasserts the userspace-accessible signal bits on the object's peer.
pub fn sys_object_signal_peer(
&self,
handle_value: HandleValue,

View File

@ -2,7 +2,7 @@ use {super::*, core::convert::TryFrom, zircon_object::dev::*};
impl Syscall<'_> {
#[allow(clippy::too_many_arguments)]
/// Create a resource object for use with other DDK syscalls.
/// Create a resource object for use with other DDK syscalls.
pub fn sys_resource_create(
&self,
parent_rsrc: HandleValue,

View File

@ -69,7 +69,7 @@ impl Syscall<'_> {
/// Start a timer.
/// To fire the timer immediately pass a deadline less than or equal to 0.
/// The slack parameter specifies a range from deadline - slack to deadline + slack during which the timer is allowed to fire.
/// The slack parameter specifies a range from deadline - slack to deadline + slack during which the timer is allowed to fire.
pub fn sys_timer_set(&self, handle: HandleValue, deadline: Deadline, slack: i64) -> ZxResult {
info!(
"timer.set: handle={:#x}, deadline={:#x?}, slack={:#x}",

View File

@ -2,9 +2,8 @@ use core::convert::TryFrom;
use {super::*, zircon_object::task::*};
impl Syscall<'_> {
/// Create a new process.
/// Upon success, handles for the new process and the root of its address space are returned.
/// Upon success, handles for the new process and the root of its address space are returned.
pub fn sys_process_create(
&self,
job: HandleValue,
@ -45,7 +44,7 @@ impl Syscall<'_> {
}
/// Creates a thread within the specified process.
/// Upon success a handle for the new thread is returned.
/// Upon success a handle for the new thread is returned.
pub fn sys_thread_create(
&self,
proc_handle: HandleValue,
@ -123,7 +122,7 @@ impl Syscall<'_> {
}
/// Sets process as critical to job.
/// When process terminates, job will be terminated as if ```zx_task_kill()``` was called on it.
/// When process terminates, job will be terminated as if ```zx_task_kill()``` was called on it.
pub fn sys_job_set_critical(
&self,
job_handle: HandleValue,
@ -266,7 +265,7 @@ impl Syscall<'_> {
}
}
/// Sets one or more security and/or resource policies to an empty job.
/// Sets one or more security and/or resource policies to an empty job.
pub fn sys_job_set_policy(
&self,
handle: HandleValue,

View File

@ -57,7 +57,7 @@ impl Syscall<'_> {
Ok(())
}
///
///
pub fn sys_clock_adjust(&self, resource: HandleValue, clock_id: u32, offset: u64) -> ZxResult {
info!(
"clock.adjust: resource={:#x?}, id={:#x}, offset={:#x}",
@ -88,7 +88,7 @@ impl Syscall<'_> {
}
/// High resolution sleep.
/// A ```deadline``` value less than or equal to 0 immediately yields the thread.
/// A ```deadline``` value less than or equal to 0 immediately yields the thread.
pub async fn sys_nanosleep(&self, deadline: Deadline) -> ZxResult {
info!("nanosleep: deadline={:?}", deadline);
if deadline.0 <= 0 {