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