Path: blob/main/contrib/arm-optimized-routines/string/aarch64/asmdefs.h
39491 views
/*1* Macros for asm code. AArch64 version.2*3* Copyright (c) 2019-2023, Arm Limited.4* SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception5*/67#ifndef _ASMDEFS_H8#define _ASMDEFS_H910/* Branch Target Identitication support. */11#define BTI_C hint 3412#define BTI_J hint 3613/* Return address signing support (pac-ret). */14#define PACIASP hint 25; .cfi_window_save15#define AUTIASP hint 29; .cfi_window_save1617/* GNU_PROPERTY_AARCH64_* macros from elf.h. */18#define FEATURE_1_AND 0xc000000019#define FEATURE_1_BTI 120#define FEATURE_1_PAC 22122/* Add a NT_GNU_PROPERTY_TYPE_0 note. */23#define GNU_PROPERTY(type, value) \24.section .note.gnu.property, "a"; \25.p2align 3; \26.word 4; \27.word 16; \28.word 5; \29.asciz "GNU"; \30.word type; \31.word 4; \32.word value; \33.word 0; \34.text3536/* If set then the GNU Property Note section will be added to37mark objects to support BTI and PAC-RET. */38#ifndef WANT_GNU_PROPERTY39#define WANT_GNU_PROPERTY 140#endif4142#if WANT_GNU_PROPERTY43/* Add property note with supported features to all asm files. */44GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC)45#endif4647#define ENTRY_ALIGN(name, alignment) \48.global name; \49.type name,%function; \50.align alignment; \51name: \52.cfi_startproc; \53BTI_C;5455#define ENTRY(name) ENTRY_ALIGN(name, 6)5657#define ENTRY_ALIAS(name) \58.global name; \59.type name,%function; \60name:6162#define END(name) \63.cfi_endproc; \64.size name, .-name;6566#define L(l) .L ## l6768#endif697071