Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: decl_macros.h | |
5 | * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
6 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. | |
7 | * | |
8 | * The above named program is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU General Public | |
10 | * License version 2 as published by the Free Software Foundation. | |
11 | * | |
12 | * The above named program is distributed in the hope that it will be | |
13 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public | |
18 | * License along with this work; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | |
20 | * | |
21 | * ========== Copyright Header End ============================================ | |
22 | */ | |
23 | #ifndef _decl_macros_h | |
24 | #define _decl_macros_h | |
25 | ||
26 | #pragma ident "@(#)1.1 01/08/23 decl_macros.h" | |
27 | ||
28 | // Sun Microsystems | |
29 | // R Quong 6/2000 | |
30 | // | |
31 | ||
32 | // | |
33 | // Macros for marking: | |
34 | // class/struct definitions | |
35 | // field declarations and attributs | |
36 | // | |
37 | // Many of the macro parameters are not actually used in the macros expansion. | |
38 | // Instead these params exist as attributes which | |
39 | // we processed later when run a (Perl) script over the source code. | |
40 | // The macros make it easier for the script to parse the file. | |
41 | ||
42 | ||
43 | // macroClassName is ignored in the macro generation. | |
44 | // The generated code uses the type macroClassName | |
45 | // (which could be a base class or typedef) | |
46 | // | |
47 | #define CLASSDECL(classname,macroClassName,macroPreamble) class classname | |
48 | ||
49 | // structBase is ignored in the macro generation. | |
50 | // See the notes for CLASSDECL | |
51 | #define STRUCTDECL(structname,macroStructName,macroPreamble) struct structname | |
52 | ||
53 | // TPREFIX = type prefix | |
54 | // TSUFFIX = type suffix | |
55 | // FIELDNAME = name of the field | |
56 | // ATTR is used by the perl script and can have the following properties | |
57 | // get - generate a get() fn | |
58 | // set - generate a set() fn | |
59 | // dump/restore - dump/restore this field in the class dump/restore fn. | |
60 | // OTHER is not used yet. | |
61 | // | |
62 | // Examples: | |
63 | // FLDDECL(int,cpu,,set/get/dump/restore,); | |
64 | // FLDDECL(long long,reg,[],set/get/dump/restore,); | |
65 | // | |
66 | #define FLDDECL(tprefix,fieldname,tsuffix,attr,other) tprefix fieldname tsuffix | |
67 | ||
68 | // Thus instead of | |
69 | // struct ABC_t { | |
70 | // int i; | |
71 | // char buff[80]; | |
72 | // }; | |
73 | // we would use | |
74 | // STRUCTDECL(ABC_t,,) { | |
75 | // FLDDECL(int,i,,,); | |
76 | // FLDDECL(char,buff,[80],,); | |
77 | // }; | |
78 | ||
79 | #endif /* _decl_macros_h */ |