summaryrefslogtreecommitdiff
path: root/Source/Kernel/MemoryManager/V86Segment.class.cpp
blob: e82a94c23e7b8098a97e6e6dfe0894e4fcb2a330 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "V86Segment.class.h"
#include <MemoryManager/PageDirectory.class.h>

seg_map_t V86Segment::map(PageDirectory *pd) {
	for (u32int i = 0; i < 0x100000; i += 0x1000) {
		PageDirectory::map(pd->getPage(i, true), i / 0x1000, true, true);
	}
	seg_map_t map = {this, 0, 0x100000};
	return map;
}

void V86Segment::unmap(PageDirectory* pd, seg_map_t *mapping) {
	for (u32int i = 0; i < 0x100000; i += 0x1000) {
		PageDirectory::unmap(pd->getPage(i, false));
	}
}