mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
0f83012ea0
Tidy up calls to read HWCAP (and HWCAP2) by adding common functions, removing the PPC and AArch64 specific versions. The only function difference is in aarch64_linux_core_read_description - if the hwcap read fails it now return a valid description instead of nullptr. gdb/ChangeLog: 2019-03-25 Alan Hayward <alan.hayward@arm.com> * aarch64-linux-nat.c (aarch64_linux_nat_target::read_description): Call linux_get_hwcap. * aarch64-linux-tdep.c (aarch64_linux_core_read_description): Likewise. (aarch64_linux_get_hwcap): Remove function. * aarch64-linux-tdep.h (aarch64_linux_get_hwcap): Remove declaration. * arm-linux-nat.c (arm_linux_nat_target::read_description):Call linux_get_hwcap. * arm-linux-tdep.c (arm_linux_core_read_description): Likewise. * linux-tdep.c (linux_get_hwcap): Add function. (linux_get_hwcap2): Likewise. * linux-tdep.h (linux_get_hwcap): Add declaration. (linux_get_hwcap2): Likewise. * ppc-linux-nat.c (ppc_linux_get_hwcap): Remove function. (ppc_linux_get_hwcap2): Likewise. (ppc_linux_nat_target::region_ok_for_hw_watchpoint): Call linux_get_hwcap. (ppc_linux_nat_target::insert_watchpoint): Likewise. (ppc_linux_nat_target::watchpoint_addr_within_range): Likewise. (ppc_linux_nat_target::read_description): Likewise. * ppc-linux-tdep.c (ppc_linux_core_read_description): Likewise. * s390-linux-nat.c: Likewise. * s390-linux-tdep.c (s390_core_read_description): Likewise.
73 lines
2.6 KiB
C
73 lines
2.6 KiB
C
/* Target-dependent code for GNU/Linux, architecture independent.
|
|
|
|
Copyright (C) 2009-2019 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 LINUX_TDEP_H
|
|
#define LINUX_TDEP_H
|
|
|
|
#include "bfd.h"
|
|
|
|
struct regcache;
|
|
|
|
/* Enum used to define the extra fields of the siginfo type used by an
|
|
architecture. */
|
|
enum linux_siginfo_extra_field_values
|
|
{
|
|
/* Add bound fields into the segmentation fault field. */
|
|
LINUX_SIGINFO_FIELD_ADDR_BND = 1
|
|
};
|
|
|
|
/* Defines a type for the values defined in linux_siginfo_extra_field_values. */
|
|
DEF_ENUM_FLAGS_TYPE (enum linux_siginfo_extra_field_values,
|
|
linux_siginfo_extra_fields);
|
|
|
|
/* This function is suitable for architectures that
|
|
extend/override the standard siginfo in a specific way. */
|
|
struct type *linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch,
|
|
linux_siginfo_extra_fields);
|
|
|
|
typedef char *(*linux_collect_thread_registers_ftype) (const struct regcache *,
|
|
ptid_t,
|
|
bfd *, char *, int *,
|
|
enum gdb_signal);
|
|
|
|
extern enum gdb_signal linux_gdb_signal_from_target (struct gdbarch *gdbarch,
|
|
int signal);
|
|
|
|
extern int linux_gdb_signal_to_target (struct gdbarch *gdbarch,
|
|
enum gdb_signal signal);
|
|
|
|
/* Default GNU/Linux implementation of `displaced_step_location', as
|
|
defined in gdbarch.h. Determines the entry point from AT_ENTRY in
|
|
the target auxiliary vector. */
|
|
extern CORE_ADDR linux_displaced_step_location (struct gdbarch *gdbarch);
|
|
|
|
extern void linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch);
|
|
|
|
extern int linux_is_uclinux (void);
|
|
|
|
/* Fetch the AT_HWCAP entry from the auxv vector for the given TARGET. On
|
|
error, 0 is returned. */
|
|
extern CORE_ADDR linux_get_hwcap (struct target_ops *target);
|
|
|
|
/* Fetch the AT_HWCAP2 entry from the auxv vector for the given TARGET. On
|
|
error, 0 is returned. */
|
|
extern CORE_ADDR linux_get_hwcap2 (struct target_ops *target);
|
|
|
|
#endif /* linux-tdep.h */
|