Changeset 6d123b3 in mainline for uspace/lib/c/arch/mips32/src


Ignore:
Timestamp:
2012-03-13T15:23:11Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
145d16f8
Parents:
df366b5e
Message:

respect the o32 ABI when calling C functions from assembler and creating contexts
(thx Adam Hraska)

Location:
uspace/lib/c/arch/mips32/src
Files:
3 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/mips32/src/entry.S

    rdf366b5e r6d123b3  
    2727#
    2828
     29#include <libarch/stack.h>
     30
    2931.text
    3032.section .init, "ax"
     
    4143.ent __entry
    4244__entry:
    43         .frame $sp, 32, $31
    44         .cpload $25
     45        .frame $sp, ABI_STACK_FRAME, $ra
     46        .cpload $t9
    4547       
    46         # FIXME: Reflect exactly ABI specs here
     48        # Allocate the stack frame.
     49        addiu $sp, -ABI_STACK_FRAME
    4750       
    48         addiu $sp, -32
    49         .cprestore 16   # Allow PIC code
     51        # Allow PIC code
     52        .cprestore 16
    5053       
    51         # Pass pcb_ptr to __main() as the first argument. pcb_ptr is already
     54        # Pass pcb_ptr to __main() as the first argument. It is already
    5255        # in $a0. As the first argument is passed in $a0, no operation
    5356        # is needed.
     
    5558        jal __main
    5659        nop
    57 .end
     60       
     61        #
     62        # Not reached.
     63        #
     64        addiu $sp, ABI_STACK_FRAME
     65.end __entry
  • uspace/lib/c/arch/mips32/src/entryjmp.S

    rdf366b5e r6d123b3  
    2727#
    2828
     29#include <libarch/stack.h>
     30
    2931.text
    3032.section .text
     
    4143entry_point_jmp:
    4244        # tmp := entry_point
    43         move $25, $a0
     45        move $t9, $a0
    4446       
    4547        # Pass pcb to the entry point in $a0
    4648        move $a0, $a1
    47         jr $25
    48         nop
    49 .end
     49       
     50        jr $t9
     51        addiu $sp, -ABI_STACK_FRAME
     52        addiu $sp, ABI_STACK_FRAME
     53.end entry_point_jmp
  • uspace/lib/c/arch/mips32/src/thread_entry.S

    rdf366b5e r6d123b3  
    2727#
    2828
     29#include <libarch/stack.h>
     30
    2931.text
    3032
     
    4042.ent __thread_entry
    4143__thread_entry:
    42         .frame $sp, 32, $31
    43         .cpload $25
     44        .frame $sp, ABI_STACK_FRAME, $ra
     45        .cpload $t9
    4446       
    4547        #
    4648        # v0 contains address of uarg.
    4749        #
    48         add $4, $2, 0
     50        add $a0, $v0, 0
    4951       
    50         addiu $sp, -32
     52        # Allocate the stack frame.
     53        addiu $sp, -ABI_STACK_FRAME
     54       
     55        # Allow PIC code
    5156        .cprestore 16
    5257       
     
    5762        # Not reached.
    5863        #
     64        addiu $sp, ABI_STACK_FRAME
    5965.end __thread_entry
Note: See TracChangeset for help on using the changeset viewer.