xref: /linux/arch/sh/include/asm/bl_bit_32.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2e839ca52SDavid Howells #ifndef __ASM_SH_BL_BIT_32_H
3e839ca52SDavid Howells #define __ASM_SH_BL_BIT_32_H
4e839ca52SDavid Howells 
set_bl_bit(void)5e839ca52SDavid Howells static inline void set_bl_bit(void)
6e839ca52SDavid Howells {
7e839ca52SDavid Howells 	unsigned long __dummy0, __dummy1;
8e839ca52SDavid Howells 
9e839ca52SDavid Howells 	__asm__ __volatile__ (
10e839ca52SDavid Howells 		"stc	sr, %0\n\t"
11e839ca52SDavid Howells 		"or	%2, %0\n\t"
12e839ca52SDavid Howells 		"and	%3, %0\n\t"
13e839ca52SDavid Howells 		"ldc	%0, sr\n\t"
14e839ca52SDavid Howells 		: "=&r" (__dummy0), "=r" (__dummy1)
15e839ca52SDavid Howells 		: "r" (0x10000000), "r" (0xffffff0f)
16e839ca52SDavid Howells 		: "memory"
17e839ca52SDavid Howells 	);
18e839ca52SDavid Howells }
19e839ca52SDavid Howells 
clear_bl_bit(void)20e839ca52SDavid Howells static inline void clear_bl_bit(void)
21e839ca52SDavid Howells {
22e839ca52SDavid Howells 	unsigned long __dummy0, __dummy1;
23e839ca52SDavid Howells 
24e839ca52SDavid Howells 	__asm__ __volatile__ (
25e839ca52SDavid Howells 		"stc	sr, %0\n\t"
26e839ca52SDavid Howells 		"and	%2, %0\n\t"
27e839ca52SDavid Howells 		"ldc	%0, sr\n\t"
28e839ca52SDavid Howells 		: "=&r" (__dummy0), "=r" (__dummy1)
29e839ca52SDavid Howells 		: "1" (~0x10000000)
30e839ca52SDavid Howells 		: "memory"
31e839ca52SDavid Howells 	);
32e839ca52SDavid Howells }
33e839ca52SDavid Howells 
34e839ca52SDavid Howells #endif /* __ASM_SH_BL_BIT_32_H */
35