]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/igen/gen.h
run copyright.sh for 2011.
[thirdparty/binutils-gdb.git] / sim / igen / gen.h
index 884e27711e4316bd8c6732178bbbbe0f2694b390..fc19d148455bb31442044ea7fc3413982486487c 100644 (file)
@@ -1,26 +1,28 @@
-/*  This file is part of the program psim.
+/* The IGEN simulator generator for GDB, the GNU Debugger.
 
-    Copyright (C) 1994,1995,1996, Andrew Cagney <cagney@highland.com.au>
+   Copyright 2002, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
+   Contributed by Andrew Cagney.
 
-    This 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 program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-    */
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This 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 program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
 typedef struct _opcode_field opcode_field;
-struct _opcode_field {
+struct _opcode_field
+{
   int word_nr;
   int first;
   int last;
@@ -31,7 +33,8 @@ struct _opcode_field {
 };
 
 typedef struct _opcode_bits opcode_bits;
-struct _opcode_bits {
+struct _opcode_bits
+{
   int value;
   int first;
   int last;
@@ -41,13 +44,15 @@ struct _opcode_bits {
 };
 
 typedef struct _insn_opcodes insn_opcodes;
-struct _insn_opcodes {
+struct _insn_opcodes
+{
   opcode_field *opcode;
   insn_opcodes *next;
 };
 
 typedef struct _insn_list insn_list;
-struct _insn_list {
+struct _insn_list
+{
   /* the instruction */
   insn_entry *insn;
   /* list of non constant bits that have been made constant */
@@ -67,14 +72,15 @@ struct _insn_list {
 typedef struct _gen_list gen_list;
 
 typedef struct _gen_entry gen_entry;
-struct _gen_entry {
+struct _gen_entry
+{
 
   /* as an entry in a table */
   int word_nr;
   int opcode_nr;
   gen_entry *sibling;
   opcode_bits *expanded_bits;
-  gen_entry *parent; /* parent has the opcode* data */
+  gen_entry *parent;           /* parent has the opcode* data */
 
   /* as a table containing entries */
   decode_table *opcode_rule;
@@ -96,7 +102,8 @@ struct _gen_entry {
 };
 
 
-struct _gen_list {
+struct _gen_list
+{
   model_entry *model;
   insn_table *isa;
   gen_entry *table;
@@ -105,7 +112,8 @@ struct _gen_list {
 
 
 typedef struct _gen_table gen_table;
-struct _gen_table {
+struct _gen_table
+{
   /* list of all the instructions */
   insn_table *isa;
   /* list of all the semantic functions */
@@ -118,38 +126,28 @@ struct _gen_table {
 };
 
 
-extern gen_table *make_gen_tables
-(insn_table *isa,
- decode_table *rules);
+extern gen_table *make_gen_tables (insn_table *isa, decode_table *rules);
 
 
-extern void gen_tables_expand_insns
-(gen_table *gen);
+extern void gen_tables_expand_insns (gen_table *gen);
 
-extern void gen_tables_expand_semantics
-(gen_table *gen);
+extern void gen_tables_expand_semantics (gen_table *gen);
 
-extern int gen_entry_depth
-(gen_entry *table);
+extern int gen_entry_depth (gen_entry *table);
 
 
 
 /* Traverse the created data structure */
 
 typedef void gen_entry_handler
-(lf *file,
- gen_entry *entry,
- int depth,
- void *data);
+  (lf *file, gen_entry *entry, int depth, void *data);
 
 extern void gen_entry_traverse_tree
-(lf *file,
- gen_entry *table,
- int depth,
- gen_entry_handler *start,
- gen_entry_handler *leaf,
- gen_entry_handler *end,
- void *data);
+  (lf *file,
+   gen_entry *table,
+   int depth,
+   gen_entry_handler * start,
+   gen_entry_handler * leaf, gen_entry_handler * end, void *data);
 
 
 
@@ -158,70 +156,57 @@ extern void gen_entry_traverse_tree
 
 /* Cache functions: */
 
-extern int print_icache_function_formal
-(lf *file, int nr_prefetched_words);
+extern int print_icache_function_formal (lf *file, int nr_prefetched_words);
 
-extern int print_icache_function_actual
-(lf *file, int nr_prefetched_words);
+extern int print_icache_function_actual (lf *file, int nr_prefetched_words);
 
-extern int print_icache_function_type
-(lf *file);
+extern int print_icache_function_type (lf *file);
 
-extern int print_semantic_function_formal
-(lf *file, int nr_prefetched_words);
+extern int print_semantic_function_formal (lf *file, int nr_prefetched_words);
 
-extern int print_semantic_function_actual
-(lf *file, int nr_prefetched_words);
+extern int print_semantic_function_actual (lf *file, int nr_prefetched_words);
 
-extern int print_semantic_function_type
-(lf *file);
+extern int print_semantic_function_type (lf *file);
 
-extern int print_idecode_function_formal
-(lf *file, int nr_prefetched_words);
+extern int print_idecode_function_formal (lf *file, int nr_prefetched_words);
 
-extern int print_idecode_function_actual
-(lf *file, int nr_prefetched_words);
+extern int print_idecode_function_actual (lf *file, int nr_prefetched_words);
 
-typedef enum {
+typedef enum
+{
   function_name_prefix_semantics,
   function_name_prefix_idecode,
   function_name_prefix_itable,
   function_name_prefix_icache,
   function_name_prefix_engine,
   function_name_prefix_none
-} lf_function_name_prefixes;
+}
+lf_function_name_prefixes;
 
-typedef enum {
+typedef enum
+{
   is_function_declaration = 0,
   is_function_definition = 1,
   is_function_variable,
-} function_decl_type;
+}
+function_decl_type;
 
 extern int print_function_name
-(lf *file,
- const char *basename,
- const char *format_name,
- const char *model_name,
- opcode_bits *expanded_bits,
- lf_function_name_prefixes prefix);
+  (lf *file,
+   const char *basename,
+   const char *format_name,
+   const char *model_name,
+   opcode_bits *expanded_bits, lf_function_name_prefixes prefix);
 
 extern void print_my_defines
-(lf *file,
- const char *basename,
- const char *format_name,
- opcode_bits *expanded_bits);
+  (lf *file,
+   const char *basename, const char *format_name, opcode_bits *expanded_bits);
 
-extern void print_itrace
-(lf *file,
- insn_entry *insn,
- int idecode);
+extern void print_itrace (lf *file, insn_entry * insn, int idecode);
 
-extern void print_sim_engine_abort
-(lf *file,
- const char *message);
+extern void print_sim_engine_abort (lf *file, const char *message);
 
 
 extern void print_include (lf *file, igen_module module);
-extern void print_include_inline  (lf *file, igen_module module);
+extern void print_include_inline (lf *file, igen_module module);
 extern void print_includes (lf *file);
-