xref: /linux/arch/alpha/include/asm/special_insns.h (revision 955abe0a1b41de5ba61fe4cd614ebc123084d499)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ALPHA_SPECIAL_INSNS_H
3 #define __ALPHA_SPECIAL_INSNS_H
4 
5 enum implver_enum {
6 	IMPLVER_EV4,
7 	IMPLVER_EV5,
8 	IMPLVER_EV6
9 };
10 
11 #ifdef CONFIG_ALPHA_GENERIC
12 #define implver()				\
13 ({ unsigned long __implver;			\
14    __asm__ ("implver %0" : "=r"(__implver));	\
15    (enum implver_enum) __implver; })
16 #else
17 /* Try to eliminate some dead code.  */
18 #ifdef CONFIG_ALPHA_EV56
19 #define implver() IMPLVER_EV5
20 #endif
21 #if defined(CONFIG_ALPHA_EV6)
22 #define implver() IMPLVER_EV6
23 #endif
24 #endif
25 
26 enum amask_enum {
27 	AMASK_BWX = (1UL << 0),
28 	AMASK_FIX = (1UL << 1),
29 	AMASK_CIX = (1UL << 2),
30 	AMASK_MAX = (1UL << 8),
31 	AMASK_PRECISE_TRAP = (1UL << 9),
32 };
33 
34 #define amask(mask)						\
35 ({ unsigned long __amask, __input = (mask);			\
36    __asm__ ("amask %1,%0" : "=r"(__amask) : "rI"(__input));	\
37    __amask; })
38 
39 #endif /* __ALPHA_SPECIAL_INSNS_H */
40