Move stuff, deprecate softpage

This commit is contained in:
Erin 2023-08-15 16:32:59 +02:00 committed by ondra05
parent 7dc8c6cca4
commit bcb0ec41e2
8 changed files with 10 additions and 7 deletions

View file

@ -3,7 +3,7 @@
use { use {
hbbytecode::valider::validate, hbbytecode::valider::validate,
hbvm::{ hbvm::{
softpaging::{ mem::softpaging::{
paging::{PageTable, Permission}, paging::{PageTable, Permission},
HandlePageFault, PageSize, SoftPagedMem, HandlePageFault, PageSize, SoftPagedMem,
}, },

View file

@ -17,7 +17,7 @@
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
extern crate alloc; extern crate alloc;
pub mod softpaging; pub mod mem;
pub mod value; pub mod value;
mod bmc; mod bmc;

View file

@ -1,7 +1,7 @@
use { use {
hbbytecode::valider::validate, hbbytecode::valider::validate,
hbvm::{ hbvm::{
softpaging::{paging::PageTable, HandlePageFault, PageSize, SoftPagedMem}, mem::softpaging::{paging::PageTable, HandlePageFault, PageSize, SoftPagedMem},
MemoryAccessReason, Vm, MemoryAccessReason, Vm,
}, },
std::io::{stdin, Read}, std::io::{stdin, Read},
@ -38,7 +38,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.map( .map(
data, data,
8192, 8192,
hbvm::softpaging::paging::Permission::Write, hbvm::mem::softpaging::paging::Permission::Write,
PageSize::Size4K, PageSize::Size4K,
) )
.unwrap(); .unwrap();

3
hbvm/src/mem/mod.rs Normal file
View file

@ -0,0 +1,3 @@
//! Memory implementations
pub mod softpaging;

View file

@ -1,7 +1,5 @@
//! Platform independent, software paged memory implementation //! Platform independent, software paged memory implementation
use self::lookup::{AddrPageLookupError, AddrPageLookupOk, AddrPageLookuper};
pub mod lookup; pub mod lookup;
pub mod paging; pub mod paging;
@ -9,12 +7,14 @@ pub mod paging;
pub mod mapping; pub mod mapping;
use { use {
super::{LoadError, Memory, MemoryAccessReason, StoreError}, crate::{LoadError, Memory, MemoryAccessReason, StoreError},
core::slice::SliceIndex, core::slice::SliceIndex,
lookup::{AddrPageLookupError, AddrPageLookupOk, AddrPageLookuper},
paging::{PageTable, Permission}, paging::{PageTable, Permission},
}; };
/// HoleyBytes software paged memory /// HoleyBytes software paged memory
#[deprecated]
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct SoftPagedMem<'p, PfH> { pub struct SoftPagedMem<'p, PfH> {
/// Root page table /// Root page table