dbg_cp.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* dbg_cp.h -- ARMulator debug interface: ARM6 Instruction Emulator.
  2. Copyright (C) 1994 Advanced RISC Machines Ltd.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, see <http://www.gnu.org/licenses/>. */
  13. #ifndef Dbg_CP__h
  14. #define Dbg_CP__h
  15. #define Dbg_Access_Readable 1
  16. #define Dbg_Access_Writable 2
  17. #define Dbg_Access_CPDT 4 /* else CPRT */
  18. typedef struct
  19. {
  20. unsigned short rmin, rmax;
  21. /* a single description can be used for a range of registers with
  22. the same properties *accessed via CPDT instructions*
  23. */
  24. unsigned char nbytes; /* size of register */
  25. unsigned char access; /* see above (Access_xxx) */
  26. union
  27. {
  28. struct
  29. {
  30. /* CPDT instructions do not allow the coprocessor much freedom:
  31. only bit 22 ('N') and 12-15 ('CRd') are free for the
  32. coprocessor to use as it sees fit. */
  33. unsigned char nbit;
  34. unsigned char rdbits;
  35. }
  36. cpdt;
  37. struct
  38. {
  39. /* CPRT instructions have much more latitude. The bits fixed
  40. by the ARM are 24..31 (condition mask & opcode)
  41. 20 (direction)
  42. 8..15 (cpnum, arm register)
  43. 4 (CPRT not CPDO)
  44. leaving 14 bits free to the coprocessor (fortunately
  45. falling within two bytes). */
  46. unsigned char read_b0, read_b1, write_b0, write_b1;
  47. }
  48. cprt;
  49. }
  50. accessinst;
  51. }
  52. Dbg_CoProRegDesc;
  53. struct Dbg_CoProDesc
  54. {
  55. int entries;
  56. Dbg_CoProRegDesc regdesc[1 /* really nentries */ ];
  57. };
  58. #define Dbg_CoProDesc_Size(n) (sizeof(struct Dbg_CoProDesc) + (n-1)*sizeof(Dbg_CoProRegDesc))
  59. #endif