Changeset 3fcea34 in mainline for uspace/lib/c/arch/sparc64
- 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/sparc64
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/sparc64/include/libarch/thread.h
r2cf8f994 r3fcea34 35 35 #define _LIBC_sparc64_THREAD_H_ 36 36 37 #include <assert.h> 38 #include <align.h> 39 #include <libarch/stack.h> 40 41 static inline uintptr_t arch_thread_prepare(void *stack, size_t stack_size, 42 void (*main)(void *), void *arg) 43 { 44 /* We must leave space above the stack pointer for initial register spill area. */ 45 uintptr_t *sp = (uintptr_t *) ALIGN_DOWN((uintptr_t) stack + stack_size - STACK_WINDOW_SAVE_AREA_SIZE - STACK_ARG_SAVE_AREA_SIZE, 16); 46 47 sp[-1] = (uintptr_t) arg; 48 sp[-2] = (uintptr_t) main; 49 50 return ((uintptr_t) sp) - STACK_BIAS; 51 } 52 37 53 #endif 38 54 -
uspace/lib/c/arch/sparc64/src/thread_entry.S
r2cf8f994 r3fcea34 35 35 # 36 36 SYMBOL(__thread_entry) 37 add %sp, 0x7ff, %g1 38 37 39 # 38 40 # Create the first stack frame. … … 43 45 44 46 # 45 # Propagate the input arguments to the new window.47 # Load libc entry point address and argument from stack 46 48 # 49 ldn [%g1 - 8], %o0 50 ldn [%g1 - 16], %g1 47 51 48 call __thread_main ! %o0 contains address of uarg 49 mov %i0, %o0 52 jmpl %g1, %r0 53 # Wipe link register 54 xor %o7, %o7, %o7 50 55 51 56 ! not reached
Note:
See TracChangeset
for help on using the changeset viewer.