Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
assembler.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: Apache-2.0 */
2/*
3 * Copyright (C) 2021 Synopsys, Inc. (www.synopsys.com)
4 *
5 * Author: Vineet Gupta <vgupta@synopsys.com>
6 *
7 * Top level include file provding ISA pseudo-mnemonics for use in assemmler
8 * and inline assembly.
9 *
10 * - Helps code reuse across ARC64/ARC32/ARCv2
11 * e.g. "LDR" maps to 'LD' on 32-bit ISA, 'LDL' on 64-bit ARCv2/ARC64
12 *
13 * - Provides emulation with multiple instructions if the case be
14 * e.g. "DBNZ" implemented using 'SUB' and 'BRNE'
15 *
16 * - Looks more complex than it really is: mainly because Kconfig defines
17 * are not "honored" in inline assembly. So each varaint is unconditional
18 * code in a standalone file with Kconfig based #ifdef'ry here. During the
19 * build process, the "C" preprocessor runs through this file, leaving
20 * just the final variant include in code fed to compiler/assembler.
21 */
22
23#ifndef __ASM_ARC_ASM_H
24#define __ASM_ARC_ASM_H 1
25
26#ifdef _ASMLANGUAGE
27
28#if defined(CONFIG_ISA_ARCV3) && defined(CONFIG_64BIT)
29#define ARC_PTR .xword
30#define ARC_REGSZ 8
31#define ARC_REGSHIFT 3
33#else
34#define ARC_PTR .word
35#define ARC_REGSZ 4
36#define ARC_REGSHIFT 2
37
38#if defined(__CCAC__)
40#else
42#endif /* defined(__CCAC__) */
43
44#endif
45
46#else /* !_ASMLANGUAGE */
47
48#error "asm-compat macroses used not in assembler code!"
49
50#endif /* _ASMLANGUAGE */
51
52#endif