X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fremote-vxmips.c;h=b7da27ad97327ef309b56f07445c0f7a116e7732;hb=00fdaf47d569ebbc021b5bdc8206b9c461387e44;hp=c65ac015ead74f3c0d10261d40ca81364ab73caa;hpb=5b64ad42d36e6d487e1f7287d37fbc243a178e72;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/remote-vxmips.c b/gdb/remote-vxmips.c index c65ac015ea..b7da27ad97 100644 --- a/gdb/remote-vxmips.c +++ b/gdb/remote-vxmips.c @@ -1,31 +1,32 @@ /* MIPS-dependent portions of the RPC protocol used with a VxWorks target -Contributed by Wind River Systems. + Contributed by Wind River Systems. -This file is part of GDB. + This file is part of GDB. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include "defs.h" -#include "vx-share/regPacket.h" +#include "vx-share/regPacket.h" #include "frame.h" #include "inferior.h" -#include "wait.h" +#include "gdb_wait.h" #include "target.h" #include "gdbcore.h" #include "command.h" @@ -66,8 +67,7 @@ extern void net_write_registers (); it is ignored. FIXME look at regno to improve efficiency. */ void -vx_read_register (regno) - int regno; +vx_read_register (int regno) { char mips_greg_packet[MIPS_GREG_PLEN]; char mips_fpreg_packet[MIPS_FPREG_PLEN]; @@ -78,50 +78,50 @@ vx_read_register (regno) /* this code copies the registers obtained by RPC stored in a structure(s) like this : - - Register(s) Offset(s) - gp 0-31 0x00 - hi 0x80 - lo 0x84 - sr 0x88 - pc 0x8c - + + Register(s) Offset(s) + gp 0-31 0x00 + hi 0x80 + lo 0x84 + sr 0x88 + pc 0x8c + into a stucture like this: - - 0x00 GP 0-31 - 0x80 SR - 0x84 LO - 0x88 HI - 0x8C BAD --- Not available currently - 0x90 CAUSE --- Not available currently - 0x94 PC - 0x98 FP 0-31 - 0x118 FCSR - 0x11C FIR --- Not available currently - 0x120 FP --- Not available currently - + + 0x00 GP 0-31 + 0x80 SR + 0x84 LO + 0x88 HI + 0x8C BAD --- Not available currently + 0x90 CAUSE --- Not available currently + 0x94 PC + 0x98 FP 0-31 + 0x118 FCSR + 0x11C FIR --- Not available currently + 0x120 FP --- Not available currently + structure is 0x124 (292) bytes in length */ - + /* Copy the general registers. */ - + bcopy (&mips_greg_packet[MIPS_R_GP0], ®isters[0], 32 * MIPS_GREG_SIZE); - + /* Copy SR, LO, HI, and PC. */ - + bcopy (&mips_greg_packet[MIPS_R_SR], - ®isters[REGISTER_BYTE (PS_REGNUM)], MIPS_GREG_SIZE); + ®isters[REGISTER_BYTE (PS_REGNUM)], MIPS_GREG_SIZE); bcopy (&mips_greg_packet[MIPS_R_LO], - ®isters[REGISTER_BYTE (LO_REGNUM)], MIPS_GREG_SIZE); + ®isters[REGISTER_BYTE (LO_REGNUM)], MIPS_GREG_SIZE); bcopy (&mips_greg_packet[MIPS_R_HI], - ®isters[REGISTER_BYTE (HI_REGNUM)], MIPS_GREG_SIZE); + ®isters[REGISTER_BYTE (HI_REGNUM)], MIPS_GREG_SIZE); bcopy (&mips_greg_packet[MIPS_R_PC], - ®isters[REGISTER_BYTE (PC_REGNUM)], MIPS_GREG_SIZE); - + ®isters[REGISTER_BYTE (PC_REGNUM)], MIPS_GREG_SIZE); + /* If the target has floating point registers, fetch them. Otherwise, zero the floating point register values in registers[] for good measure, even though we might not need to. */ - + if (target_has_fp) { net_read_registers (mips_fpreg_packet, MIPS_FPREG_PLEN, @@ -129,23 +129,23 @@ vx_read_register (regno) /* Copy the floating point registers. */ - bcopy (&mips_fpreg_packet[MIPS_R_FP0], + bcopy (&mips_fpreg_packet[MIPS_R_FP0], ®isters[REGISTER_BYTE (FP0_REGNUM)], REGISTER_RAW_SIZE (FP0_REGNUM) * 32); /* Copy the floating point control/status register (fpcsr). */ - bcopy (&mips_fpreg_packet[MIPS_R_FPCSR], + bcopy (&mips_fpreg_packet[MIPS_R_FPCSR], ®isters[REGISTER_BYTE (FCRCS_REGNUM)], REGISTER_RAW_SIZE (FCRCS_REGNUM)); - } + } else - { + { bzero ((char *) ®isters[REGISTER_BYTE (FP0_REGNUM)], REGISTER_RAW_SIZE (FP0_REGNUM) * 32); bzero ((char *) ®isters[REGISTER_BYTE (FCRCS_REGNUM)], REGISTER_RAW_SIZE (FCRCS_REGNUM)); - } + } /* Mark the register cache valid. */ @@ -156,8 +156,7 @@ vx_read_register (regno) REGNO is the register to store, or -1 for all; currently, it is ignored. FIXME look at regno to improve efficiency. */ -vx_write_register (regno) - int regno; +vx_write_register (int regno) { char mips_greg_packet[MIPS_GREG_PLEN]; char mips_fpreg_packet[MIPS_FPREG_PLEN]; @@ -165,18 +164,18 @@ vx_write_register (regno) /* Store general registers. */ bcopy (®isters[0], &mips_greg_packet[MIPS_R_GP0], 32 * MIPS_GREG_SIZE); - + /* Copy SR, LO, HI, and PC. */ - + bcopy (®isters[REGISTER_BYTE (PS_REGNUM)], - &mips_greg_packet[MIPS_R_SR], MIPS_GREG_SIZE); + &mips_greg_packet[MIPS_R_SR], MIPS_GREG_SIZE); bcopy (®isters[REGISTER_BYTE (LO_REGNUM)], - &mips_greg_packet[MIPS_R_LO], MIPS_GREG_SIZE); + &mips_greg_packet[MIPS_R_LO], MIPS_GREG_SIZE); bcopy (®isters[REGISTER_BYTE (HI_REGNUM)], - &mips_greg_packet[MIPS_R_HI], MIPS_GREG_SIZE); + &mips_greg_packet[MIPS_R_HI], MIPS_GREG_SIZE); bcopy (®isters[REGISTER_BYTE (PC_REGNUM)], - &mips_greg_packet[MIPS_R_PC], MIPS_GREG_SIZE); - + &mips_greg_packet[MIPS_R_PC], MIPS_GREG_SIZE); + net_write_registers (mips_greg_packet, MIPS_GREG_PLEN, PTRACE_SETREGS); /* Store floating point registers if the target has them. */ @@ -186,13 +185,13 @@ vx_write_register (regno) /* Copy the floating point data registers. */ bcopy (®isters[REGISTER_BYTE (FP0_REGNUM)], - &mips_fpreg_packet[MIPS_R_FP0], + &mips_fpreg_packet[MIPS_R_FP0], REGISTER_RAW_SIZE (FP0_REGNUM) * 32); /* Copy the floating point control/status register (fpcsr). */ bcopy (®isters[REGISTER_BYTE (FCRCS_REGNUM)], - &mips_fpreg_packet[MIPS_R_FPCSR], + &mips_fpreg_packet[MIPS_R_FPCSR], REGISTER_RAW_SIZE (FCRCS_REGNUM)); net_write_registers (mips_fpreg_packet, MIPS_FPREG_PLEN,