X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=sim%2Ferc32%2Fsis.h;h=65e9351461315073427f55af7b074e84da19d12c;hb=3922b302645fda04da42a5279399578ae2f6206c;hp=a1cf00b8e66f020aaa6c12cf886f5a8500aa9c62;hpb=51b318dec8f66b2544b24c359ff3d69425d0d6ff;p=deliverable%2Fbinutils-gdb.git diff --git a/sim/erc32/sis.h b/sim/erc32/sis.h index a1cf00b8e6..65e9351461 100644 --- a/sim/erc32/sis.h +++ b/sim/erc32/sis.h @@ -1,30 +1,32 @@ -/* - * This file is part of SIS. - * - * ERC32SIM, SPARC instruction simulator. Copyright (C) 1995 Jiri Gaisler, - * European Space Agency - * - * 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 . - * - */ +/* Copyright (C) 1995-2020 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 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 . */ #include "config.h" #include "ansidecl.h" #include "gdb/callback.h" #include "gdb/remote-sim.h" +#include +#include -#include "end.h" +#if HOST_BYTE_ORDER == BIG_ENDIAN +#define HOST_BIG_ENDIAN +#define EBT 0 +#else +#define HOST_LITTLE_ENDIAN +#define EBT 3 +#endif #define I_ACC_EXC 1 @@ -51,16 +53,13 @@ typedef unsigned int uint32; /* 32-bit unsigned int */ typedef float float32; /* 32-bit float */ typedef double float64; /* 64-bit float */ -/* FIXME: what about host compilers that don't support 64-bit ints? */ -typedef unsigned long long uint64; /* 64-bit unsigned int */ -typedef long long int64; /* 64-bit signed int */ - -#define UINT64_MAX 18446744073709551615ULL +typedef uint64_t uint64; /* 64-bit unsigned int */ +typedef int64_t int64; /* 64-bit signed int */ struct pstate { float64 fd[16]; /* FPU registers */ -#ifdef HOST_LITTLE_ENDIAN_FLOAT +#ifdef HOST_LITTLE_ENDIAN float32 fs[32]; float32 *fdp; #else @@ -110,14 +109,14 @@ struct pstate { float32 freq; /* Simulated processor frequency */ - uint64 tottime; + double tottime; uint64 ninst; uint64 fholdt; uint64 holdt; uint64 icntt; uint64 finst; uint64 simstart; - uint64 starttime; + double starttime; uint64 tlimit; /* Simulation time limit */ uint64 pwdtime; /* Cycles in power-down mode */ uint64 nstore; /* Number of load instructions */ @@ -159,61 +158,64 @@ struct irqcell { /* Prototypes */ /* erc32.c */ -extern void init_sim PARAMS ((void)); -extern void reset PARAMS ((void)); -extern void error_mode PARAMS ((uint32 pc)); -extern void sim_halt PARAMS ((void)); -extern void exit_sim PARAMS ((void)); -extern void init_stdio PARAMS ((void)); -extern void restore_stdio PARAMS ((void)); -extern int memory_read PARAMS ((int32 asi, uint32 addr, uint32 *data, - int32 sz, int32 *ws)); -extern int memory_write PARAMS ((int32 asi, uint32 addr, uint32 *data, - int32 sz, int32 *ws)); -extern int sis_memory_write PARAMS ((uint32 addr, - const unsigned char *data, uint32 length)); -extern int sis_memory_read PARAMS ((uint32 addr, char *data, - uint32 length)); +extern void init_sim (void); +extern void reset (void); +extern void error_mode (uint32 pc); +extern void sim_halt (void); +extern void exit_sim (void); +extern void init_stdio (void); +extern void restore_stdio (void); +extern int memory_iread (uint32 addr, uint32 *data, int32 *ws); +extern int memory_read (int32 asi, uint32 addr, uint32 *data, + int32 sz, int32 *ws); +extern int memory_write (int32 asi, uint32 addr, uint32 *data, + int32 sz, int32 *ws); +extern int sis_memory_write (uint32 addr, + const unsigned char *data, uint32 length); +extern int sis_memory_read (uint32 addr, char *data, + uint32 length); /* func.c */ -extern void set_regi PARAMS ((struct pstate *sregs, int32 reg, - uint32 rval)); -extern void get_regi PARAMS ((struct pstate *sregs, int32 reg, char *buf)); -extern int exec_cmd PARAMS ((struct pstate *sregs, char *cmd)); -extern void reset_stat PARAMS ((struct pstate *sregs)); -extern void show_stat PARAMS ((struct pstate *sregs)); -extern void init_bpt PARAMS ((struct pstate *sregs)); -extern void init_signals PARAMS ((void)); +extern struct pstate sregs; +extern void set_regi (struct pstate *sregs, int32 reg, + uint32 rval); +extern void get_regi (struct pstate *sregs, int32 reg, char *buf); +extern int exec_cmd (struct pstate *sregs, const char *cmd); +extern void reset_stat (struct pstate *sregs); +extern void show_stat (struct pstate *sregs); +extern void init_bpt (struct pstate *sregs); +extern void init_signals (void); struct disassemble_info; -extern void dis_mem PARAMS ((uint32 addr, uint32 len, - struct disassemble_info *info)); -extern void event PARAMS ((void (*cfunc) (), int32 arg, uint64 delta)); -extern void set_int PARAMS ((int32 level, void (*callback) (), int32 arg)); -extern void advance_time PARAMS ((struct pstate *sregs)); -extern uint32 now PARAMS ((void)); -extern int wait_for_irq PARAMS ((void)); -extern int check_bpt PARAMS ((struct pstate *sregs)); -extern void reset_all PARAMS ((void)); -extern void sys_reset PARAMS ((void)); -extern void sys_halt PARAMS ((void)); -extern int bfd_load PARAMS ((char *fname)); +extern void dis_mem (uint32 addr, uint32 len, + struct disassemble_info *info); +extern void event (void (*cfunc) (), int32 arg, uint64 delta); +extern void set_int (int32 level, void (*callback) (), int32 arg); +extern void advance_time (struct pstate *sregs); +extern uint32 now (void); +extern int wait_for_irq (void); +extern int check_bpt (struct pstate *sregs); +extern void reset_all (void); +extern void sys_reset (void); +extern void sys_halt (void); +extern int bfd_load (const char *fname); +extern double get_time (void); /* exec.c */ -extern int dispatch_instruction PARAMS ((struct pstate *sregs)); -extern int execute_trap PARAMS ((struct pstate *sregs)); -extern int check_interrupts PARAMS ((struct pstate *sregs)); -extern void init_regs PARAMS ((struct pstate *sregs)); +extern int dispatch_instruction (struct pstate *sregs); +extern int execute_trap (struct pstate *sregs); +extern int check_interrupts (struct pstate *sregs); +extern void init_regs (struct pstate *sregs); /* interf.c */ -extern int run_sim PARAMS ((struct pstate *sregs, - uint64 icount, int dis)); +extern int run_sim (struct pstate *sregs, + uint64 icount, int dis); /* float.c */ -extern int get_accex PARAMS ((void)); -extern void clear_accex PARAMS ((void)); -extern void set_fsr PARAMS ((uint32 fsr)); +extern int get_accex (void); +extern void clear_accex (void); +extern void set_fsr (uint32 fsr); /* help.c */ -extern void usage PARAMS ((void)); -extern void gen_help PARAMS ((void)); +extern void usage (void); +extern void gen_help (void);