Changeset 3fcea34 in mainline for uspace/lib/c/arch/mips32
- 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/mips32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/mips32/include/libarch/thread.h
r2cf8f994 r3fcea34 37 37 #define _LIBC_mips32_THREAD_H_ 38 38 39 #include <align.h> 40 41 static inline uintptr_t arch_thread_prepare(void *stack, size_t stack_size, 42 void (*main)(void *), void *arg) 43 { 44 uintptr_t *sp = (uintptr_t *) ALIGN_DOWN((uintptr_t) stack + stack_size, 16); 45 46 sp[-1] = (uintptr_t) arg; 47 sp[-2] = (uintptr_t) main; 48 49 return (uintptr_t) sp; 50 } 51 39 52 #endif 40 53 -
uspace/lib/c/arch/mips32/src/thread_entry.S
r2cf8f994 r3fcea34 40 40 # 41 41 SYMBOL(__thread_entry) 42 .ent __thread_entry 43 .frame $sp, ABI_STACK_FRAME, $ra 44 .cpload $t9 42 # All registers should be zero, including $fp and $ra. 43 # Instead of setting up a stack frame here, we leave it for __thread_main. 45 44 46 # 47 # v0 contains address of uarg.48 # 49 add $a0, $v0, 045 # Function argument. 46 lw $a0, -4($sp) 47 # Function pointer. 48 lw $t0, -8($sp) 50 49 51 # Allocate the stack frame. 52 addiu $sp, -ABI_STACK_FRAME 53 54 # Allow PIC code 55 .cprestore 16 56 57 jal __thread_main 50 j $t0 58 51 nop 59 60 #61 # Not reached.62 #63 addiu $sp, ABI_STACK_FRAME64 .end __thread_entry
Note:
See TracChangeset
for help on using the changeset viewer.