-
Notifications
You must be signed in to change notification settings - Fork 2
/
compiler.h
41 lines (34 loc) · 1.05 KB
/
compiler.h
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
/**
* @file compiler.h
*
* @date 23.06.2019
* @author twatorowski ([email protected])
*
* @brief Compiler defines
*/
#ifndef COMPILER_H_
#define COMPILER_H_
/* inline assembler */
#define ASM __asm__
/* section attribute */
#define SECTION(x) __attribute__ ((section (x)))
/* optimization attribute */
#define OPTIMIZE(x) __attribute__ ((optimize (x)))
/* packed */
#define PACKED __attribute__ ((packed))
/* alignment */
#define ALIGNED(x) __attribute__ ((aligned (x)))
/* enfoce function being always inline */
#define ALWAYS_INLINE __attribute__ ((always_inline))
/* variable unused */
#define UNUSED __attribute__ ((unused))
/* variable unused */
#define USED __attribute__ ((used))
/* naked function */
#define NAKED __attribute__ ((naked))
/* prevent inlining */
#define NOINLINE __attribute__ ((noinline))
/* additional helpers/shorthands, used has to go here otherwise the optimizer may
* clear out the function call, thus removing it from section */
#define RAM_CODE NOINLINE SECTION(".ram_code")
#endif /* COMPILER_H_ */