source:
mainline/uspace/lib/c/arch/amd64/src/stacktrace.c@
d7f7a4a
| Last change on this file since d7f7a4a was d7f7a4a, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 752 bytes | |
| Rev | Line | |
|---|---|---|
| [e515b21a] | 1 | /* |
| [d7f7a4a] | 2 | * SPDX-FileCopyrightText: 2010 Jakub Jermar |
| 3 | * SPDX-FileCopyrightText: 2010 Jiri Svoboda | |
| [e515b21a] | 4 | * |
| [d7f7a4a] | 5 | * SPDX-License-Identifier: BSD-3-Clause |
| [e515b21a] | 6 | */ |
| 7 | ||
| 8 | /** @addtogroup libcamd64 amd64 | |
| 9 | * @ingroup lc | |
| 10 | * @{ | |
| 11 | */ | |
| 12 | /** @file | |
| 13 | */ | |
| 14 | ||
| [8d2dd7f2] | 15 | #include <stdint.h> |
| [3e6a98c5] | 16 | #include <stdbool.h> |
| [e515b21a] | 17 | |
| 18 | #include <stacktrace.h> | |
| 19 | ||
| 20 | #define FRAME_OFFSET_FP_PREV 0 | |
| 21 | #define FRAME_OFFSET_RA 8 | |
| 22 | ||
| 23 | bool stacktrace_fp_valid(stacktrace_t *st, uintptr_t fp) | |
| 24 | { | |
| 25 | (void) st; | |
| 26 | return fp != 0; | |
| 27 | } | |
| 28 | ||
| [b7fd2a0] | 29 | errno_t stacktrace_fp_prev(stacktrace_t *st, uintptr_t fp, uintptr_t *prev) |
| [e515b21a] | 30 | { |
| [c1b979a] | 31 | return (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev); |
| [e515b21a] | 32 | } |
| 33 | ||
| [b7fd2a0] | 34 | errno_t stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra) |
| [e515b21a] | 35 | { |
| [c1b979a] | 36 | return (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra); |
| [e515b21a] | 37 | } |
| 38 | ||
| 39 | /** @} | |
| 40 | */ |
Note:
See TracBrowser
for help on using the repository browser.
