Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / system / blaze / include / decl_macros.h
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T2 Processor File: decl_macros.h
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
*
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
*
* The above named program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ========== Copyright Header End ============================================
*/
#ifndef _decl_macros_h
#define _decl_macros_h
#pragma ident "@(#)1.1 01/08/23 decl_macros.h"
// Sun Microsystems
// R Quong 6/2000
//
//
// Macros for marking:
// class/struct definitions
// field declarations and attributs
//
// Many of the macro parameters are not actually used in the macros expansion.
// Instead these params exist as attributes which
// we processed later when run a (Perl) script over the source code.
// The macros make it easier for the script to parse the file.
// macroClassName is ignored in the macro generation.
// The generated code uses the type macroClassName
// (which could be a base class or typedef)
//
#define CLASSDECL(classname,macroClassName,macroPreamble) class classname
// structBase is ignored in the macro generation.
// See the notes for CLASSDECL
#define STRUCTDECL(structname,macroStructName,macroPreamble) struct structname
// TPREFIX = type prefix
// TSUFFIX = type suffix
// FIELDNAME = name of the field
// ATTR is used by the perl script and can have the following properties
// get - generate a get() fn
// set - generate a set() fn
// dump/restore - dump/restore this field in the class dump/restore fn.
// OTHER is not used yet.
//
// Examples:
// FLDDECL(int,cpu,,set/get/dump/restore,);
// FLDDECL(long long,reg,[],set/get/dump/restore,);
//
#define FLDDECL(tprefix,fieldname,tsuffix,attr,other) tprefix fieldname tsuffix
// Thus instead of
// struct ABC_t {
// int i;
// char buff[80];
// };
// we would use
// STRUCTDECL(ABC_t,,) {
// FLDDECL(int,i,,,);
// FLDDECL(char,buff,[80],,);
// };
#endif /* _decl_macros_h */