Ignore:
Timestamp:
2013-12-31T07:57:14Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b973dc
Parents:
6297465 (diff), 208b5f5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

mainline changes

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/sparc32/src/stacktrace_asm.S

    r6297465 r4c14b88  
    11#
    2 # Copyright (c) 2008 Josef Cejka
     2# Copyright (c) 2009 Jakub Jermar
    33# All rights reserved.
    44#
     
    2727#
    2828
    29 #include <libarch/context_offset.h>
     29#include <libarch/stack.h>
    3030
    3131.text
    32 .global setjmp
    33 .global longjmp
    3432
    35 .type setjmp,@function
    36 setjmp:
    37         movl 0(%esp), %eax  # save pc value into eax
    38         movl 4(%esp), %edx  # address of the jmp_buf structure to save context to
     33.global stacktrace_prepare
     34.global stacktrace_fp_get
     35.global stacktrace_pc_get
     36
     37stacktrace_prepare:
     38        save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE+STACK_ARG_SAVE_AREA_SIZE), %sp
    3939       
    40         # save registers to the jmp_buf structure
    41         CONTEXT_SAVE_ARCH_CORE %edx %eax
     40        # Flush all other windows to memory so that we can read their contents.
    4241       
    43         xorl %eax, %eax     # set_jmp returns 0
     42        mov 7, %g1
     43        1:
     44                subcc %g1, 1, %g1
     45                bg 1b
     46                save %sp, -64, %sp
     47       
     48        mov 7, %g1
     49        1:
     50                subcc %g1, 1, %g1
     51                bg 1b
     52       
    4453        ret
     54        restore
    4555
    46 .type longjmp,@function
    47 longjmp:
    48         movl 4(%esp), %ecx  # put address of jmp_buf into ecx
    49         movl 8(%esp), %eax  # put return value into eax
    50        
    51         # restore registers from the jmp_buf structure
    52         CONTEXT_RESTORE_ARCH_CORE %ecx %edx
    53        
    54         movl %edx, 0(%esp)  # put saved pc on stack
    55         ret
     56stacktrace_fp_get:
     57        # Add the stack bias to %sp to get the actual address.
     58        retl
     59        mov %sp,  %o0
     60
     61stacktrace_pc_get:
     62        retl
     63        mov %o7, %o0
Note: See TracChangeset for help on using the changeset viewer.