Ignore:
Timestamp:
2009-12-30T18:34:15Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
01fda09
Parents:
ee2f1aae
Message:

Pair the stack frame address and the return address in a more meaningful way.
Also do the 'right' thing on sparc64 and recognize the end of the stack trace
by -0x7ff stored in %fp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/arch/sparc64/src/stacktrace.S

    ree2f1aae r47246f4  
    2727#
    2828
     29#include <libarch/stack.h>
     30
    2931.text
    3032
     
    3335.global frame_pointer_validate
    3436.global return_address_get
     37.global program_counter_get
    3538
    3639frame_pointer_get:
    3740        # Add the stack bias to %sp to get the actual address.
    3841        retl
    39         add %sp, 0x7ff, %o0
     42        add %sp, STACK_BIAS, %o0
    4043
    4144frame_pointer_prev:
    42         save %sp, -176, %sp
     45        save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE+STACK_ARG_SAVE_AREA_SIZE), %sp
    4346        # Flush all other windows to memory so that we can read their contents.
    4447        flushw
     
    4649        ldx [%i0 + 14 * 8], %i0
    4750        # Add the stack bias to the %fp read from the window save area.
    48         add %i0, 0x7ff, %i0
     51        add %i0, STACK_BIAS, %i0
    4952        ret
    5053        restore
    5154
    5255frame_pointer_validate:
    53         #
    54         # Fall through - we detect the last frame in the trace by zero %i7.
    55         #
     56        retl
     57        nop
    5658
    5759return_address_get:
    58         save %sp, -176, %sp
     60        save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE+STACK_ARG_SAVE_AREA_SIZE), %sp
    5961        # Flush all other windows to memory so that we can read their contents.
    6062        flushw
     
    6365        ret
    6466        restore
     67
     68program_counter_get:
     69        retl
     70        mov %o7, %o0
     71
Note: See TracChangeset for help on using the changeset viewer.