mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
This patch defines constants for the sizes of the two vector regsets (vector-scalar registers and regular vector registers). The native, gdbserver and core file targets are changed to use these constants. The Linux ptrace calls return (or read) a smaller regset than the one found in core files for vector registers, because ptrace uses a single 4-byte quantity for vrsave at the end of the regset, while the core-file regset uses a full 16-byte field for vrsave. For simplicity, the larger size is used in both cases, and so a buffer with 12 unused additional bytes is passed to ptrace in the native target. gdb/ChangeLog: 2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com> * arch/ppc-linux-common.h (PPC_LINUX_SIZEOF_VRREGSET) (PPC_LINUX_SIZEOF_VSXREGSET): Define. * ppc-linux-nat.c (SIZEOF_VSXREGS, SIZEOF_VRREGS): Remove. (gdb_vrregset_t): Change array type size to PPC_LINUX_SIZEOF_VRREGSET. (gdb_vsxregset_t): Change array type size to PPC_LINUX_SIZEOF_VSXREGSET. * ppc-linux-tdep.c (ppc_linux_iterate_over_regset_sections): Change integer literals to PPC_LINUX_SIZEOF_VRREGSET and PPC_LINUX_SIZEOF_VSXREGSET. gdb/gdbserver/ChangeLog: 2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com> * linux-ppc-low.c (SIZEOF_VSXREGS, SIZEOF_VRREGS): Remove. (ppc_arch_setup): Change SIZEOF_VRREGS and SIZEOF_VSXREGS to PPC_LINUX_SIZEOF_VRREGSET and PPC_LINUX_SIZEOF_VSXREGSET.
61 lines
1.9 KiB
C
61 lines
1.9 KiB
C
/* Common target dependent code for GNU/Linux on PPC systems.
|
|
|
|
Copyright (C) 2018 Free Software Foundation, Inc.
|
|
|
|
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 3 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.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#ifndef ARCH_PPC_LINUX_COMMON_H
|
|
#define ARCH_PPC_LINUX_COMMON_H
|
|
|
|
struct target_desc;
|
|
|
|
/* The core file VMX regset has 34 16-byte fields (32 16-byte vector
|
|
registers, plus two fields containing 4-byte registers, VSCR and
|
|
VRSAVE), while the ptrace calls return or read 33 16-byte fields
|
|
plus a 4-byte field for VRSAVE. For simplicity we use the longer
|
|
length for both cases. */
|
|
#define PPC_LINUX_SIZEOF_VRREGSET 544
|
|
|
|
#define PPC_LINUX_SIZEOF_VSXREGSET 256
|
|
|
|
/* Check if the hwcap auxv entry indicates that isa205 is supported. */
|
|
bool ppc_linux_has_isa205 (unsigned long hwcap);
|
|
|
|
/* Features used to determine the target description. */
|
|
struct ppc_linux_features
|
|
{
|
|
unsigned int wordsize;
|
|
bool altivec;
|
|
bool vsx;
|
|
bool isa205;
|
|
bool cell;
|
|
};
|
|
|
|
/* Base value for ppc_linux_features variables. */
|
|
const struct ppc_linux_features ppc_linux_no_features = {
|
|
0,
|
|
false,
|
|
false,
|
|
false,
|
|
false,
|
|
};
|
|
|
|
/* Return a target description that matches FEATURES. */
|
|
const struct target_desc * ppc_linux_match_description
|
|
(struct ppc_linux_features features);
|
|
|
|
#endif /* ARCH_PPC_LINUX_COMMON_H */
|