OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gdb-6.8/] [pre-binutils-2.20.1-sync/] [sim/] [ppc/] [misc.h] - Diff between revs 157 and 223

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 157 Rev 223
/*  This file is part of the program psim.
/*  This file is part of the program psim.
 
 
    Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
    Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
 
 
    This program is free software; you can redistribute it and/or modify
    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
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    (at your option) any later version.
 
 
    This program is distributed in the hope that it will be useful,
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    GNU General Public License for more details.
 
 
    You should have received a copy of the GNU General Public License
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
    */
    */
 
 
 
 
/* Frustrating header junk */
/* Frustrating header junk */
 
 
#include "config.h"
#include "config.h"
 
 
#include <stdio.h>
#include <stdio.h>
#include <ctype.h>
#include <ctype.h>
 
 
#ifdef HAVE_STRING_H
#ifdef HAVE_STRING_H
#include <string.h>
#include <string.h>
#else
#else
#ifdef HAVE_STRINGS_H
#ifdef HAVE_STRINGS_H
#include <strings.h>
#include <strings.h>
#endif
#endif
#endif
#endif
 
 
#ifdef HAVE_STDLIB_H
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#include <stdlib.h>
#endif
#endif
 
 
#if !defined (__attribute__) && (!defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7))
#if !defined (__attribute__) && (!defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7))
#define __attribute__(arg)
#define __attribute__(arg)
#endif
#endif
 
 
 
 
 
 
#include "filter_filename.h"
#include "filter_filename.h"
 
 
extern void error
extern void error
(char *msg, ...);
(char *msg, ...);
 
 
#define ASSERT(EXPRESSION) \
#define ASSERT(EXPRESSION) \
do { \
do { \
  if (!(EXPRESSION)) { \
  if (!(EXPRESSION)) { \
    error("%s:%d: assertion failed - %s\n", \
    error("%s:%d: assertion failed - %s\n", \
          filter_filename (__FILE__), __LINE__, #EXPRESSION); \
          filter_filename (__FILE__), __LINE__, #EXPRESSION); \
  } \
  } \
} while (0)
} while (0)
 
 
#define ZALLOC(TYPE) (TYPE*)zalloc(sizeof(TYPE))
#define ZALLOC(TYPE) (TYPE*)zalloc(sizeof(TYPE))
#define NZALLOC(TYPE,N) ((TYPE*) zalloc (sizeof(TYPE) * (N)))
#define NZALLOC(TYPE,N) ((TYPE*) zalloc (sizeof(TYPE) * (N)))
 
 
extern void *zalloc
extern void *zalloc
(long size);
(long size);
 
 
extern void dumpf
extern void dumpf
(int indent, char *msg, ...);
(int indent, char *msg, ...);
 
 
extern unsigned target_a2i
extern unsigned target_a2i
(int ms_bit_nr,
(int ms_bit_nr,
 const char *a);
 const char *a);
 
 
extern unsigned i2target
extern unsigned i2target
(int ms_bit_nr,
(int ms_bit_nr,
 unsigned bit);
 unsigned bit);
 
 
extern unsigned a2i
extern unsigned a2i
(const char *a);
(const char *a);
 
 
/* Try looking for name in the map table (returning the corresponding
/* Try looking for name in the map table (returning the corresponding
   integer value).  If that fails, try converting the name into an
   integer value).  If that fails, try converting the name into an
   integer */
   integer */
 
 
typedef struct _name_map {
typedef struct _name_map {
  const char *name;
  const char *name;
  int i;
  int i;
} name_map;
} name_map;
 
 
extern int name2i
extern int name2i
(const char *name,
(const char *name,
 const name_map *map);
 const name_map *map);
 
 
extern const char *i2name
extern const char *i2name
(const int i,
(const int i,
 const name_map *map);
 const name_map *map);
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.