Home | History | Annotate | Line # | Download | only in common
      1   1.1  christos /* Device definitions.
      2  1.11  christos    Copyright (C) 1998-2024 Free Software Foundation, Inc.
      3   1.1  christos    Contributed by Cygnus Support.
      4   1.1  christos 
      5   1.1  christos This file is part of GDB, the GNU debugger.
      6   1.1  christos 
      7   1.1  christos This program is free software; you can redistribute it and/or modify
      8   1.1  christos it under the terms of the GNU General Public License as published by
      9   1.1  christos the Free Software Foundation; either version 3 of the License, or
     10   1.1  christos (at your option) any later version.
     11   1.1  christos 
     12   1.1  christos This program is distributed in the hope that it will be useful,
     13   1.1  christos but WITHOUT ANY WARRANTY; without even the implied warranty of
     14   1.1  christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15   1.1  christos GNU General Public License for more details.
     16   1.1  christos 
     17   1.1  christos You should have received a copy of the GNU General Public License
     18   1.1  christos along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
     19   1.1  christos 
     20   1.1  christos #ifndef SIM_HW_H
     21   1.1  christos #define SIM_HW_H
     22   1.1  christos 
     23  1.10  christos #include <stdarg.h>
     24   1.1  christos 
     25  1.10  christos #include "ansidecl.h"
     26   1.1  christos 
     27   1.1  christos /* Parse a hardware definition */
     28   1.1  christos 
     29   1.1  christos struct hw *sim_hw_parse
     30   1.1  christos (struct sim_state *sd,
     31   1.1  christos  const char *fmt,
     32  1.10  christos  ...) ATTRIBUTE_PRINTF (2, 3);
     33   1.1  christos 
     34   1.1  christos 
     35   1.1  christos /* Print the hardware tree */
     36   1.1  christos 
     37   1.1  christos void sim_hw_print
     38   1.1  christos (struct sim_state *sd,
     39   1.1  christos  void (*print) (struct sim_state *, const char *, va_list ap));
     40   1.1  christos 
     41   1.1  christos 
     42   1.1  christos /* Abort the simulation specifying HW as the reason */
     43   1.1  christos 
     44   1.1  christos void sim_hw_abort
     45   1.1  christos (SIM_DESC sd,
     46   1.1  christos  struct hw *hw,
     47   1.1  christos  const char *fmt,
     48  1.10  christos  ...) ATTRIBUTE_PRINTF (3, 4) ATTRIBUTE_NORETURN;
     49   1.1  christos 
     50   1.1  christos 
     51   1.1  christos 
     52   1.1  christos /* CPU: The simulation is running and the current CPU/CIA
     53   1.1  christos    initiates a data transfer. */
     54   1.1  christos 
     55   1.1  christos void sim_cpu_hw_io_read_buffer
     56   1.1  christos (sim_cpu *cpu,
     57   1.1  christos  sim_cia cia,
     58   1.1  christos  struct hw *hw,
     59   1.1  christos  void *dest,
     60   1.1  christos  int space,
     61   1.1  christos  unsigned_word addr,
     62   1.1  christos  unsigned nr_bytes);
     63   1.1  christos 
     64   1.1  christos void sim_cpu_hw_io_write_buffer
     65   1.1  christos (sim_cpu *cpu,
     66   1.1  christos  sim_cia cia,
     67   1.1  christos  struct hw *hw,
     68   1.1  christos  const void *source,
     69   1.1  christos  int space,
     70   1.1  christos  unsigned_word addr,
     71   1.1  christos  unsigned nr_bytes);
     72   1.1  christos 
     73   1.1  christos 
     74   1.1  christos 
     75   1.1  christos /* SYSTEM: A data transfer is being initiated by the system. */
     76   1.1  christos 
     77   1.1  christos unsigned sim_hw_io_read_buffer
     78   1.1  christos (struct sim_state *sd,
     79   1.1  christos  struct hw *hw,
     80   1.1  christos  void *dest,
     81   1.1  christos  int space,
     82   1.1  christos  unsigned_word addr,
     83   1.1  christos  unsigned nr_bytes);
     84   1.1  christos 
     85   1.1  christos unsigned sim_hw_io_write_buffer
     86   1.1  christos (struct sim_state *sd,
     87   1.1  christos  struct hw *hw,
     88   1.1  christos  const void *source,
     89   1.1  christos  int space,
     90   1.1  christos  unsigned_word addr,
     91   1.1  christos  unsigned nr_bytes);
     92   1.1  christos 
     93   1.1  christos 
     94   1.1  christos #endif
     95