/* * Copyright (C) 2019 The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #pragma once // Defines constants used as part of the interface in an experimental MTE branch // of the Linux kernel, which may be found at: // // https://github.com/pcc/linux/tree/android-experimental-mte // // This interface should not be considered to be stable. #ifdef ANDROID_EXPERIMENTAL_MTE #define HWCAP2_MTE (1 << 18) #define PROT_MTE 0x20 #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) #define SEGV_MTEAERR 8 #define SEGV_MTESERR 9 #define PTRACE_PEEKMTETAGS 33 #define PTRACE_POKEMTETAGS 34 #endif