os/kernelhwsrv/kernel/eka/compsupp/rvct2_1/rvct2_1.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "ARM EABI LICENCE.txt"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// in kernel/eka/compsupp.
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// e32\compsupp\rvct2_1\rvct2_1.h
sl@0
    15
// This is the preinclude file for the rvct 2.1 compiler
sl@0
    16
// It contains all the compiler specific definitions required by the SOS source
sl@0
    17
// 
sl@0
    18
//
sl@0
    19
sl@0
    20
/**
sl@0
    21
 @file
sl@0
    22
 @publishedAll
sl@0
    23
 @released
sl@0
    24
*/
sl@0
    25
sl@0
    26
#ifdef __ARMCC_VERSION
sl@0
    27
#if (__ARMCC_VERSION < 210000 || __ARMCC_VERSION >= 220000)
sl@0
    28
#error This instantiation of the build requires use of RVCT 2.1
sl@0
    29
#endif
sl@0
    30
#endif
sl@0
    31
sl@0
    32
#if defined(__PRODUCT_INCLUDE__)
sl@0
    33
#include __PRODUCT_INCLUDE__
sl@0
    34
#endif
sl@0
    35
sl@0
    36
sl@0
    37
// stuff from e32def.h
sl@0
    38
#define __NO_CLASS_CONSTS__
sl@0
    39
#define __NORETURN__ __declspec(noreturn)
sl@0
    40
#define __NORETURN_TERMINATOR()
sl@0
    41
#define IMPORT_C __declspec(dllimport) 
sl@0
    42
#define EXPORT_C __declspec(dllexport)
sl@0
    43
sl@0
    44
sl@0
    45
sl@0
    46
sl@0
    47
/**
sl@0
    48
Declares a class as being non-sharable.
sl@0
    49
sl@0
    50
If a class is non-sharable, then a class implemented in another DLL cannot
sl@0
    51
derive (inherit) from that class.
sl@0
    52
sl@0
    53
Declaring a class as non-sharable prevents the compiler from exporting compiler
sl@0
    54
implementation-specific symbols, i.e. run-time type-information and virtual
sl@0
    55
tables. This prevents classes in other DLLs from being able to derive from it.
sl@0
    56
sl@0
    57
Note :
sl@0
    58
- if a class is marked as non-sharable, then Symbian OS requires all
sl@0
    59
classes that are derived from that class, and which are also implemented in the same DLL, 
sl@0
    60
to be declared as non-sharable.
sl@0
    61
- by default, a class is sharable.
sl@0
    62
sl@0
    63
The following code fragment shows how a non-sharable class is declared.
sl@0
    64
sl@0
    65
@code
sl@0
    66
NONSHARABLE_CLASS(CMyClass) : public CBase
sl@0
    67
{
sl@0
    68
public :
sl@0
    69
...
sl@0
    70
private :
sl@0
    71
...
sl@0
    72
}
sl@0
    73
@endcode
sl@0
    74
sl@0
    75
@param x  The name of the class to be declared as non-sharable.
sl@0
    76
*/
sl@0
    77
#define NONSHARABLE_CLASS(x) class __declspec(notshared) x
sl@0
    78
#define NONSHARABLE_STRUCT(x) struct __declspec(notshared) x
sl@0
    79
#define __NO_THROW throw ()
sl@0
    80
#define __THROW(t) throw (t)
sl@0
    81
#define TEMPLATE_SPECIALIZATION template<>
sl@0
    82
#ifndef __int64
sl@0
    83
#define __int64  long long
sl@0
    84
#endif
sl@0
    85
#define __VALUE_IN_REGS__ __value_in_regs
sl@0
    86
#define	I64LIT(x)	x##LL
sl@0
    87
#define	UI64LIT(x)	x##ULL
sl@0
    88
#define __SOFTFP	__softfp
sl@0
    89
sl@0
    90
// __TText from e32cmn.h also e32des16.h
sl@0
    91
#ifdef __cplusplus
sl@0
    92
typedef wchar_t __TText;	// Only ISO C++ has wchar_t as a primitive type
sl@0
    93
#define __wchar_t_defined
sl@0
    94
#else
sl@0
    95
typedef unsigned short __TText;	
sl@0
    96
#endif
sl@0
    97
#define __TText_defined
sl@0
    98
sl@0
    99
// __NAKED__ from cpudefs.h
sl@0
   100
#define __NAKED__ __asm
sl@0
   101
#define ____ONLY_USE_NAKED_IN_CIA____ __asm
sl@0
   102
sl@0
   103
// Int64 and Uint64 from nkern\nklib.h
sl@0
   104
