1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _ARM_SHARE_HXX
24 #define _ARM_SHARE_HXX
25 #include "uno/mapping.h"
26 
27 #include <typeinfo>
28 #include <exception>
29 #include <cstddef>
30 #include <unwind.h>
31 
32 namespace CPPU_CURRENT_NAMESPACE
33 {
34 
35     void dummy_can_throw_anything( char const * );
36 
37     // -- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
38 
39     struct __cxa_exception
40     {
41         ::std::type_info *exceptionType;
42         void (*exceptionDestructor)(void *);
43 
44         ::std::unexpected_handler unexpectedHandler;
45         ::std::terminate_handler terminateHandler;
46 
47         __cxa_exception *nextException;
48 
49         int handlerCount;
50 #ifdef __ARM_EABI__
51 	__cxa_exception *nextPropagatingException;
52 	int propagationCount;
53 #else
54         int handlerSwitchValue;
55         const unsigned char *actionRecord;
56         const unsigned char *languageSpecificData;
57         void *catchTemp;
58         void *adjustedPtr;
59 #endif
60         _Unwind_Exception unwindHeader;
61     };
62 
63     extern "C" void *__cxa_allocate_exception(
64         std::size_t thrown_size ) throw();
65     extern "C" void __cxa_throw (
66         void *thrown_exception, std::type_info *tinfo,
67         void (*dest) (void *) ) __attribute__((noreturn));
68 
69     struct __cxa_eh_globals
70     {
71         __cxa_exception *caughtExceptions;
72         unsigned int uncaughtExceptions;
73 #ifdef __ARM_EABI__
74 	__cxa_exception *propagatingExceptions;
75 #endif
76     };
77     extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
78 
79     // -----
80 
81     //====================================================================
82     void raiseException(
83         uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
84     //====================================================================
85     void fillUnoException(
86         __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
87 }
88 
89 namespace arm
90 {
91     enum armlimits { MAX_GPR_REGS = 4 };
92     bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef );
93 }
94 
95 #endif
96 /* vi:set tabstop=4 shiftwidth=4 expandtab: */
97