Imported Upstream version 2.9.0
[debian/cc1111] / device / include / asm / mcs51 / features.h
1 /*---------------------------------------------------------------------------
2    MCS51 specific features.
3
4    Copyright (C) 2004 - Maarten Brock, sourceforge.brock@dse.nl
5
6    This library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    This library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with this library; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 ---------------------------------------------------------------------------*/
20
21 #ifndef __SDC51_ASM_MCS51_FEATURES_H
22 #define __SDC51_ASM_MCS51_FEATURES_H   1
23
24 #define _REENTRANT      __reentrant
25 #define _CODE           __code
26
27 /* define _AUTOMEM to indicate the default storage class for
28    automatic variables. To be used with pointers to automatic variables.
29    Cannot be used in reentrant declared functions!
30
31    void foo(void)
32    {
33      char Ar[10];
34      char _AUTOMEM * pAr = Ar;
35    }
36 */
37 #if defined(SDCC_STACK_AUTO)
38   #if defined(SDCC_USE_XSTACK)
39     #define _AUTOMEM __pdata
40   #else
41     #define _AUTOMEM __idata
42   #endif
43 #elif defined(SDCC_MODEL_SMALL)
44   #define _AUTOMEM __data
45 #elif defined(SDCC_MODEL_MEDIUM)
46   #define _AUTOMEM __pdata
47 #else
48   #define _AUTOMEM __xdata
49 #endif
50
51 /* define _STATMEM to indicate the default storage class for
52    global/static variables. To be used with pointers to static variables.
53
54    char Ar[10];
55    void foo(void)
56    {
57      char _STATMEM * pAr = Ar;
58    }
59 */
60 #if defined(SDCC_MODEL_SMALL)
61   #define _STATMEM __data
62 #elif defined(SDCC_MODEL_MEDIUM)
63   #define _STATMEM __pdata
64 #else
65   #define _STATMEM __xdata
66 #endif
67
68 #endif