185f49caeSVincenzo Frascino /* SPDX-License-Identifier: GPL-2.0 */ 285f49caeSVincenzo Frascino /* 385f49caeSVincenzo Frascino * Copyright (C) 2020 ARM Ltd. 485f49caeSVincenzo Frascino */ 585f49caeSVincenzo Frascino #ifndef __ASM_MTE_DEF_H 685f49caeSVincenzo Frascino #define __ASM_MTE_DEF_H 785f49caeSVincenzo Frascino 885f49caeSVincenzo Frascino #define MTE_GRANULE_SIZE UL(16) 985f49caeSVincenzo Frascino #define MTE_GRANULE_MASK (~(MTE_GRANULE_SIZE - 1)) 10f0376edbSSteven Price #define MTE_GRANULES_PER_PAGE (PAGE_SIZE / MTE_GRANULE_SIZE) 1185f49caeSVincenzo Frascino #define MTE_TAG_SHIFT 56 1285f49caeSVincenzo Frascino #define MTE_TAG_SIZE 4 1385f49caeSVincenzo Frascino #define MTE_TAG_MASK GENMASK((MTE_TAG_SHIFT + (MTE_TAG_SIZE - 1)), MTE_TAG_SHIFT) 14*ab1e435cSCatalin Marinas #define MTE_PAGE_TAG_STORAGE (MTE_GRANULES_PER_PAGE * MTE_TAG_SIZE / 8) 1585f49caeSVincenzo Frascino 162cb34276SAndrey Konovalov #define __MTE_PREAMBLE ARM64_ASM_PREAMBLE ".arch_extension memtag\n" 172cb34276SAndrey Konovalov 1885f49caeSVincenzo Frascino #endif /* __ASM_MTE_DEF_H */ 19