summaryrefslogtreecommitdiff
path: root/xen/arch/arm/include/asm/macros.h
blob: dc791245df764a39babed3f2e015473aa1d723e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef __ASM_MACROS_H
#define __ASM_MACROS_H

#ifndef __ASSEMBLY__
# error "This file should only be included in assembly file"
#endif

#include <asm/alternative.h>

    /*
     * Speculative barrier
     */
    .macro sb
alternative_if_not ARM_HAS_SB
    dsb nsh
    isb
alternative_else
    /*
     * SB encoding in hexadecimal to prevent recursive macro.
     * extra nop is required to keep same number of instructions on both sides
     * of the alternative.
     */
#if defined(CONFIG_ARM_32)
    .inst 0xf57ff070
#elif defined(CONFIG_ARM_64)
    .inst 0xd50330ff
#else
#   error "missing sb encoding for ARM variant"
#endif
    nop
alternative_endif
    .endm

#if defined (CONFIG_ARM_32)
# include <asm/arm32/macros.h>
#elif defined(CONFIG_ARM_64)
# include <asm/arm64/macros.h>
#else
# error "unknown ARM variant"
#endif

    /* NOP sequence  */
    .macro nops, num
    .rept   \num
    nop
    .endr
    .endm

#endif /* __ASM_ARM_MACROS_H */