sim-hw.h 2.1 KB

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