Fixed tripple-fault when creating a new frame, after the current was gc'd.

We'll need to get rid of that awful VGA sometime soon.
This commit is contained in:
Jonas 'Sortie' Termansen 2011-11-21 00:27:10 +01:00
parent 313079483a
commit eb035d6a4a
2 changed files with 3 additions and 0 deletions

View File

@ -207,6 +207,7 @@ namespace Sortix
if ( process != NULL ) { ASSERT(CurrentProcess() == process); }
if ( userframe != NULL ) { Memory::UnmapUser((addr_t) userframe); Memory::InvalidatePage((addr_t) userframe); }
if ( physical != 0 ) { Page::Put(physical); }
if ( VGA::currentframe == this ) { VGA::currentframe = NULL; }
}
bool DevVGAFrame::IsType(unsigned type)

View File

@ -217,6 +217,8 @@ namespace Sortix
// Don't switch if we are already there.
if ( addrspace == currentdir ) { return currentdir; }
if ( addrspace & 0xFFFUL ) { PanicF("addrspace 0x%zx was not page-aligned!", addrspace); }
addr_t previous = currentdir;
// Switch and flush the TLB.