treewide: Move device_tree to commonlib
[coreboot2.git] / payloads / libpayload / include / arm / arch / asm.h
blobd50c63ea69f22e4ba604070bcc7748a8ec861705
1 /*
3 * Copyright 2013 Google Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #ifndef __ARM_ASM_H
16 #define __ARM_ASM_H
18 /* __arm__ is defined regardless of Thumb mode, so need to order this right */
19 #if defined __thumb2__
20 # define ARM(x...)
21 # define THUMB(x...) x
22 # define W(instr) instr.w
23 #elif defined __thumb__
24 # error You are not compiling Thumb2, this won't work!
25 #else
26 # define ARM(x...) x
27 # define THUMB(x...)
28 # define W(instr) instr
29 #endif
31 #define ALIGN .align 0
33 #define ENDPROC(name) \
34 .type name, %function; \
35 END(name)
37 #define ENTRY(name) \
38 .section .text.name, "ax", %progbits; \
39 .global name; \
40 ALIGN; \
41 name:
43 #define END(name) \
44 .size name, .-name
46 /* Thumb code uses the (new) unified assembly syntax. */
47 THUMB( .syntax unified )
49 #endif /* __ARM_ASM_H */