1/* libunwind - a platform-independent unwind library
2   Copyright (C) 2008 CodeSourcery
3
4This file is part of libunwind.
5
6Permission is hereby granted, free of charge, to any person obtaining
7a copy of this software and associated documentation files (the
8"Software"), to deal in the Software without restriction, including
9without limitation the rights to use, copy, modify, merge, publish,
10distribute, sublicense, and/or sell copies of the Software, and to
11permit persons to whom the Software is furnished to do so, subject to
12the following conditions:
13
14The above copyright notice and this permission notice shall be
15included in all copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
24
25#include "init.h"
26#include "unwind_i.h"
27
28PROTECTED int
29unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg)
30{
31#ifdef UNW_LOCAL_ONLY
32  return -UNW_EINVAL;
33#else /* !UNW_LOCAL_ONLY */
34  struct cursor *c = (struct cursor *) cursor;
35
36  if (!tdep_init_done)
37    tdep_init ();
38
39  Debug (1, "(cursor=%p)\n", c);
40
41  c->dwarf.as = as;
42  c->dwarf.as_arg = as_arg;
43  return common_init (c, 0);
44#endif /* !UNW_LOCAL_ONLY */
45}
46