|
libstdc++
|
00001 // Control various target specific ABI tweaks. ARM version. 00002 00003 // Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc. 00004 // 00005 // This file is part of the GNU ISO C++ Library. This library is free 00006 // software; you can redistribute it and/or modify it under the 00007 // terms of the GNU General Public License as published by the 00008 // Free Software Foundation; either version 3, or (at your option) 00009 // any later version. 00010 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 00016 // Under Section 7 of GPL version 3, you are granted additional 00017 // permissions described in the GCC Runtime Library Exception, version 00018 // 3.1, as published by the Free Software Foundation. 00019 00020 // You should have received a copy of the GNU General Public License and 00021 // a copy of the GCC Runtime Library Exception along with this program; 00022 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 00023 // <http://www.gnu.org/licenses/>. 00024 00025 /** @file cxxabi_tweaks.h 00026 * The header provides an CPU-variable interface to the C++ ABI. 00027 */ 00028 00029 #ifndef _CXXABI_TWEAKS_H 00030 #define _CXXABI_TWEAKS_H 1 00031 00032 #ifdef __cplusplus 00033 namespace __cxxabiv1 00034 { 00035 extern "C" 00036 { 00037 #endif 00038 00039 #ifdef __ARM_EABI__ 00040 // The ARM EABI uses the least significant bit of a 32-bit 00041 // guard variable. */ 00042 #define _GLIBCXX_GUARD_TEST(x) ((*(x) & 1) != 0) 00043 #define _GLIBCXX_GUARD_SET(x) *(x) = 1 00044 #define _GLIBCXX_GUARD_BIT 1 00045 #define _GLIBCXX_GUARD_PENDING_BIT __guard_test_bit (1, 1) 00046 #define _GLIBCXX_GUARD_WAITING_BIT __guard_test_bit (2, 1) 00047 typedef int __guard; 00048 00049 // We also want the element size in array cookies. 00050 #define _GLIBCXX_ELTSIZE_IN_COOKIE 1 00051 00052 // __cxa_vec_ctor should return a pointer to the array. 00053 typedef void * __cxa_vec_ctor_return_type; 00054 #define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return x 00055 // Constructors and destructors return the "this" pointer. 00056 typedef void * __cxa_cdtor_return_type; 00057 00058 #else // __ARM_EABI__ 00059 00060 // The generic ABI uses the first byte of a 64-bit guard variable. 00061 #define _GLIBCXX_GUARD_TEST(x) (*(char *) (x) != 0) 00062 #define _GLIBCXX_GUARD_SET(x) *(char *) (x) = 1 00063 #define _GLIBCXX_GUARD_BIT __guard_test_bit (0, 1) 00064 #define _GLIBCXX_GUARD_PENDING_BIT __guard_test_bit (1, 1) 00065 #define _GLIBCXX_GUARD_WAITING_BIT __guard_test_bit (2, 1) 00066 __extension__ typedef int __guard __attribute__((mode (__DI__))); 00067 00068 // __cxa_vec_ctor has void return type. 00069 typedef void __cxa_vec_ctor_return_type; 00070 #define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return 00071 // Constructors and destructors do not return a value. 00072 typedef void __cxa_cdtor_return_type; 00073 00074 #endif //!__ARM_EABI__ 00075 00076 #ifdef __cplusplus 00077 } 00078 } // namespace __cxxabiv1 00079 #endif 00080 00081 #endif