Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better function name

  • Loading branch information...
commit c65fa7127c3b91fbaf9a89794a7acba4964b934e 1 parent f62c8bb
@wolfwood wolfwood authored
Showing with 11 additions and 6 deletions.
  1. +6 −1 kernel/arch/x86_64/core/paging.d
  2. +5 −5 user/environment.d
View
7 kernel/arch/x86_64/core/paging.d
@@ -323,7 +323,12 @@ static:
return ErrorVal.Fail;
}
- oldRoot = switchAddressSpace(findPhysicalAddressOfSegment(as));
+ PhysicalAddress newRoot = findPhysicalAddressOfAddressSpace(as);
+
+ if(newRoot is null)
+ return ErrorVal.Fail;
+
+ oldRoot = switchAddressSpace(newRoot);
return ErrorVal.Success;
}
View
10 user/environment.d
@@ -435,18 +435,18 @@ template getPhysicalAddressOfSegmentHelper(T, U){
}
// return the physical address of the first (largest) segment it stumbles upon
-PhysicalAddress findPhysicalAddressOfSegment(ubyte* vAddr){
+PhysicalAddress findPhysicalAddressOfAddressSpace(ubyte* vAddr){
PhysicalAddress physAddr;
- root.walk!(findPhysicalAddressOfSegmentHelper)(cast(AddressFragment)vAddr, physAddr);
+ root.walk!(findPhysicalAddressOfAddressSpaceHelper)(cast(AddressFragment)vAddr, physAddr);
return physAddr;
}
-template findPhysicalAddressOfSegmentHelper(T){
- bool findPhysicalAddressOfSegmentHelper(T table, uint idx, ref PhysicalAddress physAddr){
+template findPhysicalAddressOfAddressSpaceHelper(T){
+ bool findPhysicalAddressOfAddressSpaceHelper(T table, uint idx, ref PhysicalAddress physAddr){
if(table.entries[idx].present){
- if(table.entries[idx].getMode() & (AccessMode.Segment|AccessMode.RootPageTable)){
+ if(table.entries[idx].getMode() & AccessMode.RootPageTable){
physAddr = table.entries[idx].location();
return false;
}else{
Please sign in to comment.
Something went wrong with that request. Please try again.