Browse Source

impl Add<usize> for memory::paging::Page

master
3moon 8 years ago
parent
commit
db6cc040e9
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      src/arch/x86_64/memory/paging/mod.rs

+ 9
- 1
src/arch/x86_64/memory/paging/mod.rs View File

@ -3,7 +3,7 @@
//! Extremely ripped off from Phil Oppermann's tutorials, because I don't feel like writing
//! a paging system off the top of my head today.
use core::ops::{Deref, DerefMut};
use core::ops::{Add, Deref, DerefMut};
use multiboot2::BootInformation;
use super::PAGE_SIZE;
use super::{Frame, FrameAllocator};
@ -158,6 +158,14 @@ impl Page {
}
}
impl Add<usize> for Page {
type Output = Page;
fn add(self, rhs: usize) -> Page {
Page { index: self.index + rhs }
}
}
pub struct PageIter {
start: Page,
end: Page,


Loading…
Cancel
Save