184d9c625SLionel Sambuc /*-
284d9c625SLionel Sambuc * Copyright (c) 2013 The NetBSD Foundation, Inc.
384d9c625SLionel Sambuc * All rights reserved.
484d9c625SLionel Sambuc *
584d9c625SLionel Sambuc * Redistribution and use in source and binary forms, with or without
684d9c625SLionel Sambuc * modification, are permitted provided that the following conditions
784d9c625SLionel Sambuc * are met:
884d9c625SLionel Sambuc * 1. Redistributions of source code must retain the above copyright
984d9c625SLionel Sambuc * notice, this list of conditions and the following disclaimer.
1084d9c625SLionel Sambuc * 2. Redistributions in binary form must reproduce the above copyright
1184d9c625SLionel Sambuc * notice, this list of conditions and the following disclaimer in the
1284d9c625SLionel Sambuc * documentation and/or other materials provided with the distribution.
1384d9c625SLionel Sambuc *
1484d9c625SLionel Sambuc * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
1584d9c625SLionel Sambuc * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1684d9c625SLionel Sambuc * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1784d9c625SLionel Sambuc * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
1884d9c625SLionel Sambuc * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1984d9c625SLionel Sambuc * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2084d9c625SLionel Sambuc * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2184d9c625SLionel Sambuc * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2284d9c625SLionel Sambuc * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2384d9c625SLionel Sambuc * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2484d9c625SLionel Sambuc * POSSIBILITY OF SUCH DAMAGE.
2584d9c625SLionel Sambuc */
26*0a6a1f1dSLionel Sambuc
27*0a6a1f1dSLionel Sambuc #ifndef __ARM_DWARF_EH__
2884d9c625SLionel Sambuc #include <sys/cdefs.h>
2984d9c625SLionel Sambuc #include <sys/types.h>
3084d9c625SLionel Sambuc #include "unwind.h"
3184d9c625SLionel Sambuc
3284d9c625SLionel Sambuc void _Unwind_VRS_Get(struct _Unwind_Context *, int, _Unwind_Word, int, void *);
3384d9c625SLionel Sambuc void _Unwind_VRS_Set(struct _Unwind_Context *, int, _Unwind_Word, int, void *);
3484d9c625SLionel Sambuc
3584d9c625SLionel Sambuc _Unwind_Word
_Unwind_GetGR(struct _Unwind_Context * context,int regno)3684d9c625SLionel Sambuc _Unwind_GetGR(struct _Unwind_Context *context, int regno)
3784d9c625SLionel Sambuc {
3884d9c625SLionel Sambuc _Unwind_Word val;
3984d9c625SLionel Sambuc _Unwind_VRS_Get(context, 0 /*_UVRSC_CORE*/, regno, 0 /*_UVRSD_UINT32*/,
4084d9c625SLionel Sambuc &val);
4184d9c625SLionel Sambuc
4284d9c625SLionel Sambuc return val;
4384d9c625SLionel Sambuc }
4484d9c625SLionel Sambuc
4584d9c625SLionel Sambuc _Unwind_Ptr
_Unwind_GetIP(struct _Unwind_Context * context)4684d9c625SLionel Sambuc _Unwind_GetIP(struct _Unwind_Context *context)
4784d9c625SLionel Sambuc {
4884d9c625SLionel Sambuc return (_Unwind_Ptr)(_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1);
4984d9c625SLionel Sambuc }
5084d9c625SLionel Sambuc
5184d9c625SLionel Sambuc _Unwind_Ptr
_Unwind_GetIPInfo(struct _Unwind_Context * context,int * p)5284d9c625SLionel Sambuc _Unwind_GetIPInfo(struct _Unwind_Context *context, int *p)
5384d9c625SLionel Sambuc {
5484d9c625SLionel Sambuc *p = 0;
5584d9c625SLionel Sambuc return _Unwind_GetIP(context);
5684d9c625SLionel Sambuc }
5784d9c625SLionel Sambuc
5884d9c625SLionel Sambuc void
_Unwind_SetGR(struct _Unwind_Context * context,int reg,_Unwind_Ptr val)5984d9c625SLionel Sambuc _Unwind_SetGR(struct _Unwind_Context *context, int reg, _Unwind_Ptr val)
6084d9c625SLionel Sambuc {
6184d9c625SLionel Sambuc _Unwind_VRS_Set(context, 0 /*_UVRSC_CORE*/, reg, 0 /*_UVRSD_UINT32*/,
6284d9c625SLionel Sambuc &val);
6384d9c625SLionel Sambuc }
64*0a6a1f1dSLionel Sambuc
65*0a6a1f1dSLionel Sambuc #endif /* __ARM_DWARF_EH__ */
66