1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (C) 2020 ARM Ltd. 4 */ 5 #ifndef __ASM_MTE_DEF_H 6 #define __ASM_MTE_DEF_H 7 8 #define MTE_GRANULE_SIZE UL(16) 9 #define MTE_GRANULE_MASK (~(MTE_GRANULE_SIZE - 1)) 10 #define MTE_GRANULES_PER_PAGE (PAGE_SIZE / MTE_GRANULE_SIZE) 11 #define MTE_TAG_SHIFT 56 12 #define MTE_TAG_SIZE 4 13 #define MTE_TAG_MASK GENMASK((MTE_TAG_SHIFT + (MTE_TAG_SIZE - 1)), MTE_TAG_SHIFT) 14 #define MTE_PAGE_TAG_STORAGE (MTE_GRANULES_PER_PAGE * MTE_TAG_SIZE / 8) 15 16 #define __MTE_PREAMBLE ARM64_ASM_PREAMBLE ".arch_extension memtag\n" 17 18 #endif /* __ASM_MTE_DEF_H */ 19