Kernel: Pass current cpu index as a GDT limit

I had no idea LSL was an instruction. This cleans up code to get the
current cpu by a lot and does not require extra segment usage :D
This commit is contained in:
2026-05-02 18:10:10 +03:00
parent 77ca525552
commit fde085e04b
9 changed files with 23 additions and 42 deletions

View File

@@ -217,8 +217,7 @@ namespace Kernel
memset(reinterpret_cast<void*>(s_shared_page_vaddr), 0, PAGE_SIZE);
auto& shared_page = *reinterpret_cast<volatile API::SharedPage*>(s_shared_page_vaddr);
for (size_t i = 0; i <= 0xFF; i++)
shared_page.__sequence[i] = i;
shared_page.gdt_cpu_offset = GDT::cpu_index_offset();
shared_page.features = 0;
ASSERT(Processor::count() + sizeof(Kernel::API::SharedPage) <= PAGE_SIZE);