ppc-linux-common.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* Common target dependent code for GNU/Linux on PPC systems.
  2. Copyright (C) 2018-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef ARCH_PPC_LINUX_COMMON_H
  15. #define ARCH_PPC_LINUX_COMMON_H
  16. struct target_desc;
  17. /* The core file VMX regset has 34 16-byte fields (32 16-byte vector
  18. registers, plus two fields containing 4-byte registers, VSCR and
  19. VRSAVE), while the ptrace calls return or read 33 16-byte fields
  20. plus a 4-byte field for VRSAVE. For simplicity we use the longer
  21. length for both cases. */
  22. #define PPC_LINUX_SIZEOF_VRREGSET 544
  23. #define PPC_LINUX_SIZEOF_VSXREGSET 256
  24. #define PPC_LINUX_SIZEOF_PPRREGSET 8
  25. #define PPC_LINUX_SIZEOF_DSCRREGSET 8
  26. #define PPC_LINUX_SIZEOF_TARREGSET 8
  27. #define PPC_LINUX_SIZEOF_EBBREGSET (3*8)
  28. #define PPC_LINUX_SIZEOF_PMUREGSET (5*8)
  29. #define PPC_LINUX_SIZEOF_TM_SPRREGSET (3*8)
  30. #define PPC32_LINUX_SIZEOF_CGPRREGSET (48*4)
  31. #define PPC64_LINUX_SIZEOF_CGPRREGSET (48*8)
  32. #define PPC_LINUX_SIZEOF_CFPRREGSET (32*8+8)
  33. #define PPC_LINUX_SIZEOF_CVMXREGSET (34*16)
  34. #define PPC_LINUX_SIZEOF_CVSXREGSET (32*8)
  35. #define PPC_LINUX_SIZEOF_CPPRREGSET 8
  36. #define PPC_LINUX_SIZEOF_CDSCRREGSET 8
  37. #define PPC_LINUX_SIZEOF_CTARREGSET 8
  38. /* Check if the hwcap auxv entry indicates that isa205 is supported. */
  39. bool ppc_linux_has_isa205 (CORE_ADDR hwcap);
  40. /* Features used to determine the target description. */
  41. struct ppc_linux_features
  42. {
  43. unsigned int wordsize;
  44. bool altivec;
  45. bool vsx;
  46. bool isa205;
  47. bool ppr_dscr;
  48. bool isa207;
  49. bool htm;
  50. };
  51. /* Base value for ppc_linux_features variables. */
  52. const struct ppc_linux_features ppc_linux_no_features = {
  53. 0,
  54. false,
  55. false,
  56. false,
  57. false,
  58. false,
  59. false,
  60. };
  61. /* Return a target description that matches FEATURES. */
  62. const struct target_desc * ppc_linux_match_description
  63. (struct ppc_linux_features features);
  64. #endif /* ARCH_PPC_LINUX_COMMON_H */