xref: /openbmc/u-boot/arch/sh/include/asm/macro.h (revision 9d466f2f)
1 /*
2  * Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
3  *
4  * SPDX-License-Identifier:	GPL-2.0+
5  */
6 
7 #ifndef __MACRO_H__
8 #define __MACRO_H__
9 #ifdef __ASSEMBLY__
10 
11 .macro	write32, addr, data
12 	mov.l \addr ,r1
13 	mov.l \data ,r0
14 	mov.l r0, @r1
15 .endm
16 
17 .macro	write16, addr, data
18 	mov.l \addr ,r1
19 	mov.w \data ,r0
20 	mov.w r0, @r1
21 .endm
22 
23 .macro	write8, addr, data
24 	mov.l \addr ,r1
25 	mov.l \data ,r0
26 	mov.b r0, @r1
27 .endm
28 
29 .macro	wait_timer, time
30 	mov.l	\time ,r3
31 1:
32 	nop
33 	tst	r3, r3
34 	bf/s	1b
35 	dt	r3
36 .endm
37 
38 #endif /* __ASSEMBLY__ */
39 #endif /* __MACRO_H__ */
40