Add back x86_32 support #5

Merged
Bananymous merged 46 commits from x86_32 into main 2024-04-03 02:36:29 +03:00
1 changed files with 6 additions and 6 deletions
Showing only changes of commit 9e073e9fa0 - Show all commits

View File

@ -115,11 +115,7 @@ namespace Kernel
if (thread->state() == Thread::State::NotStarted) if (thread->state() == Thread::State::NotStarted)
thread->m_state = Thread::State::Executing; thread->m_state = Thread::State::Executing;
ASSERT(thread->interrupt_stack().ip);
ASSERT(thread->interrupt_stack().sp);
Processor::gdt().set_tss_stack(thread->kernel_stack_top()); Processor::gdt().set_tss_stack(thread->kernel_stack_top());
Processor::get_interrupt_stack() = thread->interrupt_stack(); Processor::get_interrupt_stack() = thread->interrupt_stack();
Processor::get_interrupt_registers() = thread->interrupt_registers(); Processor::get_interrupt_registers() = thread->interrupt_registers();
} }
@ -149,7 +145,9 @@ namespace Kernel
"movq %[load_sp], %%rsp;" "movq %[load_sp], %%rsp;"
"int %[ipi];" "int %[ipi];"
"movq %%rcx, %%rsp;" "movq %%rcx, %%rsp;"
:: [load_sp]"r"(Processor::current_stack_top()), // NOTE: This is offset by 2 pointers since interrupt without PL change
// does not push SP and SS. This allows accessing "whole" interrupt stack.
:: [load_sp]"r"(Processor::current_stack_top() - 2 * sizeof(uintptr_t)),
[ipi]"i"(IRQ_VECTOR_BASE + IRQ_IPI) [ipi]"i"(IRQ_VECTOR_BASE + IRQ_IPI)
: "memory", "rcx" : "memory", "rcx"
); );
@ -159,7 +157,9 @@ namespace Kernel
"movl %[load_sp], %%esp;" "movl %[load_sp], %%esp;"
"int %[ipi];" "int %[ipi];"
"movl %%ecx, %%esp;" "movl %%ecx, %%esp;"
:: [load_sp]"r"(Processor::current_stack_top()), // NOTE: This is offset by 2 pointers since interrupt without PL change
// does not push SP and SS. This allows accessing "whole" interrupt stack.
:: [load_sp]"r"(Processor::current_stack_top() - 2 * sizeof(uintptr_t)),
[ipi]"i"(IRQ_VECTOR_BASE + IRQ_IPI) [ipi]"i"(IRQ_VECTOR_BASE + IRQ_IPI)
: "memory", "ecx" : "memory", "ecx"
); );