mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
Kernel: Make ProcessPagingScope restore CR3 properly
Instead of restoring CR3 to the current process's paging scope when a ProcessPagingScope goes out of scope, we now restore exactly whatever the CR3 value was when we created the ProcessPagingScope. This fixes breakage in situations where a process ends up with nested ProcessPagingScopes. This was making profiling very fragile, and with this change it's now possible to profile g++! :^)
This commit is contained in:
parent
ad3f931707
commit
6eab7b398d
Notes:
sideshowbarker
2024-07-19 09:57:34 +09:00
Author: https://github.com/awesomekling
Commit: 6eab7b398d
3 changed files with 16 additions and 7 deletions
|
@ -190,9 +190,13 @@ private:
|
|||
bool m_quickmap_in_use { false };
|
||||
};
|
||||
|
||||
struct ProcessPagingScope {
|
||||
ProcessPagingScope(Process&);
|
||||
class ProcessPagingScope {
|
||||
public:
|
||||
explicit ProcessPagingScope(Process&);
|
||||
~ProcessPagingScope();
|
||||
|
||||
private:
|
||||
u32 m_previous_cr3 { 0 };
|
||||
};
|
||||
|
||||
template<typename Callback>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue