mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
Kernel: Introduce ProcessorSpecific<T> for per-CPU data structures
To add a new per-CPU data structure, add an ID for it to the ProcessorSpecificDataID enum. Then call ProcessorSpecific<T>::initialize() when you are ready to construct the per-CPU data structure on the current CPU. It can then be accessed via ProcessorSpecific<T>::get(). This patch replaces the existing hard-coded mechanisms for Scheduler and MemoryManager per-CPU data structure.
This commit is contained in:
parent
559ab00249
commit
1e43292c3b
Notes:
sideshowbarker
2024-07-18 08:03:20 +09:00
Author: https://github.com/awesomekling
Commit: 1e43292c3b
6 changed files with 46 additions and 38 deletions
|
|
@ -598,8 +598,7 @@ void MemoryManager::release_pte(PageDirectory& page_directory, VirtualAddress va
|
|||
|
||||
UNMAP_AFTER_INIT void MemoryManager::initialize(u32 cpu)
|
||||
{
|
||||
auto mm_data = new MemoryManagerData;
|
||||
Processor::current().set_mm_data(*mm_data);
|
||||
ProcessorSpecific<MemoryManagerData>::initialize();
|
||||
|
||||
if (cpu == 0) {
|
||||
new MemoryManager;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue