1 /* USER CODE BEGIN Header */ 2 /** 3 ****************************************************************************** 4 * @file asm.h 5 * @author GPM WBL Application Team 6 * @brief ASM Compiler-dependent macros. 7 ****************************************************************************** 8 * @attention 9 * 10 * Copyright (c) 2024 STMicroelectronics. 11 * All rights reserved. 12 * 13 * This software is licensed under terms that can be found in the LICENSE file 14 * in the root directory of this software component. 15 * If no LICENSE file comes with this software, it is provided AS-IS. 16 * 17 ****************************************************************************** 18 */ 19 /* USER CODE END Header */ 20 21 /* Define to prevent recursive inclusion -------------------------------------*/ 22 23 #ifndef __ASM_H__ 24 #define __ASM_H__ 25 26 #ifndef DOXYGEN_SHOULD_SKIP_THIS 27 28 #if defined(__ICCARM__) || defined(__IAR_SYSTEMS_ASM__) 29 #define __CODE__ SECTION .text:CODE:REORDER:NOROOT(2) 30 #define __BSS__ SECTION .bss:DATA:NOROOT(2) 31 #define __EXPORT__ EXPORT 32 #define __IMPORT__ IMPORT 33 #define __THUMB__ THUMB 34 #define EXPORT_FUNC(f) f: 35 #define __END__ END 36 #define __SPACE__ DS8 37 #define GLOBAL_VAR(val) val: 38 #define ENDFUNC 39 #define ALIGN_MEM(n) 40 #define LABEL(label) label: 41 42 #elif defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)) 43 #define __CODE__ AREA |.text|, CODE, READONLY 44 #define __THUMB__ 45 #define EXPORT_FUNC(f) f PROC 46 #define __BSS__ AREA |.bss|, DATA, READWRITE, NOINIT 47 #define __EXPORT__ EXPORT 48 #define __IMPORT__ IMPORT 49 #define __SPACE__ SPACE 50 #define GLOBAL_VAR(val) val 51 #define __END__ END 52 #define ENDFUNC ENDP 53 #define ALIGN_MEM(n) ALIGN n 54 #define LABEL(label) label 55 56 #elif defined(__GNUC__) 57 .syntax unified 58 .cpu cortex-m0 59 .fpu softvfp 60 .thumb 61 #define __CODE__ .text 62 #define __BSS__ .bss 63 #define __EXPORT__ .global 64 #define __IMPORT__ .extern 65 #define __THUMB__ .thumb_func 66 #define __END__ .end 67 #define __SPACE__ .space 68 #define EXPORT_FUNC(f) f: 69 #define GLOBAL_VAR(val) val: 70 #define ENDFUNC 71 #define ALIGN_MEM(n) .align n>>1 72 #define LABEL(label) label: 73 74 #endif 75 76 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 77 #endif /* __ASM_H__ */ 78