sparc-linux-nat.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* Native-dependent code for GNU/Linux SPARC.
  2. Copyright (C) 2005-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. #include "defs.h"
  15. #include "regcache.h"
  16. #include <sys/procfs.h>
  17. #include "gregset.h"
  18. #include "sparc-tdep.h"
  19. #include "sparc-nat.h"
  20. #include "inferior.h"
  21. #include "target.h"
  22. #include "linux-nat.h"
  23. class sparc_linux_nat_target final : public linux_nat_target
  24. {
  25. public:
  26. /* Add our register access methods. */
  27. void fetch_registers (struct regcache *regcache, int regnum) override
  28. { sparc_fetch_inferior_registers (this, regcache, regnum); }
  29. void store_registers (struct regcache *regcache, int regnum) override
  30. { sparc_store_inferior_registers (this, regcache, regnum); }
  31. };
  32. static sparc_linux_nat_target the_sparc_linux_nat_target;
  33. void
  34. supply_gregset (struct regcache *regcache, const prgregset_t *gregs)
  35. {
  36. sparc32_supply_gregset (sparc_gregmap, regcache, -1, gregs);
  37. }
  38. void
  39. supply_fpregset (struct regcache *regcache, const prfpregset_t *fpregs)
  40. {
  41. sparc32_supply_fpregset (sparc_fpregmap, regcache, -1, fpregs);
  42. }
  43. void
  44. fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum)
  45. {
  46. sparc32_collect_gregset (sparc_gregmap, regcache, regnum, gregs);
  47. }
  48. void
  49. fill_fpregset (const struct regcache *regcache,
  50. prfpregset_t *fpregs, int regnum)
  51. {
  52. sparc32_collect_fpregset (sparc_fpregmap, regcache, regnum, fpregs);
  53. }
  54. void _initialize_sparc_linux_nat ();
  55. void
  56. _initialize_sparc_linux_nat ()
  57. {
  58. sparc_fpregmap = &sparc32_bsd_fpregmap;
  59. /* Register the target. */
  60. linux_target = &the_sparc_linux_nat_target;
  61. add_inf_child_target (&the_sparc_linux_nat_target);
  62. }