1169691Skan// Control various target specific ABI tweaks.  ARM version.
2169691Skan
3169691Skan// Copyright (C) 2004, 2006 Free Software Foundation, Inc.
4169691Skan//
5169691Skan// This file is part of the GNU ISO C++ Library.  This library is free
6169691Skan// software; you can redistribute it and/or modify it under the
7169691Skan// terms of the GNU General Public License as published by the
8169691Skan// Free Software Foundation; either version 2, or (at your option)
9169691Skan// any later version.
10169691Skan
11169691Skan// This library is distributed in the hope that it will be useful,
12169691Skan// but WITHOUT ANY WARRANTY; without even the implied warranty of
13169691Skan// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14169691Skan// GNU General Public License for more details.
15169691Skan
16169691Skan// You should have received a copy of the GNU General Public License along
17169691Skan// with this library; see the file COPYING.  If not, write to the Free
18169691Skan// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19169691Skan// USA.
20169691Skan
21169691Skan// As a special exception, you may use this file as part of a free software
22169691Skan// library without restriction.  Specifically, if other files instantiate
23169691Skan// templates or use macros or inline functions from this file, or you compile
24169691Skan// this file and link it with other files to produce an executable, this
25169691Skan// file does not by itself cause the resulting executable to be covered by
26169691Skan// the GNU General Public License.  This exception does not however
27169691Skan// invalidate any other reasons why the executable file might be covered by
28169691Skan// the GNU General Public License.
29169691Skan
30169691Skan/** @file cxxabi_tweaks.h
31169691Skan *  The header provides an CPU-variable interface to the C++ ABI.
32169691Skan */
33169691Skan
34169691Skan#ifndef _CXXABI_TWEAKS_H
35169691Skan#define _CXXABI_TWEAKS_H 1
36169691Skan
37169691Skan#ifdef __cplusplus
38169691Skannamespace __cxxabiv1
39169691Skan{
40169691Skan  extern "C"
41169691Skan  {
42169691Skan#endif
43169691Skan
44169691Skan#ifdef __ARM_EABI__
45169691Skan  // The ARM EABI uses the least significant bit of a 32-bit
46169691Skan  // guard variable.  */
47169691Skan#define _GLIBCXX_GUARD_TEST(x) ((*(x) & 1) != 0)
48169691Skan#define _GLIBCXX_GUARD_SET(x) *(x) = 1
49169691Skan  typedef int __guard;
50169691Skan
51169691Skan  // We also want the element size in array cookies.
52169691Skan#define _GLIBCXX_ELTSIZE_IN_COOKIE 1
53169691Skan
54169691Skan  // __cxa_vec_ctor should return a pointer to the array.
55169691Skan  typedef void * __cxa_vec_ctor_return_type;
56169691Skan#define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return x
57169691Skan  // Constructors and destructors return the "this" pointer.
58169691Skan  typedef void * __cxa_cdtor_return_type;
59169691Skan
60169691Skan#else // __ARM_EABI__
61169691Skan
62169691Skan  // The generic ABI uses the first byte of a 64-bit guard variable.
63169691Skan#define _GLIBCXX_GUARD_TEST(x) (*(char *) (x) != 0)
64169691Skan#define _GLIBCXX_GUARD_SET(x) *(char *) (x) = 1
65169691Skan  __extension__ typedef int __guard __attribute__((mode (__DI__)));
66169691Skan
67169691Skan  // __cxa_vec_ctor has void return type.
68169691Skan  typedef void __cxa_vec_ctor_return_type;
69169691Skan#define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return
70169691Skan  // Constructors and destructors do not return a value.
71169691Skan  typedef void __cxa_cdtor_return_type;
72169691Skan
73169691Skan#endif //!__ARM_EABI__
74169691Skan
75169691Skan#ifdef __cplusplus
76169691Skan  }
77169691Skan} // namespace __cxxabiv1
78169691Skan#endif
79169691Skan
80169691Skan#endif
81