1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/compsupp/rvct2_1/rvct2_1.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,194 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "ARM EABI LICENCE.txt"
1.8 +// which accompanies this distribution, and is available
1.9 +// in kernel/eka/compsupp.
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32\compsupp\rvct2_1\rvct2_1.h
1.18 +// This is the preinclude file for the rvct 2.1 compiler
1.19 +// It contains all the compiler specific definitions required by the SOS source
1.20 +//
1.21 +//
1.22 +
1.23 +/**
1.24 + @file
1.25 + @publishedAll
1.26 + @released
1.27 +*/
1.28 +
1.29 +#ifdef __ARMCC_VERSION
1.30 +#if (__ARMCC_VERSION < 210000 || __ARMCC_VERSION >= 220000)
1.31 +#error This instantiation of the build requires use of RVCT 2.1
1.32 +#endif
1.33 +#endif
1.34 +
1.35 +#if defined(__PRODUCT_INCLUDE__)
1.36 +#include __PRODUCT_INCLUDE__
1.37 +#endif
1.38 +
1.39 +
1.40 +// stuff from e32def.h
1.41 +#define __NO_CLASS_CONSTS__
1.42 +#define __NORETURN__ __declspec(noreturn)
1.43 +#define __NORETURN_TERMINATOR()
1.44 +#define IMPORT_C __declspec(dllimport)
1.45 +#define EXPORT_C __declspec(dllexport)
1.46 +
1.47 +
1.48 +
1.49 +
1.50 +/**
1.51 +Declares a class as being non-sharable.
1.52 +
1.53 +If a class is non-sharable, then a class implemented in another DLL cannot
1.54 +derive (inherit) from that class.
1.55 +
1.56 +Declaring a class as non-sharable prevents the compiler from exporting compiler
1.57 +implementation-specific symbols, i.e. run-time type-information and virtual
1.58 +tables. This prevents classes in other DLLs from being able to derive from it.
1.59 +
1.60 +Note :
1.61 +- if a class is marked as non-sharable, then Symbian OS requires all
1.62 +classes that are derived from that class, and which are also implemented in the same DLL,
1.63 +to be declared as non-sharable.
1.64 +- by default, a class is sharable.
1.65 +
1.66 +The following code fragment shows how a non-sharable class is declared.
1.67 +
1.68 +@code
1.69 +NONSHARABLE_CLASS(CMyClass) : public CBase
1.70 +{
1.71 +public :
1.72 +...
1.73 +private :
1.74 +...
1.75 +}
1.76 +@endcode
1.77 +
1.78 +@param x The name of the class to be declared as non-sharable.
1.79 +*/
1.80 +#define NONSHARABLE_CLASS(x) class __declspec(notshared) x
1.81 +#define NONSHARABLE_STRUCT(x) struct __declspec(notshared) x
1.82 +#define __NO_THROW throw ()
1.83 +#define __THROW(t) throw (t)
1.84 +#define TEMPLATE_SPECIALIZATION template<>
1.85 +#ifndef __int64
1.86 +#define __int64 long long
1.87 +#endif
1.88 +#define __VALUE_IN_REGS__ __value_in_regs
1.89 +#define I64LIT(x) x##LL
1.90 +#define UI64LIT(x) x##ULL
1.91 +#define __SOFTFP __softfp
1.92 +
1.93 +// __TText from e32cmn.h also e32des16.h
1.94 +#ifdef __cplusplus
1.95 +typedef wchar_t __TText; // Only ISO C++ has wchar_t as a primitive type
1.96 +#define __wchar_t_defined
1.97 +#else
1.98 +typedef unsigned short __TText;
1.99 +#endif
1.100 +#define __TText_defined
1.101 +
1.102 +// __NAKED__ from cpudefs.h
1.103 +#define __NAKED__ __asm
1.104 +#define ____ONLY_USE_NAKED_IN_CIA____ __asm
1.105 +
1.106 +// Int64 and Uint64 from nkern\nklib.h
1.107 +typedef long long Int64;
1.108 +typedef unsigned long long Uint64;
1.109 +
1.110 +// Here are RVCT 2.0's definitions for stdarg.h
1.111 +// These should be used by e.g. stdlib
1.112 +
1.113 +// see if we're using the BETA B compiler
1.114 +#if (__ARMCC_VERSION == 200022)
1.115 +#define RVCTBETA
1.116 +#endif
1.117 +
1.118 +#ifdef __cplusplus
1.119 + namespace std {
1.120 + extern "C" {
1.121 +#endif /* __cplusplus */
1.122 +
1.123 +#ifdef RVCTBETA
1.124 + typedef int *va_list[1];
1.125 +#else
1.126 + typedef struct __va_list { void *__ap; } va_list;
1.127 +#endif
1.128 +
1.129 +#ifdef __cplusplus
1.130 + } /* extern "C" */
1.131 + } /* namespace std */
1.132 +
1.133 + using ::std::va_list;
1.134 +#endif
1.135 +
1.136 +#define va_start(ap, parmN) __va_start(ap, parmN)
1.137 +#define va_arg(ap, type) __va_arg(ap, type)
1.138 +#define va_end(ap) ((void)0)
1.139 +
1.140 +// These are for Symbian OS C++ code
1.141 +#define VA_START(ap,pn) va_start(ap, pn)
1.142 +#define VA_ARG(ap,type) va_arg(ap,type)
1.143 +#define VA_END(ap) va_end(ap)
1.144 +#define VA_LIST va_list
1.145 +#define __VA_LIST_defined
1.146 +// This should prevent /stdlib/linc/stdarg.h from doing damage.
1.147 +#define _STDARG_H
1.148 +
1.149 +// now deal with stdarg_e.h
1.150 +typedef va_list __e32_va_list;
1.151 +#define _STDARG_E_H
1.152 +
1.153 +// This is an EABI compliant compiler
1.154 +#ifndef __EABI__
1.155 +#define __EABI__
1.156 +#endif
1.157 +
1.158 +// these are hopefully temporary
1.159 +
1.160 +// defining this means we don't get __NAKED__ ctors
1.161 +#ifndef __EABI_CTORS__
1.162 +#define __EABI_CTORS__
1.163 +#endif
1.164 +
1.165 +//#define __EARLY_DEBUG__
1.166 +
1.167 +// Deal with operator new issues here
1.168 +#ifdef __cplusplus
1.169 +namespace std {
1.170 + struct nothrow_t { };
1.171 + extern const nothrow_t nothrow;
1.172 +}
1.173 +
1.174 +IMPORT_C void* operator new(unsigned int aSize) __NO_THROW;
1.175 +
1.176 +IMPORT_C void* operator new[](unsigned int aSize) __NO_THROW;
1.177 +
1.178 +IMPORT_C void* operator new(unsigned int aSize, const std::nothrow_t& aNoThrow) __NO_THROW;
1.179 +
1.180 +IMPORT_C void* operator new[](unsigned int aSize, const std::nothrow_t& aNoThrow) __NO_THROW;
1.181 +
1.182 +IMPORT_C void operator delete(void* aPtr) __NO_THROW;
1.183 +
1.184 +IMPORT_C void operator delete[](void* aPtr) __NO_THROW;
1.185 +
1.186 +IMPORT_C void operator delete(void* aPtr, const std::nothrow_t& aNoThrow) __NO_THROW;
1.187 +
1.188 +IMPORT_C void operator delete[](void* aPtr, const std::nothrow_t& aNoThrow) __NO_THROW;
1.189 +
1.190 +// Support for throwing exceptions through embedded assembler
1.191 +// Should only be needed user side
1.192 +
1.193 +#define __EH_FRAME_ADDRESS(reg,offset) FRAME ADDRESS reg, offset
1.194 +#define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2}
1.195 +#define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset
1.196 +
1.197 +#endif