1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef __ARCH_SPR_DEF_H__
15#define __ARCH_SPR_DEF_H__
16
17#include <uapi/arch/spr_def.h>
18
19
20
21
22
23
24
25
26
27
28#if CONFIG_KERNEL_PL != 1 && CONFIG_KERNEL_PL != 2
29#error CONFIG_KERNEL_PL must be 1 or 2
30#endif
31
32
33#define __concat4(a, b, c, d) a ## b ## c ## d
34#define _concat4(a, b, c, d) __concat4(a, b, c, d)
35
36#ifdef __tilegx__
37
38
39
40#define SPR_INTERRUPT_MASK_K \
41 _concat4(SPR_INTERRUPT_MASK_, CONFIG_KERNEL_PL,,)
42#define SPR_INTERRUPT_MASK_SET_K \
43 _concat4(SPR_INTERRUPT_MASK_SET_, CONFIG_KERNEL_PL,,)
44#define SPR_INTERRUPT_MASK_RESET_K \
45 _concat4(SPR_INTERRUPT_MASK_RESET_, CONFIG_KERNEL_PL,,)
46#define SPR_INTERRUPT_VECTOR_BASE_K \
47 _concat4(SPR_INTERRUPT_VECTOR_BASE_, CONFIG_KERNEL_PL,,)
48
49#define SPR_IPI_MASK_K \
50 _concat4(SPR_IPI_MASK_, CONFIG_KERNEL_PL,,)
51#define SPR_IPI_MASK_RESET_K \
52 _concat4(SPR_IPI_MASK_RESET_, CONFIG_KERNEL_PL,,)
53#define SPR_IPI_MASK_SET_K \
54 _concat4(SPR_IPI_MASK_SET_, CONFIG_KERNEL_PL,,)
55#define SPR_IPI_EVENT_K \
56 _concat4(SPR_IPI_EVENT_, CONFIG_KERNEL_PL,,)
57#define SPR_IPI_EVENT_RESET_K \
58 _concat4(SPR_IPI_EVENT_RESET_, CONFIG_KERNEL_PL,,)
59#define SPR_IPI_EVENT_SET_K \
60 _concat4(SPR_IPI_EVENT_SET_, CONFIG_KERNEL_PL,,)
61#define INT_IPI_K \
62 _concat4(INT_IPI_, CONFIG_KERNEL_PL,,)
63
64#define SPR_SINGLE_STEP_CONTROL_K \
65 _concat4(SPR_SINGLE_STEP_CONTROL_, CONFIG_KERNEL_PL,,)
66#define SPR_SINGLE_STEP_EN_K_K \
67 _concat4(SPR_SINGLE_STEP_EN_, CONFIG_KERNEL_PL, _, CONFIG_KERNEL_PL)
68#define INT_SINGLE_STEP_K \
69 _concat4(INT_SINGLE_STEP_, CONFIG_KERNEL_PL,,)
70
71#else
72
73
74
75#define SPR_INTERRUPT_MASK_K_0 \
76 _concat4(SPR_INTERRUPT_MASK_, CONFIG_KERNEL_PL, _0,)
77#define SPR_INTERRUPT_MASK_K_1 \
78 _concat4(SPR_INTERRUPT_MASK_, CONFIG_KERNEL_PL, _1,)
79#define SPR_INTERRUPT_MASK_SET_K_0 \
80 _concat4(SPR_INTERRUPT_MASK_SET_, CONFIG_KERNEL_PL, _0,)
81#define SPR_INTERRUPT_MASK_SET_K_1 \
82 _concat4(SPR_INTERRUPT_MASK_SET_, CONFIG_KERNEL_PL, _1,)
83#define SPR_INTERRUPT_MASK_RESET_K_0 \
84 _concat4(SPR_INTERRUPT_MASK_RESET_, CONFIG_KERNEL_PL, _0,)
85#define SPR_INTERRUPT_MASK_RESET_K_1 \
86 _concat4(SPR_INTERRUPT_MASK_RESET_, CONFIG_KERNEL_PL, _1,)
87
88#endif
89
90
91
92#define SPR_SYSTEM_SAVE_K_0 \
93 _concat4(SPR_SYSTEM_SAVE_, CONFIG_KERNEL_PL, _0,)
94#define SPR_SYSTEM_SAVE_K_1 \
95 _concat4(SPR_SYSTEM_SAVE_, CONFIG_KERNEL_PL, _1,)
96#define SPR_SYSTEM_SAVE_K_2 \
97 _concat4(SPR_SYSTEM_SAVE_, CONFIG_KERNEL_PL, _2,)
98#define SPR_SYSTEM_SAVE_K_3 \
99 _concat4(SPR_SYSTEM_SAVE_, CONFIG_KERNEL_PL, _3,)
100#define SPR_EX_CONTEXT_K_0 \
101 _concat4(SPR_EX_CONTEXT_, CONFIG_KERNEL_PL, _0,)
102#define SPR_EX_CONTEXT_K_1 \
103 _concat4(SPR_EX_CONTEXT_, CONFIG_KERNEL_PL, _1,)
104#define SPR_INTCTRL_K_STATUS \
105 _concat4(SPR_INTCTRL_, CONFIG_KERNEL_PL, _STATUS,)
106#define INT_INTCTRL_K \
107 _concat4(INT_INTCTRL_, CONFIG_KERNEL_PL,,)
108
109#endif
110