• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* libunwind - a platform-independent unwind library
2   Copyright (C) 2008 Google, Inc
3	Contributed by Paul Pluzhnikov <ppluzhnikov@google.com>
4   Copyright (C) 2010 Konstantin Belousov <kib@freebsd.org>
5
6This file is part of libunwind.
7
8Permission is hereby granted, free of charge, to any person obtaining
9a copy of this software and associated documentation files (the
10"Software"), to deal in the Software without restriction, including
11without limitation the rights to use, copy, modify, merge, publish,
12distribute, sublicense, and/or sell copies of the Software, and to
13permit persons to whom the Software is furnished to do so, subject to
14the following conditions:
15
16The above copyright notice and this permission notice shall be
17included in all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
26
27#include "offsets.h"
28
29/*  int _Uaarch64_getcontext_trace (unw_tdep_context_t *ucp)
30
31  Saves limited machine context in UCP necessary for fast trace. If fast trace
32  fails, caller will have to get the full context.
33*/
34
35	.global _Uaarch64_getcontext_trace
36	.hidden _Uaarch64_getcontext_trace
37	.type _Uaarch64_getcontext_trace, @function
38_Uaarch64_getcontext_trace:
39	.cfi_startproc
40
41	/* Save only FP, SP, PC - exclude this call. */
42	str x29, [x0, #(LINUX_UC_MCONTEXT_OFF + LINUX_SC_X29_OFF)]
43	mov x9, sp
44	str x9, [x0, #(LINUX_UC_MCONTEXT_OFF + LINUX_SC_SP_OFF)]
45	str x30, [x0, #(LINUX_UC_MCONTEXT_OFF + LINUX_SC_PC_OFF)]
46
47	ret
48	.cfi_endproc
49	.size _Uaarch64_getcontext_trace, . - _Uaarch64_getcontext_trace
50
51      /* We do not need executable stack.  */
52      .section        .note.GNU-stack,"",@progbits
53