Changeset 3fcea34 in mainline for uspace/lib/c/arch/ppc32
- 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/ppc32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/ppc32/include/libarch/thread.h
r2cf8f994 r3fcea34 36 36 #define _LIBC_ppc32_THREAD_H_ 37 37 38 #include <align.h> 39 40 static inline uintptr_t arch_thread_prepare(void *stack, size_t stack_size, 41 void (*main)(void *), void *arg) 42 { 43 uintptr_t *sp = (uintptr_t *) ALIGN_DOWN((uintptr_t) stack + stack_size - sizeof(void *), 16); 44 45 sp[0] = 0; 46 sp[-1] = (uintptr_t) arg; 47 sp[-2] = (uintptr_t) main; 48 49 return (uintptr_t) sp; 50 } 51 38 52 #endif 39 53 -
uspace/lib/c/arch/ppc32/src/thread_entry.S
r2cf8f994 r3fcea34 35 35 # 36 36 SYMBOL(__thread_entry) 37 # 38 # Create the first stack frame. 39 # 40 li %r4, 0 41 stw %r4, 0(%r1) 42 stwu %r1, -16(%r1) 37 # Load function and argument. 38 lwz %r3, -4(%r1) 39 lwz %r4, -8(%r1) 43 40 44 b __thread_main 41 # Clear LR 42 li %r0, 0 43 mtlr %r0 45 44 45 mtctr %r4 46 bctr
Note:
See TracChangeset
for help on using the changeset viewer.