SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
linkage.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0+ */
2
3#ifndef __ARM32_LINKAGE_H__
4#define __ARM32_LINKAGE_H__
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10#define ALIGN .align 0
11#define ALIGN_STR ".align 0"
12
13#define ENTRY(name) \
14 .globl name; \
15 ALIGN; \
16 name:
17
18#define WEAK(name) \
19 .weak name; \
20 name:
21
22#define END(name) .size name, .- name
23
24#define ENDPROC(name) \
25 .type name, % function; \
26 END(name)
27
28/*
29 * CR1 bits (CP#15 CR1)
30 */
31#define CR_M (1 << 0) /* MMU enable */
32#define CR_A (1 << 1) /* Alignment abort enable */
33#define CR_C (1 << 2) /* Dcache enable */
34#define CR_W (1 << 3) /* Write buffer enable */
35#define CR_P (1 << 4) /* 32-bit exception handler */
36#define CR_D (1 << 5) /* 32-bit data address range */
37#define CR_L (1 << 6) /* Implementation defined */
38#define CR_B (1 << 7) /* Big endian */
39#define CR_S (1 << 8) /* System MMU protection */
40#define CR_R (1 << 9) /* ROM MMU protection */
41#define CR_F (1 << 10) /* Implementation defined */
42#define CR_Z (1 << 11) /* Implementation defined */
43#define CR_I (1 << 12) /* Icache enable */
44#define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */
45#define CR_RR (1 << 14) /* Round Robin cache replacement */
46#define CR_L4 (1 << 15) /* LDR pc can set T bit */
47#define CR_DT (1 << 16)
48#define CR_IT (1 << 18)
49#define CR_ST (1 << 19)
50#define CR_FI (1 << 21) /* Fast interrupt (lower latency mode) */
51#define CR_U (1 << 22) /* Unaligned access operation */
52#define CR_XP (1 << 23) /* Extended page tables */
53#define CR_VE (1 << 24) /* Vectored interrupts */
54#define CR_EE (1 << 25) /* Exception (Big) Endian */
55#define CR_TRE (1 << 28) /* TEX remap enable */
56#define CR_AFE (1 << 29) /* Access flag enable */
57#define CR_TE (1 << 30) /* Thumb exception enable */
58
59/* ARM relocs */
60#define R_ARM_NONE 0 /* No reloc */
61#define R_ARM_RELATIVE 23 /* Adjust by program base */
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif /* __ARM32_LINKAGE_H__ */