mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
kernel: format some files
Format some files prior to patching them. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
22cd08dc57
commit
d798962151
5 changed files with 21 additions and 14 deletions
|
|
@ -10,8 +10,6 @@ pub mod panic;
|
||||||
pub mod process;
|
pub mod process;
|
||||||
pub mod syscall;
|
pub mod syscall;
|
||||||
|
|
||||||
pub use process::Thread;
|
|
||||||
|
|
||||||
#[cfg(any(feature = "precursor", feature = "renode"))]
|
#[cfg(any(feature = "precursor", feature = "renode"))]
|
||||||
use crate::mem::MemoryManager;
|
use crate::mem::MemoryManager;
|
||||||
#[cfg(any(feature = "precursor", feature = "renode"))]
|
#[cfg(any(feature = "precursor", feature = "renode"))]
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,7 @@ impl Process {
|
||||||
}
|
}
|
||||||
|
|
||||||
process.inner = Default::default();
|
process.inner = Default::default();
|
||||||
process.inner.pid = pid;
|
process.inner.pid = pid;
|
||||||
|
|
||||||
// Mark the stack as "unallocated-but-free"
|
// Mark the stack as "unallocated-but-free"
|
||||||
let init_sp = (thread_init.stack.as_ptr() as usize) & !0xfff;
|
let init_sp = (thread_init.stack.as_ptr() as usize) & !0xfff;
|
||||||
|
|
|
||||||
|
|
@ -739,9 +739,14 @@ impl MemoryManager {
|
||||||
#[cfg(feature = "atsama5d27")]
|
#[cfg(feature = "atsama5d27")]
|
||||||
{
|
{
|
||||||
let uart_base = crate::platform::atsama5d2::uart::HW_UART_BASE as usize;
|
let uart_base = crate::platform::atsama5d2::uart::HW_UART_BASE as usize;
|
||||||
if pid.get() != 1 && (addr == uart_base || addr == uart_base + 0x1000 || addr == uart_base + 0x2000 || addr == uart_base + 0x3000) {
|
if pid.get() != 1
|
||||||
|
&& (addr == uart_base
|
||||||
|
|| addr == uart_base + 0x1000
|
||||||
|
|| addr == uart_base + 0x2000
|
||||||
|
|| addr == uart_base + 0x3000)
|
||||||
|
{
|
||||||
klog!("[!] UART sharing workaround used for {:08x} address", addr);
|
klog!("[!] UART sharing workaround used for {:08x} address", addr);
|
||||||
return Ok(())
|
return Ok(());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
// SPDX-FileCopyrightText: 2020 Sean Cross <sean@xobs.io>
|
// SPDX-FileCopyrightText: 2020 Sean Cross <sean@xobs.io>
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
pub use crate::arch::process::Thread;
|
|
||||||
use crate::{mem::MemoryManager, services::SystemServices};
|
use crate::{mem::MemoryManager, services::SystemServices};
|
||||||
use core::mem;
|
use core::mem;
|
||||||
use xous_kernel::{MemoryAddress, MemoryRange, MemorySize, Message, MessageSender, PID, SID, TID};
|
use xous_kernel::{MemoryAddress, MemoryRange, MemorySize, Message, MessageSender, PID, SID, TID};
|
||||||
|
|
|
||||||
|
|
@ -475,9 +475,7 @@ fn return_result(
|
||||||
return Err(xous_kernel::Error::DoubleFree);
|
return Err(xous_kernel::Error::DoubleFree);
|
||||||
}
|
}
|
||||||
WaitingMessage::MovedMemory => {
|
WaitingMessage::MovedMemory => {
|
||||||
klog!(
|
klog!("WARNING: Tried to wait on a scalar message that was actually moved memory");
|
||||||
"WARNING: Tried to wait on a scalar message that was actually moved memory"
|
|
||||||
);
|
|
||||||
return Err(xous_kernel::Error::DoubleFree);
|
return Err(xous_kernel::Error::DoubleFree);
|
||||||
}
|
}
|
||||||
WaitingMessage::None => {
|
WaitingMessage::None => {
|
||||||
|
|
@ -605,9 +603,7 @@ fn reply_and_receive_next(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WaitingMessage::MovedMemory => {
|
WaitingMessage::MovedMemory => {
|
||||||
klog!(
|
klog!("WARNING: Tried to wait on a scalar message that was actually moved memory");
|
||||||
"WARNING: Tried to wait on a scalar message that was actually moved memory"
|
|
||||||
);
|
|
||||||
return Err(xous_kernel::Error::DoubleFree);
|
return Err(xous_kernel::Error::DoubleFree);
|
||||||
}
|
}
|
||||||
WaitingMessage::None => {
|
WaitingMessage::None => {
|
||||||
|
|
@ -745,12 +741,21 @@ fn receive_message(pid: PID, tid: TID, sid: SID, blocking: ExecutionType) -> Sys
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle(pid: PID, tid: TID, in_irq: bool, call: SysCall) -> SysCallResult {
|
pub fn handle(pid: PID, tid: TID, in_irq: bool, call: SysCall) -> SysCallResult {
|
||||||
klog!("KERNEL({}:{}): Syscall {:x?}, in_irq={}", pid, tid, call, in_irq);
|
klog!(
|
||||||
|
"KERNEL({}:{}): Syscall {:x?}, in_irq={}",
|
||||||
|
pid,
|
||||||
|
tid,
|
||||||
|
call,
|
||||||
|
in_irq
|
||||||
|
);
|
||||||
// let call_string = format!("{:x?}", call);
|
// let call_string = format!("{:x?}", call);
|
||||||
// let start_time = std::time::Instant::now();
|
// let start_time = std::time::Instant::now();
|
||||||
#[allow(clippy::let_and_return)]
|
#[allow(clippy::let_and_return)]
|
||||||
let result = if in_irq && !call.can_call_from_interrupt() {
|
let result = if in_irq && !call.can_call_from_interrupt() {
|
||||||
klog!("[!] Called {:?} that's cannot be called from the interrupt handler!", call);
|
klog!(
|
||||||
|
"[!] Called {:?} that's cannot be called from the interrupt handler!",
|
||||||
|
call
|
||||||
|
);
|
||||||
Err(xous_kernel::Error::InvalidSyscall)
|
Err(xous_kernel::Error::InvalidSyscall)
|
||||||
} else {
|
} else {
|
||||||
handle_inner(pid, tid, in_irq, call)
|
handle_inner(pid, tid, in_irq, call)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue