1 /* Native-dependent code for GNU/Linux UltraSPARC. 2 3 Copyright 2003 Free Software Foundation, Inc. 4 5 This file is part of GDB. 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation; either version 2 of the License, or 10 (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program; if not, write to the Free Software 19 Foundation, Inc., 59 Temple Place - Suite 330, 20 Boston, MA 02111-1307, USA. */ 21 22 #include "defs.h" 23 #include "gdbarch.h" 24 25 #include "sparc64-tdep.h" 26 #include "sparc-nat.h" 27 28 /* Determine whether `gregset_t' contains register REGNUM. */ 29 30 static int 31 sparc64_gregset_supplies_p (int regnum) 32 { 33 if (gdbarch_ptr_bit (current_gdbarch) == 32) 34 return sparc32_gregset_supplies_p (regnum); 35 36 /* Integer registers. */ 37 if ((regnum >= SPARC_G1_REGNUM && regnum <= SPARC_G7_REGNUM) 38 || (regnum >= SPARC_O0_REGNUM && regnum <= SPARC_O7_REGNUM) 39 || (regnum >= SPARC_L0_REGNUM && regnum <= SPARC_L7_REGNUM) 40 || (regnum >= SPARC_I0_REGNUM && regnum <= SPARC_I7_REGNUM)) 41 return 1; 42 43 /* Control registers. */ 44 if (regnum == SPARC64_PC_REGNUM 45 || regnum == SPARC64_NPC_REGNUM 46 || regnum == SPARC64_STATE_REGNUM 47 || regnum == SPARC64_Y_REGNUM 48 || regnum == SPARC64_FPRS_REGNUM) 49 return 1; 50 51 return 0; 52 } 53 54 /* Determine whether `fpregset_t' contains register REGNUM. */ 55 56 static int 57 sparc64_fpregset_supplies_p (int regnum) 58 { 59 if (gdbarch_ptr_bit (current_gdbarch) == 32) 60 return sparc32_fpregset_supplies_p (regnum); 61 62 /* Floating-point registers. */ 63 if ((regnum >= SPARC_F0_REGNUM && regnum <= SPARC_F31_REGNUM) 64 || (regnum >= SPARC64_F32_REGNUM && regnum <= SPARC64_F62_REGNUM)) 65 return 1; 66 67 /* Control registers. */ 68 if (regnum == SPARC64_FSR_REGNUM) 69 return 1; 70 71 return 0; 72 } 73 74 75 /* Provide a prototype to silence -Wmissing-prototypes. */ 76 void _initialize_sparc64_nat (void); 77 78 void 79 _initialize_sparc64_nat (void) 80 { 81 sparc_supply_gregset = sparc64_supply_gregset; 82 sparc_collect_gregset = sparc64_collect_gregset; 83 sparc_supply_fpregset = sparc64_supply_fpregset; 84 sparc_collect_fpregset = sparc64_collect_fpregset; 85 sparc_gregset_supplies_p = sparc64_gregset_supplies_p; 86 sparc_fpregset_supplies_p = sparc64_fpregset_supplies_p; 87 } 88