Changeset 4c14b88 in mainline for uspace/lib/c/arch/sparc32/src/stacktrace_asm.S
- Timestamp:
- 2013-12-31T07:57:14Z (11 years ago)
- 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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/sparc32/src/stacktrace_asm.S
r6297465 r4c14b88 1 1 # 2 # Copyright (c) 200 8 Josef Cejka2 # Copyright (c) 2009 Jakub Jermar 3 3 # All rights reserved. 4 4 # … … 27 27 # 28 28 29 #include <libarch/ context_offset.h>29 #include <libarch/stack.h> 30 30 31 31 .text 32 .global setjmp33 .global longjmp34 32 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 37 stacktrace_prepare: 38 save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE+STACK_ARG_SAVE_AREA_SIZE), %sp 39 39 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. 42 41 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 44 53 ret 54 restore 45 55 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 56 stacktrace_fp_get: 57 # Add the stack bias to %sp to get the actual address. 58 retl 59 mov %sp, %o0 60 61 stacktrace_pc_get: 62 retl 63 mov %o7, %o0
Note:
See TracChangeset
for help on using the changeset viewer.