mm: add a warning in map_page if a page is already mapped
This commit is contained in:
@@ -70,6 +70,11 @@ void map_page(void *physaddr, void *virtualaddr, unsigned int flags) {
|
|||||||
// Here you need to check whether the PT entry is present.
|
// Here you need to check whether the PT entry is present.
|
||||||
// When it is, then there is already a mapping present. What do you do now?
|
// When it is, then there is already a mapping present. What do you do now?
|
||||||
|
|
||||||
|
if(pt[ptindex] & 0x1)
|
||||||
|
{
|
||||||
|
printf("this page 0x%X is already mapped\n", virtualaddr);
|
||||||
|
}
|
||||||
|
|
||||||
pt[ptindex] = ((unsigned long)physaddr) | (flags & 0xFFF); // Present
|
pt[ptindex] = ((unsigned long)physaddr) | (flags & 0xFFF); // Present
|
||||||
|
|
||||||
// Now you need to flush the entry in the TLB
|
// Now you need to flush the entry in the TLB
|
||||||
|
|||||||
Reference in New Issue
Block a user