os/kernelhwsrv/kernel/eka/compsupp/rvct.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/compsupp/rvct.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,179 @@
     1.4 +// Copyright (c) 2008-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 +// This is the preinclude file for the RVCT compiler. It contains all the compiler
    1.18 +// specific definitions required by the Symbian OS source code.
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +/**
    1.23 + @file
    1.24 + @publishedAll
    1.25 + @released
    1.26 +*/
    1.27 +
    1.28 +#if defined(__PRODUCT_INCLUDE__)
    1.29 +#include __PRODUCT_INCLUDE__
    1.30 +#endif
    1.31 +
    1.32 +// stuff from e32def.h
    1.33 +#define __NO_CLASS_CONSTS__
    1.34 +#define __NORETURN__ __declspec(noreturn)
    1.35 +#define __NORETURN_TERMINATOR()
    1.36 +
    1.37 +#ifndef IMPORT_C
    1.38 +#define IMPORT_C __declspec(dllimport)
    1.39 +#endif
    1.40 +
    1.41 +#ifndef EXPORT_C
    1.42 +#define EXPORT_C __declspec(dllexport)
    1.43 +#endif
    1.44 +
    1.45 +#ifndef IMPORT_D
    1.46 +#if __ARMCC_VERSION < 310000
    1.47 +    #define IMPORT_D __declspec(dllexport)
    1.48 +#else
    1.49 +    #define IMPORT_D __declspec(dllimport)
    1.50 +#endif
    1.51 +#endif
    1.52 +
    1.53 +#ifndef EXPORT_D
    1.54 +#define EXPORT_D __declspec(dllexport)
    1.55 +#endif
    1.56 +
    1.57 +// Used by some of RVCT's header files. For more information, see "C Library ABI for
    1.58 +// the ARM Architecture."
    1.59 +#define _AEABI_PORTABILITY_LEVEL 0
    1.60 +
    1.61 +/**
    1.62 +Declares a class as being non-sharable.
    1.63 +
    1.64 +If a class is non-sharable, then a class implemented in another DLL cannot
    1.65 +derive (inherit) from that class.
    1.66 +
    1.67 +Declaring a class as non-sharable prevents the compiler from exporting compiler
    1.68 +implementation-specific symbols, i.e. run-time type-information and virtual
    1.69 +tables. This prevents classes in other DLLs from being able to derive from it.
    1.70 +
    1.71 +Note :
    1.72 +- if a class is marked as non-sharable, then Symbian OS requires all
    1.73 +classes that are derived from that class, and which are also implemented in the same DLL, 
    1.74 +to be declared as non-sharable.
    1.75 +- by default, a class is sharable.
    1.76 +
    1.77 +The following code fragment shows how a non-sharable class is declared.
    1.78 +
    1.79 +@code
    1.80 +NONSHARABLE_CLASS(CMyClass) : public CBase
    1.81 +{
    1.82 +public :
    1.83 +...
    1.84 +private :
    1.85 +...
    1.86 +}
    1.87 +@endcode
    1.88 +
    1.89 +@param x  The name of the class to be declared as non-sharable.
    1.90 +*/
    1.91 +#define NONSHARABLE_CLASS(x)    class __declspec(notshared) x
    1.92 +#define NONSHARABLE_STRUCT(x)   struct __declspec(notshared) x
    1.93 +
    1.94 +#define __NO_THROW throw ()
    1.95 +#define __THROW(t) throw (t)
    1.96 +
    1.97 +#define TEMPLATE_SPECIALIZATION template<>
    1.98 +
    1.99 +#ifndef __int64
   1.100 +#define __int64  long long
   1.101 +#endif
   1.102 +
   1.103 +#define __VALUE_IN_REGS__ __value_in_regs
   1.104 +
   1.105 +#define	I64LIT(x)	x##LL
   1.106 +#define	UI64LIT(x)	x##ULL
   1.107 +
   1.108 +#define __SOFTFP	__softfp
   1.109 +
   1.110 +// __TText from e32cmn.h also e32des16.h
   1.111 +#ifdef __cplusplus
   1.112 +typedef wchar_t __TText;	// Only ISO C++ has wchar_t as a primitive type
   1.113 +#define __wchar_t_defined
   1.114 +#else
   1.115 +typedef unsigned short __TText;	
   1.116 +#endif
   1.117 +#define __TText_defined
   1.118 +
   1.119 +// __NAKED__ from cpudefs.h
   1.120 +#define __NAKED__ __asm
   1.121 +#define ____ONLY_USE_NAKED_IN_CIA____ __asm
   1.122 +
   1.123 +// Int64 and Uint64 from nkern\nklib.h
   1.124 +typedef long long Int64;
   1.125 +typedef unsigned long long Uint64;
   1.126 +
   1.127 +// Here are RVCT's definitions for stdarg.h
   1.128 +// These should be used by e.g. stdlib
   1.129 +
   1.130 +#ifdef __cplusplus
   1.131 +namespace std { extern "C" {
   1.132 +#endif
   1.133 +
   1.134 +    typedef struct __va_list { void *__ap; } va_list;
   1.135 +
   1.136 +#ifdef __cplusplus
   1.137 +} } 
   1.138 +using ::std::va_list;
   1.139 +#endif
   1.140 +
   1.141 +#define va_start(ap, parmN) __va_start(ap, parmN)
   1.142 +#define va_arg(ap, type)    __va_arg(ap, type)
   1.143 +#define va_end(ap)          ((void)0)
   1.144 +
   1.145 +// These are for Symbian OS C++ code
   1.146 +#define VA_START(ap,pn) va_start(ap, pn)
   1.147 +#define VA_ARG(ap,type) va_arg(ap,type)
   1.148 +#define VA_END(ap)      va_end(ap)
   1.149 +#define VA_LIST va_list
   1.150 +#define __VA_LIST_defined
   1.151 +// This should prevent /stdlib/linc/stdarg.h from doing damage.
   1.152 +#define _STDARG_H
   1.153 +
   1.154 +// now deal with stdarg_e.h
   1.155 +typedef va_list __e32_va_list;
   1.156 +#define _STDARG_E_H
   1.157 +
   1.158 +// This is an EABI compliant compiler
   1.159 +#ifndef __EABI__
   1.160 +#define __EABI__
   1.161 +#endif
   1.162 +
   1.163 +// These are hopefully temporary.
   1.164 +
   1.165 +// defining this means we don't get __NAKED__ ctors
   1.166 +#ifndef __EABI_CTORS__
   1.167 +#define __EABI_CTORS__
   1.168 +#endif
   1.169 +
   1.170 +#ifndef __SYMBIAN_STDCPP_SUPPORT__
   1.171 +	#include <symcpp.h>
   1.172 +#endif
   1.173 +
   1.174 +#ifdef __cplusplus
   1.175 +    // Support for throwing exceptions through embedded assembler Should only be
   1.176 +    // needed user side.
   1.177 +    
   1.178 +    #define	__EH_FRAME_ADDRESS(reg,offset)  FRAME ADDRESS reg, offset
   1.179 +    #define __EH_FRAME_PUSH2(reg1,reg2)     FRAME PUSH {reg1, reg2}
   1.180 +    #define __EH_FRAME_SAVE1(reg,offset)    FRAME SAVE {reg}, offset
   1.181 +#endif
   1.182 +