mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 18:22:45 +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:
		
							parent
							
								
									298cd57fe7
								
							
						
					
					
						commit
						cd8d52e6ae
					
				
					 6 changed files with 11 additions and 11 deletions
				
			
		|  | @ -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.
 | ||||
|     // Otherwise stack walking will be a disaster.
 | ||||
|     if (Process::has_current()) | ||||
|         MM.enter_process_paging_scope(Process::current()); | ||||
|         MM.enter_process_address_space(Process::current()); | ||||
| 
 | ||||
|     PANIC("Aborted"); | ||||
| } | ||||
|  |  | |||
|  | @ -221,7 +221,7 @@ void handle_crash(RegisterState const& regs, char const* description, int signal | |||
| 
 | ||||
|     // If a process crashed while inspecting another process,
 | ||||
|     // 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)); | ||||
|     dump(regs); | ||||
|  |  | |||
|  | @ -910,12 +910,12 @@ RefPtr<PhysicalPage> MemoryManager::allocate_supervisor_physical_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(); | ||||
|     VERIFY(current_thread != nullptr); | ||||
|  |  | |||
|  | @ -160,8 +160,8 @@ public: | |||
|     void unmap_text_after_init(); | ||||
|     void unmap_ksyms_after_init(); | ||||
| 
 | ||||
|     static void enter_process_paging_scope(Process&); | ||||
|     static void enter_space(AddressSpace&); | ||||
|     static void enter_process_address_space(Process&); | ||||
|     static void enter_address_space(AddressSpace&); | ||||
| 
 | ||||
|     bool validate_user_stack_no_lock(AddressSpace&, VirtualAddress) const; | ||||
|     bool validate_user_stack(AddressSpace&, VirtualAddress) const; | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ ProcessPagingScope::ProcessPagingScope(Process& process) | |||
| { | ||||
|     VERIFY(Thread::current() != nullptr); | ||||
|     m_previous_cr3 = read_cr3(); | ||||
|     MM.enter_process_paging_scope(process); | ||||
|     MM.enter_process_address_space(process); | ||||
| } | ||||
| 
 | ||||
| ProcessPagingScope::~ProcessPagingScope() | ||||
|  |  | |||
|  | @ -278,7 +278,7 @@ static KResultOr<LoadResult> load_elf_object(NonnullOwnPtr<Memory::AddressSpace> | |||
|     String elf_name = object_description.absolute_path(); | ||||
|     VERIFY(!Processor::in_critical()); | ||||
| 
 | ||||
|     Memory::MemoryManager::enter_space(*new_space); | ||||
|     Memory::MemoryManager::enter_address_space(*new_space); | ||||
| 
 | ||||
|     KResult ph_load_result = KSuccess; | ||||
|     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)); | ||||
| 
 | ||||
|     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)); | ||||
|  | @ -524,7 +524,7 @@ KResult Process::do_exec(NonnullRefPtr<FileDescription> main_program_description | |||
|         TemporaryChange global_profiling_disabler(g_profiling_all_threads, false); | ||||
|         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_arguments = arguments; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling