1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 11:45:11 +00:00

Kernel: Improve API names for switching address spaces

- enter_space => enter_address_space
- enter_process_paging_scope => enter_process_address_space
This commit is contained in:
Andreas Kling 2021-09-06 17:11:33 +02:00
parent 298cd57fe7
commit cd8d52e6ae
6 changed files with 11 additions and 11 deletions

View file

@ -23,7 +23,7 @@ void __assertion_failed(const char* msg, const char* file, unsigned line, const
// Switch back to the current process's page tables if there are any. // Switch back to the current process's page tables if there are any.
// Otherwise stack walking will be a disaster. // Otherwise stack walking will be a disaster.
if (Process::has_current()) if (Process::has_current())
MM.enter_process_paging_scope(Process::current()); MM.enter_process_address_space(Process::current());
PANIC("Aborted"); PANIC("Aborted");
} }

View file

@ -221,7 +221,7 @@ void handle_crash(RegisterState const& regs, char const* description, int signal
// If a process crashed while inspecting another process, // If a process crashed while inspecting another process,
// make sure we switch back to the right page tables. // make sure we switch back to the right page tables.
MM.enter_process_paging_scope(process); MM.enter_process_address_space(process);
dmesgln("CRASH: CPU #{} {} in ring {}", Processor::current_id(), description, (regs.cs & 3)); dmesgln("CRASH: CPU #{} {} in ring {}", Processor::current_id(), description, (regs.cs & 3));
dump(regs); dump(regs);

View file

@ -910,12 +910,12 @@ RefPtr<PhysicalPage> MemoryManager::allocate_supervisor_physical_page()
return page; return page;
} }
void MemoryManager::enter_process_paging_scope(Process& process) void MemoryManager::enter_process_address_space(Process& process)
{ {
enter_space(process.address_space()); enter_address_space(process.address_space());
} }
void MemoryManager::enter_space(AddressSpace& space) void MemoryManager::enter_address_space(AddressSpace& space)
{ {
auto current_thread = Thread::current(); auto current_thread = Thread::current();
VERIFY(current_thread != nullptr); VERIFY(current_thread != nullptr);

View file

@ -160,8 +160,8 @@ public:
void unmap_text_after_init(); void unmap_text_after_init();
void unmap_ksyms_after_init(); void unmap_ksyms_after_init();
static void enter_process_paging_scope(Process&); static void enter_process_address_space(Process&);
static void enter_space(AddressSpace&); static void enter_address_space(AddressSpace&);
bool validate_user_stack_no_lock(AddressSpace&, VirtualAddress) const; bool validate_user_stack_no_lock(AddressSpace&, VirtualAddress) const;
bool validate_user_stack(AddressSpace&, VirtualAddress) const; bool validate_user_stack(AddressSpace&, VirtualAddress) const;

View file

@ -14,7 +14,7 @@ ProcessPagingScope::ProcessPagingScope(Process& process)
{ {
VERIFY(Thread::current() != nullptr); VERIFY(Thread::current() != nullptr);
m_previous_cr3 = read_cr3(); m_previous_cr3 = read_cr3();
MM.enter_process_paging_scope(process); MM.enter_process_address_space(process);
} }
ProcessPagingScope::~ProcessPagingScope() ProcessPagingScope::~ProcessPagingScope()

View file

@ -278,7 +278,7 @@ static KResultOr<LoadResult> load_elf_object(NonnullOwnPtr<Memory::AddressSpace>
String elf_name = object_description.absolute_path(); String elf_name = object_description.absolute_path();
VERIFY(!Processor::in_critical()); VERIFY(!Processor::in_critical());
Memory::MemoryManager::enter_space(*new_space); Memory::MemoryManager::enter_address_space(*new_space);
KResult ph_load_result = KSuccess; KResult ph_load_result = KSuccess;
elf_image.for_each_program_header([&](const ELF::Image::ProgramHeader& program_header) { elf_image.for_each_program_header([&](const ELF::Image::ProgramHeader& program_header) {
@ -434,7 +434,7 @@ KResultOr<LoadResult> Process::load(NonnullRefPtr<FileDescription> main_program_
auto new_space = TRY(Memory::AddressSpace::try_create(nullptr)); auto new_space = TRY(Memory::AddressSpace::try_create(nullptr));
ScopeGuard space_guard([&]() { ScopeGuard space_guard([&]() {
Memory::MemoryManager::enter_process_paging_scope(*this); Memory::MemoryManager::enter_process_address_space(*this);
}); });
auto load_offset = TRY(get_load_offset(main_program_header, main_program_description, interpreter_description)); auto load_offset = TRY(get_load_offset(main_program_header, main_program_description, interpreter_description));
@ -524,7 +524,7 @@ KResult Process::do_exec(NonnullRefPtr<FileDescription> main_program_description
TemporaryChange global_profiling_disabler(g_profiling_all_threads, false); TemporaryChange global_profiling_disabler(g_profiling_all_threads, false);
m_space = load_result.space.release_nonnull(); m_space = load_result.space.release_nonnull();
} }
Memory::MemoryManager::enter_space(*m_space); Memory::MemoryManager::enter_address_space(*m_space);
m_executable = main_program_description->custody(); m_executable = main_program_description->custody();
m_arguments = arguments; m_arguments = arguments;