Changeset 3fcea34 in mainline for uspace/lib/c/arch/amd64
- Timestamp:
- 2024-09-20T12:16:28Z (10 months ago)
- Branches:
- master
- Children:
- d3109ff
- Parents:
- 2cf8f994
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-09-20 11:42:13)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-09-20 12:16:28)
- Location:
- uspace/lib/c/arch/amd64
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/amd64/include/libarch/thread.h
r2cf8f994 r3fcea34 36 36 #define _LIBC_amd64_THREAD_H_ 37 37 38 #include <align.h> 39 #include <stddef.h> 40 #include <stdint.h> 41 42 static inline uintptr_t arch_thread_prepare(void *stack, size_t stack_size, 43 void (*main)(void *), void *arg) 44 { 45 uintptr_t *sp = (uintptr_t *) ALIGN_DOWN((uintptr_t) stack + stack_size, 16); 46 47 *--sp = (uintptr_t) arg; 48 *--sp = (uintptr_t) main; 49 50 return (uintptr_t) sp; 51 } 52 38 53 #endif 39 54 -
uspace/lib/c/arch/amd64/src/thread_entry.S
r2cf8f994 r3fcea34 35 35 # 36 36 SYMBOL_BEGIN(__thread_entry) 37 # Pop libc thread entry function and argument 38 popq %rax 39 popq %rdi 40 37 41 # 38 42 # Create the first stack frame. … … 42 46 movq %rsp, %rbp 43 47 44 # 45 # RAX contains address of uarg 46 # 47 movq %rax, %rdi 48 call FUNCTION_REF(__thread_main) 48 call *%rax 49 49 SYMBOL_END(__thread_entry)
Note:
See TracChangeset
for help on using the changeset viewer.