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