epoc32/include/e32def.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 /*
     1 /*
     2 * Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8 *
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    18 *
    18 *
    19 */
    19 */
    20 
    20 
    21 
    21 
    22 
    22 
    23 
       
    24 
       
    25 #ifndef __E32DEF_H__
    23 #ifndef __E32DEF_H__
    26 #define __E32DEF_H__
    24 #define __E32DEF_H__
    27 
    25 
    28 /*
    26 /*
    29  * __LEAVE_EQUALS_THROW__ requires the compiler to support C++ exceptions
    27  * __LEAVE_EQUALS_THROW__ requires the compiler to support C++ exceptions
    31 #ifndef __SUPPORT_CPP_EXCEPTIONS__
    29 #ifndef __SUPPORT_CPP_EXCEPTIONS__
    32 #undef __LEAVE_EQUALS_THROW__
    30 #undef __LEAVE_EQUALS_THROW__
    33 #endif
    31 #endif
    34 
    32 
    35 
    33 
    36 
       
    37 
       
    38 
       
    39 #ifdef __PROFILING__
       
    40 
       
    41 /**
       
    42 @publishedPartner
       
    43 @removed
       
    44 */
       
    45 #define __PROFILE_START(aBin) RDebug::ProfileStart(aBin)
       
    46 
       
    47 /**
       
    48 @publishedPartner
       
    49 @removed
       
    50 */
       
    51 #define __PROFILE_END(aBin)   RDebug::ProfileEnd(aBin)
       
    52 
       
    53 /**
       
    54 @publishedPartner
       
    55 @removed
       
    56 */
       
    57 #define __PROFILE_RESET(aNumberOfBins) RDebug::ProfileReset(0,aNumberOfBins)
       
    58 
       
    59 /**
       
    60 @publishedPartner
       
    61 @removed
       
    62 */
       
    63 #define __PROFILE_DISPLAY(aNumberOfBins) \
       
    64 			{	TFixedArray<TProfile, aNumberOfBins> result; \
       
    65 				RDebug::ProfileResult(result.Begin(), 0, aNumberOfBins); \
       
    66 				for (TInt i=0; i<aNumberOfBins; i++)   \
       
    67 				RDebug::Print(_L("Profile bin %d:  Calls: %d, Clock ticks: %d\n" ),i,res[i].iCount,result[i].iTime);  \
       
    68 			}
       
    69 #else /* __PROFILING__ */
       
    70 #define __PROFILE_START(aBin) 
       
    71 #define __PROFILE_END(aBin)   
       
    72 #define __PROFILE_RESET(aNumberOfBins) 
       
    73 #define __PROFILE_DISPLAY(aNumberOfBins)
       
    74 #endif
       
    75 
       
    76 
       
    77 
       
    78 #if defined(__VC32__)
    34 #if defined(__VC32__)
    79 /**
    35 /**
    80 @publishedAll
    36 @publishedAll
    81 @released
    37 @released
    82 */
    38 */
   103 /**
    59 /**
   104 @publishedAll
    60 @publishedAll
   105 @released
    61 @released
   106 */
    62 */
   107 #define EXPORT_C __declspec(dllexport)
    63 #define EXPORT_C __declspec(dllexport)
       
    64 /**
       
    65 @publishedAll
       
    66 @released
       
    67 */
       
    68 #define IMPORT_D __declspec(dllexport)
       
    69 /**
       
    70 @publishedAll
       
    71 @released
       
    72 */
       
    73 #define EXPORT_D __declspec(dllexport)
   108 /**
    74 /**
   109 @publishedAll
    75 @publishedAll
   110 @released
    76 @released
   111 */
    77 */
   112 #define NONSHARABLE_CLASS(x) class x
    78 #define NONSHARABLE_CLASS(x) class x
   156 #define __NO_CLASS_CONSTS__
   122 #define __NO_CLASS_CONSTS__
   157 #define __NORETURN__
   123 #define __NORETURN__
   158 #define __NORETURN_TERMINATOR()
   124 #define __NORETURN_TERMINATOR()
   159 #define IMPORT_C __declspec(dllexport)
   125 #define IMPORT_C __declspec(dllexport)
   160 #define EXPORT_C __declspec(dllexport)
   126 #define EXPORT_C __declspec(dllexport)
       
   127 #define IMPORT_D __declspec(dllexport)
       
   128 #define EXPORT_D __declspec(dllexport)
   161 #define NONSHARABLE_CLASS(x) class x
   129 #define NONSHARABLE_CLASS(x) class x
   162 #define NONSHARABLE_STRUCT(x) struct x
   130 #define NONSHARABLE_STRUCT(x) struct x
   163 #define __NO_THROW throw()
   131 #define __NO_THROW throw()
   164 #define __THROW(t) throw(t)
   132 #define __THROW(t) throw(t)
   165 
   133 
   183 #pragma warning off (10350) /* N pad byte(s) inserted after data member */
   151 #pragma warning off (10350) /* N pad byte(s) inserted after data member */
   184 #endif
   152 #endif
   185 #endif
   153 #endif
   186 
   154 
   187 
   155 
   188 
   156 //
   189 #if defined(__GCC32__)
   157 // GCC (ARM) compiler
       
   158 //
       
   159 #if defined(__GCC32__) && defined(__MARM__)
       
   160 #ifndef __GNUC__		/* GCC98r2 doesn't define this for some reason */
       
   161 #define __GNUC__	2
       
   162 #endif
   190 #define __NO_CLASS_CONSTS__
   163 #define __NO_CLASS_CONSTS__
   191 #define __NORETURN__  __attribute__ ((noreturn))
   164 #define __NORETURN__  __attribute__ ((noreturn))
   192 #ifdef __GCCV3__
   165 #ifdef __GCCV3__
   193 #define __NORETURN_TERMINATOR()
   166 #define __NORETURN_TERMINATOR()
   194 #else
   167 #else
   195 #define __NORETURN_TERMINATOR()		abort()
   168 #define __NORETURN_TERMINATOR()		abort()
   196 #endif
   169 #endif
   197 #define IMPORT_C
   170 #define IMPORT_C
       
   171 #define IMPORT_D
   198 #if !defined __WINS__ && defined _WIN32 /* VC++ Browser Hack */
   172 #if !defined __WINS__ && defined _WIN32 /* VC++ Browser Hack */
   199 #define EXPORT_C
   173 #define EXPORT_C
       
   174 #define EXPORT_D
   200 /** @internalTechnology */
   175 /** @internalTechnology */
   201 #define asm(x)
   176 #define asm(x)
   202 #else
   177 #else
   203 #define EXPORT_C __declspec(dllexport)
   178 #define EXPORT_C __declspec(dllexport)
       
   179 #define EXPORT_D __declspec(dllexport)
   204 #endif
   180 #endif
   205 #define NONSHARABLE_CLASS(x) class x
   181 #define NONSHARABLE_CLASS(x) class x
   206 #define NONSHARABLE_STRUCT(x) struct x
   182 #define NONSHARABLE_STRUCT(x) struct x
   207 #define __NO_THROW
   183 #define __NO_THROW
   208 #define __THROW(t)
   184 #define __THROW(t)
   209 #ifdef __EABI__
   185 #ifdef __EABI__
   210 #define TEMPLATE_SPECIALIZATION template<>
   186 #define TEMPLATE_SPECIALIZATION template<>
   211 #else
   187 #else
   212 #define TEMPLATE_SPECIALIZATION
   188 #define TEMPLATE_SPECIALIZATION
   213 #endif
   189 #endif
   214 #endif
       
   215 
       
   216 
       
   217 
       
   218 #ifdef __GCC32__
       
   219 /**
   190 /**
   220 @publishedAll
   191 @publishedAll
   221 @released
   192 @released
   222 */
   193 */
   223 #define __DOUBLE_WORDS_SWAPPED__
   194 #define __DOUBLE_WORDS_SWAPPED__
   224 #endif
   195 #endif
   225 
       
   226 
   196 
   227 
   197 
   228 /** @internalTechnology */
   198 /** @internalTechnology */
   229 #define __NO_MUTABLE_KEYWORD
   199 #define __NO_MUTABLE_KEYWORD
   230 #if defined(__NO_MUTABLE_KEYWORD)
   200 #if defined(__NO_MUTABLE_KEYWORD)
   295 /**
   265 /**
   296 @publishedAll
   266 @publishedAll
   297 @deprecated
   267 @deprecated
   298 */
   268 */
   299 #define LOCAL_C static
   269 #define LOCAL_C static
       
   270 /**
       
   271 @internalAll
       
   272 @prototype
       
   273 */
       
   274 #ifndef IMPORT_D
       
   275 #define IMPORT_D IMPORT_C 
       
   276 #endif
       
   277 
   300 /**
   278 /**
   301 @publishedAll
   279 @publishedAll
   302 @deprecated
   280 @deprecated
   303 */
   281 */
   304 #define FOREVER for(;;)
   282 #define FOREVER for(;;)
   466 */
   444 */
   467 #ifndef _FOFF
   445 #ifndef _FOFF
   468 #if __GNUC__ < 4
   446 #if __GNUC__ < 4
   469 #define _FOFF(c,f)			(((TInt)&(((c *)0x1000)->f))-0x1000)
   447 #define _FOFF(c,f)			(((TInt)&(((c *)0x1000)->f))-0x1000)
   470 #else
   448 #else
   471 #define _FOFF(c,f)			__builtin_offsetof(c,f)
   449 #define _FOFF(c,f)			(__builtin_offsetof(c,f))
   472 #endif
   450 #endif
   473 #endif
   451 #endif
   474 
   452 
   475 
   453 
   476 
   454 
   568 
   546 
   569 /**
   547 /**
   570 @publishedAll
   548 @publishedAll
   571 @released
   549 @released
   572 
   550 
       
   551 A signed integer type of the same size as a pointer.
       
   552 */
       
   553 typedef TInt32 T_IntPtr;
       
   554 typedef TInt32 TIntPtr;
       
   555 
       
   556 
       
   557 
       
   558 
       
   559 /**
       
   560 @publishedAll
       
   561 @released
       
   562 
   573 32-bit unsigned integer type; used in Symbian OS to mean a 32-bit
   563 32-bit unsigned integer type; used in Symbian OS to mean a 32-bit
   574 unsigned integer, independent of the implementation.
   564 unsigned integer, independent of the implementation.
   575 */
   565 */
   576 typedef unsigned long int TUint32;
   566 typedef unsigned long int TUint32;
       
   567 
       
   568 
       
   569 
       
   570 
       
   571 /**
       
   572 @publishedAll
       
   573 @released
       
   574 
       
   575 An unsigned integer type of the same size as a pointer.
       
   576 */
       
   577 typedef TUint32 T_UintPtr;
       
   578 typedef TUint32 TUintPtr;
   577 
   579 
   578 
   580 
   579 
   581 
   580 
   582 
   581 /**
   583 /**
   744 
   746 
   745 Although only a single bit would theoretically be necessary to represent a 
   747 Although only a single bit would theoretically be necessary to represent a 
   746 Boolean, a machine word is used instead, so that these quantities can be easily 
   748 Boolean, a machine word is used instead, so that these quantities can be easily 
   747 passed. Also, TBool must map onto int because of C++'s interpretation of 
   749 passed. Also, TBool must map onto int because of C++'s interpretation of 
   748 operands in conditional expressions.
   750 operands in conditional expressions.
   749 
       
   750 On implementations of Symbian OS in which the compiler supports the ANSI-recommended 
       
   751 bool type, TBool will be typedef'ed to bool instead of int.
       
   752 */
   751 */
   753 typedef int TBool;
   752 typedef int TBool;
   754 
   753 
   755 
   754 
   756 
   755 
   759 @publishedPartner
   758 @publishedPartner
   760 @released
   759 @released
   761 
   760 
   762 Defines a linear (virtual) address type.
   761 Defines a linear (virtual) address type.
   763 */
   762 */
   764 typedef TUint32 TLinAddr;
   763 typedef T_UintPtr TLinAddr;
   765 
   764 
   766 /**
       
   767 @internalTechnology
       
   768 
       
   769 A sorted list of all the code segments in ROM that contain an Exception Descriptor.
       
   770 
       
   771 */
       
   772 typedef struct TRomExceptionSearchTable
       
   773 	{
       
   774 	/**
       
   775 	The number of entries in the following table.
       
   776 	*/
       
   777 	TInt32 iNumEntries;
       
   778 	
       
   779 	/**
       
   780 	Address of the code segment of each TRomImageHeader that has an Exception Descriptor.
       
   781 	*/
       
   782 	TLinAddr iEntries[1];
       
   783 	} TRomExceptionSearchTable;
       
   784 
       
   785 /**
       
   786 @internalComponent
       
   787 */
       
   788 typedef struct TExceptionDescriptor 
       
   789 	{
       
   790 	TLinAddr iExIdxBase;
       
   791 	TLinAddr iExIdxLimit;
       
   792 	TLinAddr iROSegmentBase;
       
   793 	TLinAddr iROSegmentLimit;
       
   794 	} TExceptionDescriptor;
       
   795 
   765 
   796 
   766 
   797 #if defined(__GCC32__)
   767 #if defined(__GCC32__)
   798 
   768 
   799 
   769 
  1339 #define __BREAKPOINT()
  1309 #define __BREAKPOINT()
  1340 #endif
  1310 #endif
  1341 
  1311 
  1342 #if defined(_DEBUG)
  1312 #if defined(_DEBUG)
  1343 
  1313 
  1344 /** 
       
  1345 @internalComponent
       
  1346 @deprecated
       
  1347 */
       
  1348 #define __ASSERT_DEBUG_MB(aCond,aPanicNo) (void)((aCond)||(PanicMB(aPanicNo,_L(#aPanicNo),_L(#aCond)),0))
       
  1349 
       
  1350 
       
  1351 
       
  1352 
  1314 
  1353 /** 
  1315 /** 
  1354 @publishedAll
  1316 @publishedAll
  1355 @released
  1317 @released
  1356 
  1318 
  1655 
  1617 
  1656 @see RAllocator::TAllocFail
  1618 @see RAllocator::TAllocFail
  1657 */
  1619 */
  1658 #define __UHEAP_CHECKFAILURE User::__DbgCheckFailure(FALSE)
  1620 #define __UHEAP_CHECKFAILURE User::__DbgCheckFailure(FALSE)
  1659 
  1621 
  1660 
       
  1661 
       
  1662 
       
  1663 /**
       
  1664 @publishedPartner
       
  1665 @released
       
  1666 
       
  1667 Marks the start of Kernel heap checking. 
       
  1668 
       
  1669 Checking the Kernel heap is only useful when developing Kernel side code such 
       
  1670 as device drivers and media drivers.
       
  1671 
       
  1672 This macro is defined only for debug builds.
       
  1673 
       
  1674 This macro must be matched by a corresponding call to __KHEAP_MARKEND or __KHEAP_MARKENDC. 
       
  1675 Calls to this macro can be nested but each call must be matched by corresponding 
       
  1676 call to __KHEAP_MARKEND or __KHEAP_MARKENDC.
       
  1677 
       
  1678 @see User::__DbgMarkStart()
       
  1679 @see __KHEAP_MARKEND
       
  1680 @see __KHEAP_MARKENDC
       
  1681 */
       
  1682 #define __KHEAP_MARK User::__DbgMarkStart(TRUE)
       
  1683 
       
  1684 
       
  1685 
       
  1686 
       
  1687 /**
       
  1688 @publishedPartner
       
  1689 @released
       
  1690 
       
  1691 Checks that the number of allocated cells at the current nested level of the 
       
  1692 Kernel heap is the same as the specified value. This macro is defined only 
       
  1693 for debug builds. Checking the Kernel heap is only useful when developing 
       
  1694 Kernel side code such as device drivers and media drivers.
       
  1695 
       
  1696 The macro also takes the name of the file containing this source code statement 
       
  1697 and the line number of this source code statement; they are displayed as part 
       
  1698 of the panic category, if the checks fail.
       
  1699 
       
  1700 @param aCount The number of heap cells expected to be allocated at
       
  1701               the current nest level.
       
  1702 
       
  1703 @see User::__DbgMarkCheck()
       
  1704 @see __UHEAP_CHECK
       
  1705 */
       
  1706 #define __KHEAP_CHECK(aCount) User::__DbgMarkCheck(TRUE,FALSE,aCount,(TText8*)__FILE__,__LINE__)
       
  1707 
       
  1708 
       
  1709 
       
  1710 
       
  1711 /**
       
  1712 @publishedPartner
       
  1713 @released
       
  1714 
       
  1715 Checks that the total number of allocated cells on the Kernel heap is the same 
       
  1716 as the specified value.
       
  1717 
       
  1718 It is only useful when developing Kernel side code such as device drivers 
       
  1719 and media drivers. 
       
  1720 
       
  1721 The macro also takes the name of the file containing this source code statement 
       
  1722 and the line number of this source code statement; they are displayed as part 
       
  1723 of the panic category, if the checks fail.
       
  1724 
       
  1725 This macro is defined only for debug builds.
       
  1726 
       
  1727 @param aCount The total number of heap cells expected to be allocated
       
  1728 
       
  1729 @see User::__DbgMarkCheck()
       
  1730 @see __UHEAP_CHECKALL
       
  1731 */
       
  1732 #define __KHEAP_CHECKALL(aCount) User::__DbgMarkCheck(TRUE,TRUE,aCount,(TText8*)__FILE__,__LINE__)
       
  1733 
       
  1734 
       
  1735 
       
  1736 
       
  1737 /**
       
  1738 @publishedPartner
       
  1739 @released
       
  1740 
       
  1741 Marks the end of Kernel heap checking. The macro expects zero heap cells to 
       
  1742 remain allocated at the current nest level.
       
  1743 
       
  1744 This macro is defined only for debug builds. Checking the Kernel heap is only 
       
  1745 useful when developing Kernel side code such as device drivers and media drivers.
       
  1746 
       
  1747 This macro must match an earlier call to __KHEAP_MARK.
       
  1748 
       
  1749 @see User::__DbgMarkEnd()
       
  1750 @see __KHEAP_MARK
       
  1751 */
       
  1752 #define __KHEAP_MARKEND User::__DbgMarkEnd(TRUE,0)
       
  1753 
       
  1754 
       
  1755 
       
  1756 
       
  1757 /**
       
  1758 @publishedPartner
       
  1759 @released
       
  1760 
       
  1761 Marks the end of Kernel heap checking. The macro expects aCount heap cells 
       
  1762 to remain allocated at the current nest level.
       
  1763 
       
  1764 This macro is defined only for debug builds.
       
  1765 
       
  1766 This macro must match an earlier call to __KHEAP_MARK.
       
  1767 
       
  1768 @param aCount The number of heap cells expected to remain allocated at
       
  1769               the current nest level.
       
  1770 
       
  1771 @see User::__DbgMarkEnd()
       
  1772 @see __KHEAP_MARK
       
  1773 */
       
  1774 #define __KHEAP_MARKENDC(aCount) User::__DbgMarkEnd(TRUE,aCount)
       
  1775 
       
  1776 
       
  1777 
       
  1778 
       
  1779 /**
       
  1780 @publishedPartner
       
  1781 @released
       
  1782 
       
  1783 Simulates Kernel heap allocation failure. The failure occurs on the next call 
       
  1784 to new or any of the functions which allocate memory from the heap. This macro 
       
  1785 is defined only for debug builds.
       
  1786 
       
  1787 Checking the Kernel heap is only useful when developing Kernel side code such 
       
  1788 as device drivers and media drivers.
       
  1789 
       
  1790 @param aCount The rate of failure - heap allocation fails every aCount attempt.
       
  1791 
       
  1792 @see User::__DbgSetAllocFail()
       
  1793 */
       
  1794 #define __KHEAP_FAILNEXT(aCount) User::__DbgSetAllocFail(TRUE,RAllocator::EFailNext,aCount)
       
  1795 
       
  1796 /**
       
  1797 @publishedPartner
       
  1798 @released
       
  1799 
       
  1800 Simulates Kernel heap allocation failures. aBurst failures will occur on the next call 
       
  1801 to new or any of the functions which allocate memory from the heap. This macro 
       
  1802 is defined only for debug builds.
       
  1803 
       
  1804 Checking the Kernel heap is only useful when developing Kernel side code such 
       
  1805 as device drivers and media drivers.
       
  1806 
       
  1807 @param aCount The heap allocation will fail after aCount-1 allocation attempts. 
       
  1808               Note when used with RHeap the maximum value aCount can be set 
       
  1809               to is KMaxTUint16.
       
  1810 @param aBurst The number of allocations that will fail after aCount-1 allocation 
       
  1811               attempts.  Note when used with RHeap the maximum value aBurst can be 
       
  1812               set to is KMaxTUint16.
       
  1813 
       
  1814 
       
  1815 @see User::__DbgSetBurstAllocFail()
       
  1816 */
       
  1817 #define __KHEAP_BURSTFAILNEXT(aCount,aBurst) User::__DbgSetBurstAllocFail(TRUE,RAllocator::EBurstFailNext,aCount,aBurst)
       
  1818 
       
  1819 
       
  1820 /**
       
  1821 @publishedPartner
       
  1822 @released
       
  1823 
       
  1824 Simulates Kernel heap allocation failure. 
       
  1825 
       
  1826 The failure occurs on subsequent calls to new or any of the functions which 
       
  1827 allocate memory from this heap.
       
  1828 
       
  1829 This macro is defined only for debug builds.
       
  1830 
       
  1831 @param aType  The type of failure to be simulated.
       
  1832 @param aRate The failure rate.
       
  1833 
       
  1834 @see RAllocator::TAllocFail
       
  1835 @see User::__DbgSetAllocFail()
       
  1836 */
       
  1837 #define __KHEAP_SETFAIL(aType,aRate) User::__DbgSetAllocFail(TRUE,aType,aRate)
       
  1838 
       
  1839 /**
       
  1840 @publishedPartner
       
  1841 @released
       
  1842 
       
  1843 Simulates Kernel heap allocation failure. 
       
  1844 
       
  1845 The failure occurs on subsequent calls to new or any of the functions which 
       
  1846 allocate memory from this heap.
       
  1847 
       
  1848 This macro is defined only for debug builds.
       
  1849 
       
  1850 @param aType  The type of failure to be simulated.
       
  1851 @param aRate  The failure rate.  Note when used with RHeap the maximum value 
       
  1852               aRate can be set to is KMaxTUint16.
       
  1853 @param aBurst The number of consecutive allocations that will fail.  Note 
       
  1854               when used with RHeap the maximum value aBurst can be set to 
       
  1855               is KMaxTUint16.
       
  1856 
       
  1857 @see RAllocator::TAllocFail
       
  1858 @see User::__DbgSetBurstAllocFail()
       
  1859 */
       
  1860 #define __KHEAP_SETBURSTFAIL(aType,aRate,aBurst) User::__DbgSetBurstAllocFail(TRUE,aType,aRate,aBurst)
       
  1861 
       
  1862 
       
  1863 
       
  1864 /**
       
  1865 @publishedPartner
       
  1866 @released
       
  1867 
       
  1868 Cancels simulated Kernel heap allocation failure. 
       
  1869 
       
  1870 Checking the Kernel heap is only useful when developing Kernel side code such 
       
  1871 as device drivers and media drivers.
       
  1872 
       
  1873 This macro is defined only for debug builds.
       
  1874 
       
  1875 @see User::__DbgSetAllocFail()
       
  1876 */
       
  1877 #define __KHEAP_RESET User::__DbgSetAllocFail(TRUE,RAllocator::ENone,1)
       
  1878 
       
  1879 
       
  1880 
       
  1881 
       
  1882 /**
       
  1883 @publishedPartner
       
  1884 @released
       
  1885 
       
  1886 Cancels simulated kernel heap allocation failure. 
       
  1887 It walks the the heap and sets the nesting level for all allocated
       
  1888 cells to zero.
       
  1889 
       
  1890 Checking the kernel heap is only useful when developing kernel side code such 
       
  1891 as device drivers and media drivers.
       
  1892 
       
  1893 This macro is defined only for debug builds.
       
  1894 */
       
  1895 #define __KHEAP_TOTAL_RESET User::__DbgSetAllocFail(TRUE,RAllocator::EReset,1)
       
  1896 
       
  1897 /**
  1622 /**
  1898 @publishedAll
  1623 @publishedAll
  1899 @released
  1624 @released
  1900 
  1625 
  1901 Returns the number of kernel heap allocation failures the current debug 
  1626 Returns the number of kernel heap allocation failures the current debug 
  2486 
  2211 
  2487 @see RAllocator::TAllocFail
  2212 @see RAllocator::TAllocFail
  2488 */
  2213 */
  2489 #define __UHEAP_CHECKFAILURE ((TUint)0)
  2214 #define __UHEAP_CHECKFAILURE ((TUint)0)
  2490 
  2215 
  2491 
       
  2492 /**
       
  2493 @publishedPartner
       
  2494 @released
       
  2495 
       
  2496 Marks the start of Kernel heap checking. 
       
  2497 
       
  2498 Checking the Kernel heap is only useful when developing Kernel side code such 
       
  2499 as device drivers and media drivers.
       
  2500 
       
  2501 This macro is defined only for debug builds.
       
  2502 
       
  2503 This macro must be matched by a corresponding call to __KHEAP_MARKEND or __KHEAP_MARKENDC. 
       
  2504 Calls to this macro can be nested but each call must be matched by corresponding 
       
  2505 call to __KHEAP_MARKEND or __KHEAP_MARKENDC.
       
  2506 
       
  2507 @see User::__DbgMarkStart()
       
  2508 @see __KHEAP_MARKEND
       
  2509 @see __KHEAP_MARKENDC
       
  2510 */
       
  2511 #define __KHEAP_MARK
       
  2512 
       
  2513 
       
  2514 
       
  2515 
       
  2516 /**
       
  2517 @publishedPartner
       
  2518 @released
       
  2519 
       
  2520 Checks that the number of allocated cells at the current nested level of the 
       
  2521 Kernel heap is the same as the specified value. This macro is defined only 
       
  2522 for debug builds. Checking the Kernel heap is only useful when developing 
       
  2523 Kernel side code such as device drivers and media drivers.
       
  2524 
       
  2525 The macro also takes the name of the file containing this source code statement 
       
  2526 and the line number of this source code statement; they are displayed as part 
       
  2527 of the panic category, if the checks fail.
       
  2528 
       
  2529 @param aCount The number of heap cells expected to be allocated at
       
  2530               the current nest level.
       
  2531 
       
  2532 @see User::__DbgMarkCheck()
       
  2533 @see __UHEAP_CHECK
       
  2534 */
       
  2535 #define __KHEAP_CHECK(aCount)
       
  2536 
       
  2537 
       
  2538 
       
  2539 
       
  2540 /**
       
  2541 @publishedPartner
       
  2542 @released
       
  2543 
       
  2544 Checks that the total number of allocated cells on the Kernel heap is the same 
       
  2545 as the specified value.
       
  2546 
       
  2547 It is only useful when developing Kernel side code such as device drivers 
       
  2548 and media drivers. 
       
  2549 
       
  2550 The macro also takes the name of the file containing this source code statement 
       
  2551 and the line number of this source code statement; they are displayed as part 
       
  2552 of the panic category, if the checks fail.
       
  2553 
       
  2554 This macro is defined only for debug builds.
       
  2555 
       
  2556 @param aCount The total number of heap cells expected to be allocated
       
  2557 
       
  2558 @see User::__DbgMarkCheck()
       
  2559 @see __UHEAP_CHECKALL
       
  2560 */
       
  2561 #define __KHEAP_CHECKALL(aCount)
       
  2562 
       
  2563 
       
  2564 
       
  2565 
       
  2566 /**
       
  2567 @publishedPartner
       
  2568 @released
       
  2569 
       
  2570 Marks the end of Kernel heap checking. The macro expects zero heap cells to 
       
  2571 remain allocated at the current nest level.
       
  2572 
       
  2573 This macro is defined only for debug builds. Checking the Kernel heap is only 
       
  2574 useful when developing Kernel side code such as device drivers and media drivers.
       
  2575 
       
  2576 This macro must match an earlier call to __KHEAP_MARK.
       
  2577 
       
  2578 @see User::__DbgMarkEnd()
       
  2579 @see __KHEAP_MARK
       
  2580 */
       
  2581 #define __KHEAP_MARKEND
       
  2582 
       
  2583 
       
  2584 
       
  2585 
       
  2586 /**
       
  2587 @publishedPartner
       
  2588 @released
       
  2589 
       
  2590 Marks the end of Kernel heap checking. The macro expects aCount heap cells 
       
  2591 to remain allocated at the current nest level.
       
  2592 
       
  2593 This macro is defined only for debug builds.
       
  2594 
       
  2595 This macro must match an earlier call to __KHEAP_MARK.
       
  2596 
       
  2597 @param aCount The number of heap cells expected to remain allocated at
       
  2598               the current nest level.
       
  2599 
       
  2600 @see User::__DbgMarkEnd()
       
  2601 @see __KHEAP_MARK
       
  2602 */
       
  2603 #define __KHEAP_MARKENDC(aCount)
       
  2604 
       
  2605 
       
  2606 
       
  2607 
       
  2608 /**
       
  2609 @publishedPartner
       
  2610 @released
       
  2611 
       
  2612 Simulates Kernel heap allocation failure. The failure occurs on the next call 
       
  2613 to new or any of the functions which allocate memory from the heap. This macro 
       
  2614 is defined only for debug builds.
       
  2615 
       
  2616 Checking the Kernel heap is only useful when developing Kernel side code such 
       
  2617 as device drivers and media drivers.
       
  2618 
       
  2619 @param aCount The rate of failure - heap allocation fails every aCount attempt.
       
  2620 
       
  2621 @see User::__DbgSetAllocFail()
       
  2622 */
       
  2623 #define __KHEAP_FAILNEXT(aCount)
       
  2624 
       
  2625 /**
       
  2626 @publishedPartner
       
  2627 @released
       
  2628 
       
  2629 Simulates Kernel heap allocation failures. aBurst failures will occur on the next call 
       
  2630 to new or any of the functions which allocate memory from the heap. This macro 
       
  2631 is defined only for debug builds.
       
  2632 
       
  2633 Checking the Kernel heap is only useful when developing Kernel side code such 
       
  2634 as device drivers and media drivers.
       
  2635 
       
  2636 @param aCount The heap allocation will fail after aCount-1 allocation attempts.  
       
  2637               Note when used with RHeap the maximum value aCount can be set 
       
  2638               to is KMaxTUint16.
       
  2639 @param aBurst The number of allocations that will fail after aCount-1 allocation
       
  2640               attempts.  Note when used with RHeap the maximum value aBurst can 
       
  2641               be set to is KMaxTUint16.
       
  2642 
       
  2643 @see User::__DbgSetBurstAllocFail()
       
  2644 */
       
  2645 #define __KHEAP_BURSTFAILNEXT(aCount,aBurst)
       
  2646 
       
  2647 
       
  2648 
       
  2649 /**
       
  2650 @publishedPartner
       
  2651 @released
       
  2652 
       
  2653 Simulates Kernel heap allocation failure. 
       
  2654 
       
  2655 The failure occurs on subsequent calls to new or any of the functions which 
       
  2656 allocate memory from this heap.
       
  2657 
       
  2658 This macro is defined only for debug builds.
       
  2659 
       
  2660 @param aType  The type of failure to be simulated.
       
  2661 @param aRate The failure rate.
       
  2662 
       
  2663 @see User::__DbgSetAllocFail()
       
  2664 */
       
  2665 #define __KHEAP_SETFAIL(aType,aRate)
       
  2666 
       
  2667 /**
       
  2668 @publishedPartner
       
  2669 @released
       
  2670 
       
  2671 Simulates Kernel heap allocation failure. 
       
  2672 
       
  2673 The failure occurs on subsequent calls to new or any of the functions which 
       
  2674 allocate memory from this heap.
       
  2675 
       
  2676 This macro is defined only for debug builds.
       
  2677 
       
  2678 @param aType  The type of failure to be simulated.
       
  2679 @param aRate  The failure rate.  Note when used with RHeap the maximum value 
       
  2680               aRate can be set to is KMaxTUint16.
       
  2681 @param aBurst The number of consecutive allocations that will fail.  Note 
       
  2682               when used with RHeap the maximum value aBurst can be set 
       
  2683               to is KMaxTUint16.
       
  2684 
       
  2685 @see User::__DbgSetBurstAllocFail()
       
  2686 */
       
  2687 #define __KHEAP_SETBURSTFAIL(aType,aRate,aBurst)
       
  2688 
       
  2689 
       
  2690 
       
  2691 /**
       
  2692 @publishedPartner
       
  2693 @released
       
  2694 
       
  2695 Cancels simulated Kernel heap allocation failure. 
       
  2696 
       
  2697 Checking the Kernel heap is only useful when developing Kernel side code such 
       
  2698 as device drivers and media drivers.
       
  2699 
       
  2700 This macro is defined only for debug builds.
       
  2701 
       
  2702 @see User::__DbgSetAllocFail()
       
  2703 */
       
  2704 #define __KHEAP_RESET
       
  2705 
       
  2706 
       
  2707 
       
  2708 /**
       
  2709 @publishedPartner
       
  2710 @released
       
  2711 
       
  2712 Cancels simulated kernel heap allocation failure. 
       
  2713 It walks the the heap and sets the nesting level for all allocated
       
  2714 cells to zero.
       
  2715 
       
  2716 Checking the kernel heap is only useful when developing kernel side code such 
       
  2717 as device drivers and media drivers.
       
  2718 
       
  2719 This macro is defined only for debug builds.
       
  2720 */
       
  2721 #define __KHEAP_TOTAL_RESET
       
  2722 
       
  2723 
       
  2724 /**
  2216 /**
  2725 @publishedAll
  2217 @publishedAll
  2726 @released
  2218 @released
  2727 
  2219 
  2728 Returns the number of kernel heap allocation failures the current debug 
  2220 Returns the number of kernel heap allocation failures the current debug 
  2998 #else
  2490 #else
  2999 #define __EMULATOR_IMAGE_HEADER2(aUid0,aUid1,aUid2,aPriority,aCap0,aCap1,aSid,aVer,aFlags)
  2491 #define __EMULATOR_IMAGE_HEADER2(aUid0,aUid1,aUid2,aPriority,aCap0,aCap1,aSid,aVer,aFlags)
  3000 #define __EMULATOR_IMAGE_HEADER(aUid0,aUid1,aUid2,aPriority,aCap,aFlags)
  2492 #define __EMULATOR_IMAGE_HEADER(aUid0,aUid1,aUid2,aPriority,aCap,aFlags)
  3001 #endif
  2493 #endif
  3002 
  2494 
  3003 #if defined(__OPT__)
       
  3004 /**
       
  3005 @internalComponent
       
  3006 @deprecated
       
  3007 */
       
  3008 #define __ASSERT_OPT(c,p) (void)((c)||(p,0))
       
  3009 #else
       
  3010 #define __ASSERT_OPT(c,p)
       
  3011 #endif
       
  3012 
       
  3013 #if defined(_UNICODE)
  2495 #if defined(_UNICODE)
  3014 #if !defined(UNICODE)
  2496 #if !defined(UNICODE)
  3015 /**
  2497 /**
  3016 @publishedAll
  2498 @publishedAll
  3017 @deprecated
  2499 @deprecated
  3018 */
  2500 */
  3019 #define UNICODE
  2501 #define UNICODE
  3020 #endif
  2502 #endif
  3021 #endif
  2503 #endif
  3022 
  2504 
  3023 #if defined(_DEBUG)
       
  3024 /**
       
  3025 @internalComponent
       
  3026 @deprecated
       
  3027 */
       
  3028 #define __DECLARE_TEST_DEBUG __DECLARE_TEST
       
  3029 #else
       
  3030 #define __DECLARE_TEST_DEBUG
       
  3031 #endif
       
  3032 
       
  3033 
       
  3034 
       
  3035 
       
  3036 #if !defined(ASSERT)
  2505 #if !defined(ASSERT)
  3037 /**
  2506 /**
  3038 @publishedAll
  2507 @publishedAll
  3039 @released
  2508 @released
  3040 
  2509 
  3042 condition is not true.
  2511 condition is not true.
  3043 
  2512 
  3044 @param x A conditional expression which results in true or false.
  2513 @param x A conditional expression which results in true or false.
  3045 */
  2514 */
  3046 #define ASSERT(x) __ASSERT_DEBUG(x,User::Invariant())
  2515 #define ASSERT(x) __ASSERT_DEBUG(x,User::Invariant())
  3047 #endif
       
  3048 
       
  3049 
       
  3050 
       
  3051 
       
  3052 #ifndef __VALUE_IN_REGS__ 
       
  3053 /**
       
  3054 @publishedPartner
       
  3055 @released
       
  3056 */
       
  3057 #define __VALUE_IN_REGS__ 
       
  3058 #endif
  2516 #endif
  3059 
  2517 
  3060 
  2518 
  3061 
  2519 
  3062 
  2520 
  3204 
  2662 
  3205 /**
  2663 /**
  3206 When this value is used in Platform Security APIs as the value for the aDiagnostic
  2664 When this value is used in Platform Security APIs as the value for the aDiagnostic
  3207 argument, these APIs will not emit any form of diagnostic message.
  2665 argument, these APIs will not emit any form of diagnostic message.
  3208 @publishedPartner
  2666 @publishedPartner
  3209 @release
  2667 @released
  3210 */
  2668 */
  3211 #define KSuppressPlatSecDiagnostic		NULL
  2669 #define KSuppressPlatSecDiagnostic		NULL
  3212 
  2670 
  3213 #endif /* !__REMOVE_PLATSEC_DIAGNOSTICS__ */
  2671 #endif /* !__REMOVE_PLATSEC_DIAGNOSTICS__ */
  3214 #endif /* !__KERNEL_MODE__ */
  2672 #endif /* !__KERNEL_MODE__ */
  3221 #define __PLACEMENT_NEW_INLINE
  2679 #define __PLACEMENT_NEW_INLINE
  3222 #endif /* __PLACEMENT_NEW */
  2680 #endif /* __PLACEMENT_NEW */
  3223 
  2681 
  3224 #if defined(__VC32__) && (_MSC_VER < 1300)
  2682 #if defined(__VC32__) && (_MSC_VER < 1300)
  3225 #define __PLACEMENT_VEC_NEW_INLINE
  2683 #define __PLACEMENT_VEC_NEW_INLINE
       
  2684 #define __OMIT_VEC_OPERATOR_NEW_DECL__
  3226 #endif /* version of MSVC that doesn't support overloaded operator new[] */
  2685 #endif /* version of MSVC that doesn't support overloaded operator new[] */
  3227 
  2686 
  3228 /**
  2687 /**
  3229 Calling convention qualifier for functions involving floating point 
  2688 Calling convention qualifier for functions involving floating point 
  3230 variables passed or returned by value.
  2689 variables passed or returned by value.
  3233 */
  2692 */
  3234 #ifndef __SOFTFP
  2693 #ifndef __SOFTFP
  3235 #define __SOFTFP
  2694 #define __SOFTFP
  3236 #endif /* __SOFTFP */
  2695 #endif /* __SOFTFP */
  3237 
  2696 
       
  2697 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
  2698 #include <e32def_private.h>
       
  2699 #endif
       
  2700 
  3238 #endif /* __E32DEF_H__ */
  2701 #endif /* __E32DEF_H__ */