1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

UserspaceEmulator: Use ring 3 segment selectors

We were using ring 0 selectors everywhere (the bottom 3 bits of a
selector determines the ring.) This doesn't really make any practical
difference since UE doesn't run code in other rings anyway, but let's
have correct-looking segment selectors. :^)
This commit is contained in:
Andreas Kling 2020-12-25 15:39:26 +01:00
parent 2f1712cc29
commit d55fb7b5e2
5 changed files with 25 additions and 25 deletions

View file

@ -267,11 +267,11 @@ Vector<FlatPtr> Emulator::raw_backtrace()
u32 frame_ptr = m_cpu.ebp().value();
while (frame_ptr) {
u32 ret_ptr = m_mmu.read32({ 0x20, frame_ptr + 4 }).value();
u32 ret_ptr = m_mmu.read32({ 0x23, frame_ptr + 4 }).value();
if (!ret_ptr)
break;
backtrace.append(ret_ptr);
frame_ptr = m_mmu.read32({ 0x20, frame_ptr }).value();
frame_ptr = m_mmu.read32({ 0x23, frame_ptr }).value();
}
return backtrace;
}
@ -984,7 +984,7 @@ int Emulator::virt$pipe(FlatPtr vm_pipefd, int flags)
u32 Emulator::virt$munmap(FlatPtr address, u32 size)
{
auto* region = mmu().find_region({ 0x20, address });
auto* region = mmu().find_region({ 0x23, address });
ASSERT(region);
if (region->size() != round_up_to_power_of_two(size, PAGE_SIZE))
TODO();