mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
kernel: more clippy warning fixes
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
d7a9b64d82
commit
b98e465d12
2 changed files with 9 additions and 9 deletions
|
|
@ -180,11 +180,11 @@ pub extern "C" fn trap_handler(
|
|||
// or returning from a handler or thread. If so, handle the exception
|
||||
// and return right away.
|
||||
match ex {
|
||||
RiscvException::StorePageFault(pc, addr) | RiscvException::LoadPageFault(pc, addr) => {
|
||||
RiscvException::StorePageFault(_pc, addr) | RiscvException::LoadPageFault(_pc, addr) => {
|
||||
#[cfg(all(feature = "debug-print", feature = "print-panics"))]
|
||||
print!(
|
||||
"KERNEL({}): RISC-V fault: {} @ {:08x}, addr {:08x} - ",
|
||||
pid, ex, pc, addr
|
||||
pid, ex, _pc, addr
|
||||
);
|
||||
crate::arch::mem::ensure_page_exists_inner(addr)
|
||||
.map(|_new_page| {
|
||||
|
|
@ -214,7 +214,11 @@ pub extern "C" fn trap_handler(
|
|||
ArchProcess::with_current_mut(|p| {
|
||||
// Adjust the program counter by the amount returned by the exception handler
|
||||
let pc_adjust = a0 as isize;
|
||||
p.current_thread_mut().sepc += 4;
|
||||
if pc_adjust < 0 {
|
||||
p.current_thread_mut().sepc -= pc_adjust.abs() as usize;
|
||||
} else {
|
||||
p.current_thread_mut().sepc += pc_adjust.abs() as usize;
|
||||
}
|
||||
|
||||
crate::arch::syscall::resume(current_pid().get() == 1, p.current_thread())
|
||||
});
|
||||
|
|
|
|||
|
|
@ -47,12 +47,8 @@ fn handle_panic(_arg: &PanicInfo) -> ! {
|
|||
/// # Safety
|
||||
///
|
||||
/// This is safe to call only to initialize the kernel.
|
||||
pub unsafe extern "C" fn init(
|
||||
arg_offset: *const u32,
|
||||
init_offset: *const u32,
|
||||
rpt_offset: *mut u32,
|
||||
) {
|
||||
args::KernelArguments::init(arg_offset);
|
||||
pub extern "C" fn init(arg_offset: *const u32, init_offset: *const u32, rpt_offset: *mut u32) {
|
||||
unsafe { args::KernelArguments::init(arg_offset) };
|
||||
let args = args::KernelArguments::get();
|
||||
// Everything needs memory, so the first thing we should do is initialize the memory manager.
|
||||
crate::mem::MemoryManager::with_mut(|mm| {
|
||||
|
|
|
|||
Loading…
Reference in a new issue