Home | History | Annotate | Line # | Download | only in arch
      1 /* Common AArch64 Linux arch-specific definitions for the scalable
      2    extensions: SVE and SME.
      3 
      4    Copyright (C) 2023-2024 Free Software Foundation, Inc.
      5 
      6    This file is part of GDB.
      7 
      8    This program is free software; you can redistribute it and/or modify
      9    it under the terms of the GNU General Public License as published by
     10    the Free Software Foundation; either version 3 of the License, or
     11    (at your option) any later version.
     12 
     13    This program is distributed in the hope that it will be useful,
     14    but WITHOUT ANY WARRANTY; without even the implied warranty of
     15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16    GNU General Public License for more details.
     17 
     18    You should have received a copy of the GNU General Public License
     19    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
     20 
     21 #ifndef GDB_ARCH_AARCH64_SCALABLE_LINUX_H
     22 #define GDB_ARCH_AARCH64_SCALABLE_LINUX_H
     23 
     24 #include "gdbsupport/common-regcache.h"
     25 
     26 /* Feature check for Scalable Matrix Extension.  */
     27 #ifndef HWCAP2_SME
     28 #define HWCAP2_SME (1 << 23)
     29 #endif
     30 
     31 /* Feature check for Scalable Matrix Extension 2.  */
     32 #ifndef HWCAP2_SME2
     33 #define HWCAP2_SME2   (1UL << 37)
     34 #define HWCAP2_SME2P1 (1UL << 38)
     35 #endif
     36 
     37 /* Streaming mode enabled/disabled bit.  */
     38 #define SVCR_SM_BIT (1 << 0)
     39 /* ZA enabled/disabled bit.  */
     40 #define SVCR_ZA_BIT (1 << 1)
     41 /* Mask including all valid SVCR bits.  */
     42 #define SVCR_BIT_MASK (SVCR_SM_BIT | SVCR_ZA_BIT)
     43 
     44 /* SVE/SSVE-related constants used for an empty SVE/SSVE register set
     45    dumped to a core file.  When SME is supported, either the SVE state or
     46    the SSVE state will be empty when it is dumped to a core file.  */
     47 #define SVE_CORE_DUMMY_SIZE 0x220
     48 #define SVE_CORE_DUMMY_MAX_SIZE 0x2240
     49 #define SVE_CORE_DUMMY_VL 0x10
     50 #define SVE_CORE_DUMMY_MAX_VL 0x100
     51 #define SVE_CORE_DUMMY_FLAGS 0x0
     52 #define SVE_CORE_DUMMY_RESERVED 0x0
     53 
     54 /* Return TRUE if the SVE state in the register cache REGCACHE
     55    is empty (zero).  Return FALSE otherwise.  */
     56 extern bool sve_state_is_empty (const struct reg_buffer_common *reg_buf);
     57 
     58 #endif /* GDB_ARCH_AARCH64_SCALABLE_LINUX_H */
     59