typedef long long Int64;
sl@0
   105
typedef unsigned long long Uint64;
sl@0
   106
sl@0
   107
// Here are RVCT 2.0's definitions for stdarg.h
sl@0
   108
// These should be used by e.g. stdlib
sl@0
   109
sl@0
   110
// see if we're using the BETA B compiler
sl@0
   111
#if (__ARMCC_VERSION == 200022)
sl@0
   112
#define RVCTBETA
sl@0
   113
#endif
sl@0
   114
sl@0
   115
#ifdef __cplusplus
sl@0
   116
    namespace std {
sl@0
   117
        extern "C" {
sl@0
   118
#endif  /* __cplusplus */
sl@0
   119
sl@0
   120
#ifdef RVCTBETA
sl@0
   121
	  typedef int *va_list[1];
sl@0
   122
#else
sl@0
   123
	  typedef struct __va_list { void *__ap; } va_list;
sl@0
   124
#endif
sl@0
   125
sl@0
   126
#ifdef __cplusplus
sl@0
   127
	}  /* extern "C" */
sl@0
   128
    }  /* namespace std */
sl@0
   129
sl@0
   130
    using ::std::va_list;
sl@0
   131
#endif
sl@0
   132
sl@0
   133
#define va_start(ap, parmN) __va_start(ap, parmN)
sl@0
   134
#define va_arg(ap, type) __va_arg(ap, type)
sl@0
   135
#define va_end(ap) ((void)0)
sl@0
   136
sl@0
   137
// These are for Symbian OS C++ code
sl@0
   138
#define VA_START(ap,pn) va_start(ap, pn)
sl@0
   139
#define VA_ARG(ap,type) va_arg(ap,type)
sl@0
   140
#define VA_END(ap)      va_end(ap)
sl@0
   141
#define VA_LIST va_list
sl@0
   142
#define __VA_LIST_defined
sl@0
   143
// This should prevent /stdlib/linc/stdarg.h from doing damage.
sl@0
   144
#define _STDARG_H
sl@0
   145
sl@0
   146
// now deal with stdarg_e.h
sl@0
   147
typedef va_list __e32_va_list;
sl@0
   148
#define _STDARG_E_H
sl@0
   149
sl@0
   150
// This is an EABI compliant compiler
sl@0
   151
#ifndef __EABI__
sl@0
   152
#define __EABI__
sl@0
   153
#endif
sl@0
   154
sl@0
   155
// these are hopefully temporary
sl@0
   156
sl@0
   157
// defining this means we don't get __NAKED__ ctors
sl@0
   158
#ifndef __EABI_CTORS__
sl@0
   159
#define __EABI_CTORS__
sl@0
   160
#endif
sl@0
   161
sl@0
   162
//#define __EARLY_DEBUG__
sl@0
   163
sl@0
   164
// Deal with operator new issues here
sl@0
   165
#ifdef __cplusplus
sl@0
   166
namespace std {
sl@0
   167
	struct nothrow_t { };
sl@0
   168
	extern const nothrow_t nothrow;
sl@0
   169
}
sl@0
   170
sl@0
   171
IMPORT_C void* operator new(unsigned int aSize) __NO_THROW;
sl@0
   172
sl@0
   173
IMPORT_C void* operator new[](unsigned int aSize) __NO_THROW;
sl@0
   174
sl@0
   175
IMPORT_C void* operator new(unsigned int aSize, const std::nothrow_t& aNoThrow) __NO_THROW;
sl@0
   176
sl@0
   177
IMPORT_C void* operator new[](unsigned int aSize, const std::nothrow_t& aNoThrow) __NO_THROW;
sl@0
   178
sl@0
   179
IMPORT_C void operator delete(void* aPtr) __NO_THROW;
sl@0
   180
sl@0
   181
IMPORT_C void operator delete[](void* aPtr) __NO_THROW;
sl@0
   182
sl@0
   183
IMPORT_C void operator delete(void* aPtr, const std::nothrow_t& aNoThrow) __NO_THROW;
sl@0
   184
sl@0
   185
IMPORT_C void operator delete[](void* aPtr, const std::nothrow_t& aNoThrow) __NO_THROW;
sl@0
   186
sl@0
   187
// Support for throwing exceptions through embedded assembler
sl@0
   188
// Should only be needed user side
sl@0
   189
sl@0
   190
#define	__EH_FRAME_ADDRESS(reg,offset)	FRAME ADDRESS reg, offset
sl@0
   191
#define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2}
sl@0
   192
#define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset
sl@0
   193
sl@0
   194
#endif