forked from Bananymous/banan-os
Kernel: Thread creation now takes void(*)() as entry and void* as data
This simplifies threading for the future and gets rid of (undefined?) cast of member function pointer to address
This commit is contained in:
@@ -9,18 +9,13 @@ exit_thread_trampoline:
|
||||
pushl (%esp)
|
||||
ret
|
||||
|
||||
# void start_thread(uint32_t function, uint32_t esp, uint32_t eip)
|
||||
# void start_thread(uint32_t esp, uint32_t eip)
|
||||
.global start_thread
|
||||
start_thread:
|
||||
movl 4(%esp), %eax
|
||||
movl 12(%esp), %ecx
|
||||
movl 8(%esp), %esp
|
||||
|
||||
pushl %eax
|
||||
pushl $exit_thread_trampoline
|
||||
|
||||
movl 8(%esp), %ecx
|
||||
movl 4(%esp), %esp
|
||||
movl $0, %ebp
|
||||
|
||||
pushl $exit_thread_trampoline
|
||||
sti
|
||||
jmp *%ecx
|
||||
|
||||
|
||||
@@ -8,14 +8,15 @@ exit_thread_trampoline:
|
||||
movq 8(%rsp), %rdi
|
||||
ret
|
||||
|
||||
# void start_thread(uint64_t function, uint64_t rsp, uint64_t rip)
|
||||
# void start_thread(uint64_t rsp, uint64_t rip)
|
||||
.global start_thread
|
||||
start_thread:
|
||||
movq %rsi, %rsp
|
||||
movq %rdi, %rsp
|
||||
popq %rdi
|
||||
movq $0, %rbp
|
||||
pushq $exit_thread_trampoline
|
||||
sti
|
||||
jmp *%rdx
|
||||
jmp *%rsi
|
||||
|
||||
# void continue_thread(uint64_t rsp, uint64_t rip)
|
||||
.global continue_thread
|
||||
|
||||
Reference in New Issue
Block a user