mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-24 12:35:55 +08:00
4601818e8c
The patch implements the memory tagging target hooks for AArch64, so we can handle MTE. gdb/ChangeLog: 2021-03-24 Luis Machado <luis.machado@linaro.org> * Makefile.in (ALL_64_TARGET_OBS): Add arch/aarch64-mte-linux.o. (HFILES_NO_SRCDIR): Add arch/aarch64-mte-linux.h and nat/aarch64-mte-linux-ptrace.h. * aarch64-linux-nat.c: Include nat/aarch64-mte-linux-ptrace.h. (aarch64_linux_nat_target) <supports_memory_tagging>: New method override. <fetch_memtags>: New method override. <store_memtags>: New method override. (aarch64_linux_nat_target::supports_memory_tagging): New method. (aarch64_linux_nat_target::fetch_memtags): New method. (aarch64_linux_nat_target::store_memtags): New method. * arch/aarch64-mte-linux.c: New file. * arch/aarch64-mte-linux.h: Include gdbsupport/common-defs.h. (AARCH64_MTE_GRANULE_SIZE): Define. (aarch64_memtag_type): New enum. (aarch64_mte_get_tag_granules): New prototype. * configure.nat (NATDEPFILES): Add nat/aarch64-mte-linux-ptrace.o. * configure.tgt (aarch64*-*-linux*): Add arch/aarch64-mte-linux.o. * nat/aarch64-mte-linux-ptrace.c: New file. * nat/aarch64-mte-linux-ptrace.h: New file.
51 lines
1.6 KiB
C
51 lines
1.6 KiB
C
/* Common Linux target-dependent definitions for AArch64 MTE
|
|
|
|
Copyright (C) 2021 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_AARCH64_LINUX_H
|
|
#define ARCH_AARCH64_LINUX_H
|
|
|
|
#include "gdbsupport/common-defs.h"
|
|
|
|
/* Feature check for Memory Tagging Extension. */
|
|
#ifndef HWCAP2_MTE
|
|
#define HWCAP2_MTE (1 << 18)
|
|
#endif
|
|
|
|
/* The MTE regset consists of a single 64-bit register. */
|
|
#define AARCH64_LINUX_SIZEOF_MTE 8
|
|
|
|
/* We have one tag per 16 bytes of memory. */
|
|
#define AARCH64_MTE_GRANULE_SIZE 16
|
|
|
|
/* Memory tag types for AArch64. */
|
|
enum class aarch64_memtag_type
|
|
{
|
|
/* MTE logical tag contained in pointers. */
|
|
mte_logical = 0,
|
|
/* MTE allocation tag stored in memory tag granules. */
|
|
mte_allocation
|
|
};
|
|
|
|
/* Return the number of tag granules in the memory range
|
|
[ADDR, ADDR + LEN) given GRANULE_SIZE. */
|
|
extern size_t aarch64_mte_get_tag_granules (CORE_ADDR addr, size_t len,
|
|
size_t granule_size);
|
|
|
|
#endif /* ARCH_AARCH64_LINUX_H */
|