Don't deprecate powerpc mftb insn
[platform/upstream/binutils.git] / sim / common / sim-profile.h
index 4ffe850..938ad71 100644 (file)
@@ -1,22 +1,21 @@
 /* Profile header for simulators using common framework.
 /* Profile header for simulators using common framework.
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996-2014 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 This file is part of GDB, the GNU debugger.
 
 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
    Contributed by Cygnus Support.
 
 This file is part of GDB, the GNU debugger.
 
 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, or (at your option)
-any later version.
+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.
 
 
 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.  */
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef SIM_PROFILE_H
 #define SIM_PROFILE_H
 
 #ifndef SIM_PROFILE_H
 #define SIM_PROFILE_H
@@ -96,7 +95,7 @@ SIM_RC sim_profile_set_option (SIM_DESC sd_, const char *name_, int idx_,
 #define WITH_PROFILE_CORE_P (WITH_PROFILE & PROFILE_core)
 
 /* If MAX_TARGET_MODES isn't defined, we can't do memory profiling.
 #define WITH_PROFILE_CORE_P (WITH_PROFILE & PROFILE_core)
 
 /* If MAX_TARGET_MODES isn't defined, we can't do memory profiling.
-   ??? It is intended that this is a temporary occurence.  Normally
+   ??? It is intended that this is a temporary occurrence.  Normally
    MAX_TARGET_MODES is defined.  */
 #ifndef MAX_TARGET_MODES
 #undef WITH_PROFILE_MEMORY_P
    MAX_TARGET_MODES is defined.  */
 #ifndef MAX_TARGET_MODES
 #undef WITH_PROFILE_MEMORY_P
@@ -150,6 +149,10 @@ typedef struct {
   unsigned long total_insn_count;
 #define PROFILE_TOTAL_INSN_COUNT(p) ((p)->total_insn_count)
 
   unsigned long total_insn_count;
 #define PROFILE_TOTAL_INSN_COUNT(p) ((p)->total_insn_count)
 
+  /* CPU frequency.  Always accepted, regardless of profiling options.  */
+  unsigned long cpu_freq;
+#define PROFILE_CPU_FREQ(p) ((p)->cpu_freq)
+
 #if WITH_PROFILE_INSN_P
   unsigned int *insn_count;
 #define PROFILE_INSN_COUNT(p) ((p)->insn_count)
 #if WITH_PROFILE_INSN_P
   unsigned int *insn_count;
 #define PROFILE_INSN_COUNT(p) ((p)->insn_count)
@@ -286,8 +289,24 @@ do { \
 #define PROFILE_COUNT_CORE(cpu, addr, size, map)
 #endif /* ! core */
 
 #define PROFILE_COUNT_CORE(cpu, addr, size, map)
 #endif /* ! core */
 
+#if WITH_PROFILE_MODEL_P
+#define PROFILE_BRANCH_TAKEN(cpu) \
+do { \
+  if (PROFILE_MODEL_P (cpu)) \
+    ++ PROFILE_MODEL_TAKEN_COUNT (CPU_PROFILE_DATA (cpu)); \
+} while (0)
+#define PROFILE_BRANCH_UNTAKEN(cpu) \
+do { \
+  if (PROFILE_MODEL_P (cpu)) \
+    ++ PROFILE_MODEL_UNTAKEN_COUNT (CPU_PROFILE_DATA (cpu)); \
+} while (0)
+#else
+#define PROFILE_BRANCH_TAKEN(cpu)
+#define PROFILE_BRANCH_UNTAKEN(cpu)
+#endif /* ! model */
+
 /* Misc. utilities.  */
 
 /* Misc. utilities.  */
 
-extern void sim_profile_print_bar (SIM_DESC, unsigned int, unsigned int, unsigned int);
+extern void sim_profile_print_bar (SIM_DESC, sim_cpu *, unsigned int, unsigned int, unsigned int);
 
 #endif /* SIM_PROFILE_H */
 
 #endif /* SIM_PROFILE_H */