diff options
Diffstat (limited to 'src/kernel/mem.c')
-rw-r--r-- | src/kernel/mem.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/kernel/mem.c b/src/kernel/mem.c index 7c1c640..aed2ff9 100644 --- a/src/kernel/mem.c +++ b/src/kernel/mem.c @@ -44,6 +44,8 @@ void virt_iter_new( struct pagedir *pages, bool user, bool writeable) { iter->frag = 0; + iter->frag_len = 0; + iter->prior = 0; iter->error = false; iter->_virt = virt; iter->_remaining = length; @@ -60,6 +62,7 @@ bool virt_iter_next(struct virt_iter *iter) { uintptr_t virt = (uintptr_t) iter->_virt; size_t partial = iter->_remaining; + iter->prior += iter->frag_len; if (partial <= 0) return false; // don't read past the page |