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 25 additions and 2 deletions
Showing only changes of commit 96babec22a - Show all commits

View File

@ -7,12 +7,35 @@ read_ip:
# void start_thread(uint32_t sp, uint32_t ip)
.global start_thread
start_thread:
ud2
movl 8(%esp), %edi # ip
movl 4(%esp), %esp # sp
# STACK LAYOUT
# NULL
# thread ptr
# &Thread::on_exit
# data
xorl %ebp, %ebp
sti
call *%edi
movl 4(%esp), %edi # &Thread::on_exit
movl 8(%esp), %eax # thread ptr
movl %eax, (%esp)
call *%edi
# void continue_thread(uint32_t sp, uint32_t ip)
.global continue_thread
continue_thread:
ud2
movl 8(%esp), %edi # ip
movl 4(%esp), %esp # sp
xorl %eax, %eax
jmp *%edi
# void thread_userspace_trampoline(uint32_t sp, uint32_t ip, int argc, char** argv, char** envp)
.global thread_userspace_trampoline