2024-03-22 14:48:33 +02:00
|
|
|
# uint32_t read_ip()
|
|
|
|
.global read_ip
|
|
|
|
read_ip:
|
2023-02-02 23:24:12 +02:00
|
|
|
popl %eax
|
|
|
|
jmp *%eax
|
|
|
|
|
2024-04-02 12:34:42 +03:00
|
|
|
# void start_kernel_thread()
|
|
|
|
.global start_kernel_thread
|
|
|
|
start_kernel_thread:
|
|
|
|
call get_start_kernel_thread_sp
|
|
|
|
movl %eax, %esp
|
2024-03-26 19:42:14 +02:00
|
|
|
|
|
|
|
# STACK LAYOUT
|
2024-04-02 12:34:42 +03:00
|
|
|
# on_exit arg
|
|
|
|
# on_exit func
|
|
|
|
# entry arg
|
|
|
|
# entry func
|
2024-03-26 19:42:14 +02:00
|
|
|
|
2024-04-02 12:34:42 +03:00
|
|
|
movl 4(%esp), %edi
|
|
|
|
movl 0(%esp), %esi
|
2024-03-26 19:42:14 +02:00
|
|
|
|
2024-04-02 12:34:42 +03:00
|
|
|
subl $12, %esp
|
|
|
|
pushl %edi
|
2024-03-26 19:42:14 +02:00
|
|
|
sti
|
2024-04-02 12:34:42 +03:00
|
|
|
call *%esi
|
|
|
|
addl $16, %esp
|
2024-03-26 19:42:14 +02:00
|
|
|
|
2024-04-02 12:34:42 +03:00
|
|
|
movl 12(%esp), %edi
|
|
|
|
movl 8(%esp), %esi
|
2024-03-26 19:42:14 +02:00
|
|
|
|
2024-04-02 12:34:42 +03:00
|
|
|
subl $12, %esp
|
|
|
|
pushl %edi
|
|
|
|
call *%esi
|
|
|
|
addl $16, %esp
|