[AArch64] Fix testcase compilation failure
Newer distros carry newer headers that contains MTE definitions. Account for that fact in the MTE testcases (gdb.arch/aarch64-mte.exp) and define constants conditionally to prevent compilation failures.
This commit is contained in:
@@ -30,22 +30,27 @@
|
||||
#include <sys/prctl.h>
|
||||
|
||||
/* From arch/arm64/include/uapi/asm/hwcap.h */
|
||||
#ifndef HWCAP2_MTE
|
||||
#define HWCAP2_MTE (1 << 18)
|
||||
#endif
|
||||
|
||||
/* From arch/arm64/include/uapi/asm/mman.h */
|
||||
#ifndef PROT_MTE
|
||||
#define PROT_MTE 0x20
|
||||
#endif
|
||||
|
||||
#ifndef PR_SET_TAGGED_ADDR_CTRL
|
||||
#define PR_SET_TAGGED_ADDR_CTRL 55
|
||||
#define PR_TAGGED_ADDR_ENABLE (1UL << 0)
|
||||
#endif
|
||||
|
||||
/* From include/uapi/linux/prctl.h */
|
||||
#define PR_SET_TAGGED_ADDR_CTRL 55
|
||||
#define PR_GET_TAGGED_ADDR_CTRL 56
|
||||
#define PR_TAGGED_ADDR_ENABLE (1UL << 0)
|
||||
#ifndef PR_MTE_TCF_SHIFT
|
||||
#define PR_MTE_TCF_SHIFT 1
|
||||
#define PR_MTE_TCF_NONE (0UL << PR_MTE_TCF_SHIFT)
|
||||
#define PR_MTE_TCF_SYNC (1UL << PR_MTE_TCF_SHIFT)
|
||||
#define PR_MTE_TCF_ASYNC (2UL << PR_MTE_TCF_SHIFT)
|
||||
#define PR_MTE_TCF_MASK (3UL << PR_MTE_TCF_SHIFT)
|
||||
#define PR_MTE_TAG_SHIFT 3
|
||||
#define PR_MTE_TAG_MASK (0xffffUL << PR_MTE_TAG_SHIFT)
|
||||
#endif
|
||||
|
||||
void
|
||||
access_memory (unsigned char *tagged_ptr, unsigned char *untagged_ptr)
|
||||
|
||||
Reference in New Issue
Block a user