Commit | Line | Data |
---|---|---|
04245125 LM |
1 | /* Common Linux target-dependent definitions for AArch64 MTE |
2 | ||
3 | Copyright (C) 2021 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 3 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, see <http://www.gnu.org/licenses/>. */ | |
19 | ||
20 | #ifndef ARCH_AARCH64_LINUX_H | |
21 | #define ARCH_AARCH64_LINUX_H | |
22 | ||
4601818e LM |
23 | #include "gdbsupport/common-defs.h" |
24 | ||
04245125 LM |
25 | /* Feature check for Memory Tagging Extension. */ |
26 | #ifndef HWCAP2_MTE | |
27 | #define HWCAP2_MTE (1 << 18) | |
28 | #endif | |
29 | ||
5e984dbf LM |
30 | /* The MTE regset consists of a single 64-bit register. */ |
31 | #define AARCH64_LINUX_SIZEOF_MTE 8 | |
32 | ||
4601818e LM |
33 | /* We have one tag per 16 bytes of memory. */ |
34 | #define AARCH64_MTE_GRANULE_SIZE 16 | |
35 | ||
36 | /* Memory tag types for AArch64. */ | |
37 | enum class aarch64_memtag_type | |
38 | { | |
39 | /* MTE logical tag contained in pointers. */ | |
40 | mte_logical = 0, | |
41 | /* MTE allocation tag stored in memory tag granules. */ | |
42 | mte_allocation | |
43 | }; | |
44 | ||
45 | /* Return the number of tag granules in the memory range | |
46 | [ADDR, ADDR + LEN) given GRANULE_SIZE. */ | |
47 | extern size_t aarch64_mte_get_tag_granules (CORE_ADDR addr, size_t len, | |
48 | size_t granule_size); | |
49 | ||
04245125 | 50 | #endif /* ARCH_AARCH64_LINUX_H */ |