mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
add swap module to the kernel, and initialize it from args
This commit is contained in:
parent
a1cffed9cd
commit
4f15af3fee
1 changed files with 8 additions and 0 deletions
|
|
@ -27,6 +27,9 @@ mod server;
|
|||
mod services;
|
||||
mod syscall;
|
||||
|
||||
#[cfg(feature = "swap")]
|
||||
mod swap;
|
||||
|
||||
use services::SystemServices;
|
||||
use xous_kernel::*;
|
||||
|
||||
|
|
@ -39,6 +42,8 @@ use xous_kernel::*;
|
|||
///
|
||||
/// 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) {
|
||||
use crate::swap::Swap;
|
||||
|
||||
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.
|
||||
|
|
@ -47,6 +52,9 @@ pub unsafe extern "C" fn init(arg_offset: *const u32, init_offset: *const u32, r
|
|||
});
|
||||
SystemServices::with_mut(|system_services| system_services.init_from_memory(init_offset, &args));
|
||||
|
||||
#[cfg(feature = "swap")]
|
||||
Swap::with_mut(|swap| swap.init_from_args(&args)).expect("couldn't initialize swap");
|
||||
|
||||
// Now that the memory manager is set up, perform any architecture and
|
||||
// platform specific initializations.
|
||||
arch::init();
|
||||
|
|
|
|||
Loading…
Reference in a new issue