Fix MIPS threading code to compile with older compiler
Official rockbox mips gcc is old and doesn't support symbolic register names in inline assembly Change-Id: If67230d06e28ccf31b0f8f8e1b622275fed3f6ff
This commit is contained in:
parent
9be14c014f
commit
71dc1a789a
1 changed files with 34 additions and 34 deletions
|
@ -31,13 +31,13 @@ static void USED_ATTR start_thread(void *addr)
|
||||||
asm volatile (
|
asm volatile (
|
||||||
".set noreorder \n"
|
".set noreorder \n"
|
||||||
".set noat \n"
|
".set noat \n"
|
||||||
"lw $t9, 4(%0) \n" /* Fetch thread function pointer ($25 = t9) */
|
"lw $25, 4(%0) \n" /* Fetch thread function pointer ($25 = t9) */
|
||||||
"lw $sp, 40(%0) \n" /* Set initial sp(=$29) */
|
"lw $25, 40(%0) \n" /* Set initial sp(=$29) */
|
||||||
"jalr $t9 \n" /* Start the thread */
|
"jalr $25 \n" /* Start the thread */
|
||||||
"sw $zero, 48(%0) \n" /* Clear start address */
|
"sw $0, 48(%0) \n" /* Clear start address */
|
||||||
".set at \n"
|
".set at \n"
|
||||||
".set reorder \n"
|
".set reorder \n"
|
||||||
: : "r" (addr) : "t9"
|
: : "r" (addr) : "$25"
|
||||||
);
|
);
|
||||||
thread_exit();
|
thread_exit();
|
||||||
}
|
}
|
||||||
|
@ -59,18 +59,18 @@ static inline void store_context(void* addr)
|
||||||
asm volatile (
|
asm volatile (
|
||||||
".set noreorder \n"
|
".set noreorder \n"
|
||||||
".set noat \n"
|
".set noat \n"
|
||||||
"sw $s0, 0(%0) \n" /* s0 */
|
"sw $16, 0(%0) \n" /* s0 */
|
||||||
"sw $s1, 4(%0) \n" /* s1 */
|
"sw $17, 4(%0) \n" /* s1 */
|
||||||
"sw $s2, 8(%0) \n" /* s2 */
|
"sw $18, 8(%0) \n" /* s2 */
|
||||||
"sw $s3, 12(%0) \n" /* s3 */
|
"sw $19, 12(%0) \n" /* s3 */
|
||||||
"sw $s4, 16(%0) \n" /* s4 */
|
"sw $20, 16(%0) \n" /* s4 */
|
||||||
"sw $s5, 20(%0) \n" /* s5 */
|
"sw $21, 20(%0) \n" /* s5 */
|
||||||
"sw $s6, 24(%0) \n" /* s6 */
|
"sw $22, 24(%0) \n" /* s6 */
|
||||||
"sw $s7, 28(%0) \n" /* s7 */
|
"sw $23, 28(%0) \n" /* s7 */
|
||||||
"sw $gp, 32(%0) \n" /* gp */
|
"sw $28, 32(%0) \n" /* gp */
|
||||||
"sw $fp, 36(%0) \n" /* fp */
|
"sw $30, 36(%0) \n" /* fp */
|
||||||
"sw $sp, 40(%0) \n" /* sp */
|
"sw $29, 40(%0) \n" /* sp */
|
||||||
"sw $ra, 44(%0) \n" /* ra */
|
"sw $31, 44(%0) \n" /* ra */
|
||||||
".set at \n"
|
".set at \n"
|
||||||
".set reorder \n"
|
".set reorder \n"
|
||||||
: : "r" (addr)
|
: : "r" (addr)
|
||||||
|
@ -86,27 +86,27 @@ static inline void load_context(const void* addr)
|
||||||
asm volatile (
|
asm volatile (
|
||||||
".set noat \n"
|
".set noat \n"
|
||||||
".set noreorder \n"
|
".set noreorder \n"
|
||||||
"lw $t9, 48(%0) \n" /* Get start address ($8 = t0) */
|
"lw $25, 48(%0) \n" /* Get start address (t9 = $25) */
|
||||||
"beqz $t9, running \n" /* NULL -> already running */
|
"beqz $25, running \n" /* NULL -> already running */
|
||||||
"nop \n"
|
"nop \n"
|
||||||
"jr $t9 \n"
|
"jr $25 \n"
|
||||||
"move $a0, %0 \n" /* a0 = context branch delay slot anyway */
|
"move $4, %0 \n" /* a0 = context branch delay slot anyway */
|
||||||
"running: \n"
|
"running: \n"
|
||||||
"lw $s0, 0(%0) \n" /* s0 */
|
"lw $16, 0(%0) \n" /* s0 */
|
||||||
"lw $s1, 4(%0) \n" /* s1 */
|
"lw $17, 4(%0) \n" /* s1 */
|
||||||
"lw $s2, 8(%0) \n" /* s2 */
|
"lw $18, 8(%0) \n" /* s2 */
|
||||||
"lw $s3, 12(%0) \n" /* s3 */
|
"lw $19, 12(%0) \n" /* s3 */
|
||||||
"lw $s4, 16(%0) \n" /* s4 */
|
"lw $20, 16(%0) \n" /* s4 */
|
||||||
"lw $s5, 20(%0) \n" /* s5 */
|
"lw $21, 20(%0) \n" /* s5 */
|
||||||
"lw $s6, 24(%0) \n" /* s6 */
|
"lw $22, 24(%0) \n" /* s6 */
|
||||||
"lw $s7, 28(%0) \n" /* s7 */
|
"lw $23, 28(%0) \n" /* s7 */
|
||||||
"lw $gp, 32(%0) \n" /* gp */
|
"lw $28, 32(%0) \n" /* gp */
|
||||||
"lw $fp, 36(%0) \n" /* fp */
|
"lw $30, 36(%0) \n" /* fp */
|
||||||
"lw $sp, 40(%0) \n" /* sp */
|
"lw $29, 40(%0) \n" /* sp */
|
||||||
"lw $ra, 44(%0) \n" /* ra */
|
"lw $31, 44(%0) \n" /* ra */
|
||||||
".set at \n"
|
".set at \n"
|
||||||
".set reorder \n"
|
".set reorder \n"
|
||||||
: : "r" (addr) : "t9"
|
: : "r" (addr) : "$25"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue